Skip to content

Commit

Permalink
Fix more javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Jan 13, 2024
1 parent 4ddfedd commit 1e7f338
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
* <p>
* This is similar to {@link StructuredTextDelims} except that delimiters can be
* escaped using the backslash character.
* </p>
* <ul>
* <li>Two consecutive backslashes in a delimited part are treated like one
* regular character.</li>
* <li>An ending delimiter preceded by an odd number of backslashes is treated
* like a regular character within the delimited part.</li>
* </ul>
* </p>
*/
public abstract class StructuredTextDelimsEsc extends StructuredTextDelims {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,34 +226,39 @@ static public void processSeparator(String text, StructuredTextCharTypes charTyp
* LTR base direction, {@link IStructuredTextExpert#leanToFullText
* leanToFullText} adds LRE+LRM at the head of the <i>full</i> text and LRM+PDF
* at its end.
* </p>
* <p>
* When the orientation is <code>ORIENT_CONTEXTUAL_LTR</code> or
* <code>ORIENT_CONTEXTUAL_RTL</code> and the data content would resolve to a
* RTL orientation while the structured text has a LTR base direction,
* {@link IStructuredTextExpert#leanToFullText leanToFullText} adds LRM at the
* head of the <i>full</i> text.
* </p>
* <p>
* When the orientation is <code>ORIENT_CONTEXTUAL_LTR</code> or
* <code>ORIENT_CONTEXTUAL_RTL</code> and the data content would resolve to a
* LTR orientation while the structured text has a RTL base direction,
* {@link IStructuredTextExpert#leanToFullText leanToFullText} adds RLM at the
* head of the <i>full</i> text.
* </p>
* <p>
* When the orientation is <code>ORIENT_UNKNOWN</code> and the structured text
* has a LTR base direction, {@link IStructuredTextExpert#leanToFullText
* leanToFullText} adds LRE+LRM at the head of the <i>full</i> text and LRM+PDF
* at its end.
* </p>
* <p>
* When the orientation is <code>ORIENT_UNKNOWN</code> and the structured text
* has a RTL base direction, {@link IStructuredTextExpert#leanToFullText
* leanToFullText} adds RLE+RLM at the head of the <i>full</i> text and RLM+PDF
* at its end.
* </p>
* <p>
* When the orientation is <code>ORIENT_IGNORE</code>,
* {@link IStructuredTextExpert#leanToFullText leanToFullText} does not add any
* directional formatting characters as either prefix or suffix of the
* <i>full</i> text.
* <p>
* </p>
*/
@Override
public String leanToFullText(String text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ public String toString() {
* If invoking the StringMatcher with string literals in Java, don't forget
* escape characters are represented by "\\".
* </p>
* <p An empty pattern matches only an empty text, unless
* {@link #usePrefixMatch()} is used, in which case it always matches.
* <p>
* An empty pattern matches only an empty text, unless {@link #usePrefixMatch()}
* is used, in which case it always matches.
* </p>
*
* @param pattern the pattern to match text against, must not be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
* <p>
* For example, the following handler is registered to handle critical memory
* events:
*
* </p>
* <pre>
* BundleContext context = getContext();
* EventHandler handler = getHandler();
* Hashtable ht = new Hashtable();
* ht.put(EventConstants.EVENT_TOPIC, MemoryEventConstants.TOPIC_CRITICAL);
* context.registerService(EventHandler.class.getName(), handler, ht);
* </pre>
*
* <p>
* There is no policy implemented for sending memory events in Equinox or
* Eclipse by default. Another bundle must implement the policy that determines
* when to send memory events. This policy must use the Event Admin Service to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ public ClassLoader run() {
}

/**
* Creates a privileged action that can be used to construct a SecureAction object.
* The recommended way to construct a SecureAction object is the following: <p>
* Creates a privileged action that can be used to construct a SecureAction
* object. The recommended way to construct a SecureAction object is the
* following:
*
* <pre>
* SecureAction secureAction = (SecureAction) AccessController.doPrivileged(SecureAction.createSecureAction());
* </pre>
* @return a privileged action object that can be used to construct a SecureAction object.
*
* @return a privileged action object that can be used to construct a
* SecureAction object.
*/
public static PrivilegedAction<SecureAction> createSecureAction() {
return new PrivilegedAction<SecureAction>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
import org.eclipse.osgi.storage.url.bundleresource.Handler;

/**
* The BundleFile API is used by Adaptors to read resources out of an
* installed Bundle in the Framework.
* <p/>
* The BundleFile API is used by Adaptors to read resources out of an installed
* Bundle in the Framework.
* <p>
* Clients wishing to modify or extend the functionality of this class at
* runtime should extend the associated {@link BundleFileWrapper decorator}
* instead.
* </p>
*/
abstract public class BundleFile {
static final SecureAction secureAction = AccessController.doPrivileged(SecureAction.createSecureAction());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@

/**
* A {@link BundleFile bundle file} decorator.
* <p/>
* <p>
* Clients wishing to modify or extend the behavior of a bundle file at runtime
* should extend this class instead. A hook is provided by the related {@link
* BundleFileWrapperFactoryHook abstract factory} class in response to a
* {@link BundleFileWrapperFactoryHook#wrapBundleFile(BundleFile,
* BundleInfo.Generation, boolean) call} from the framework.
* should extend this class instead. A hook is provided by the related
* {@link BundleFileWrapperFactoryHook abstract factory} class in response to a
* {@link BundleFileWrapperFactoryHook#wrapBundleFile(BundleFile, BundleInfo.Generation, boolean)
* call} from the framework.
* </p>
*/
public class BundleFileWrapper extends BundleFile {
private final BundleFile bundleFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
package org.eclipse.osgi.storage.url.reference;

import java.io.IOException;
import java.net.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;

/**
* URLStreamHandler for reference protocol. A reference URL is used to hold a
* reference to a local file URL. A reference URL allows bundles to be installed
* by reference. This means the content of the bundle will not be copied. Instead
* the content of the bundle will be loaded from the reference location specified
* by the reference URL. The Framework only supports reference URLs that refer
* to a local file URL. For example: <p>
* URLStreamHandler for reference protocol. A reference URL is used to hold a
* reference to a local file URL. A reference URL allows bundles to be installed
* by reference. This means the content of the bundle will not be copied.
* Instead the content of the bundle will be loaded from the reference location
* specified by the reference URL. The Framework only supports reference URLs
* that refer to a local file URL. For example:
*
* <pre>
* reference:file:/eclipse/plugins/org.eclipse.myplugin_1.0.0/
* reference:file:/eclispe/plugins/org.eclipse.mybundle_1.0.0.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
public interface LogFilter {

/**
* @param bundle The logging bundle
* @param loggerName The name of the <code>Logger<code>
* @param logLevel The log level or severity
* @param bundle The logging bundle
* @param loggerName The name of the <code>Logger</code>
* @param logLevel The log level or severity
* @see LogEntry
* @see Logger
* @see ExtendedLogReaderService#addLogListener(org.osgi.service.log.LogListener, LogFilter)
* @see ExtendedLogReaderService#addLogListener(org.osgi.service.log.LogListener,
* LogFilter)
*/
boolean isLoggable(Bundle bundle, String loggerName, int logLevel);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,72 +20,80 @@
import org.osgi.service.resolver.ResolutionException;

/**
* A resolution report is associated with a single resolve process. Entries
* contained in a resolution report will contain entries for all resources
* that were attempted to be resolved in a single resolve process.
* Resolution reports are gathered by a special type of {@link ResolverHook}
* which implements the report {@link Listener} interface. The following
* example demonstrates how to gather a resolution report for a list of bundles
* A resolution report is associated with a single resolve process. Entries
* contained in a resolution report will contain entries for all resources that
* were attempted to be resolved in a single resolve process. Resolution reports
* are gathered by a special type of {@link ResolverHook} which implements the
* report {@link Listener} interface. The following example demonstrates how to
* gather a resolution report for a list of bundles
*
* <pre>
public static ResolutionReport getResolutionReport(Bundle[] bundles, BundleContext context) {
DiagReportListener reportListener = new DiagReportListener(bundles);
ServiceRegistration<ResolverHookFactory> hookReg = context.registerService(ResolverHookFactory.class, reportListener, null);
try {
Bundle systemBundle = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class);
frameworkWiring.resolveBundles(Arrays.asList(bundles));
return reportListener.getReport();
} finally {
hookReg.unregister();
}
}
private static class DiagReportListener implements ResolverHookFactory {
private final Collection<BundleRevision> targetTriggers = new ArrayList<BundleRevision>();
volatile ResolutionReport report = null;
public DiagReportListener(Bundle[] bundles) {
for (Bundle bundle : bundles) {
BundleRevision revision = bundle.adapt(BundleRevision.class);
if (revision != null && revision.getWiring() == null) {
targetTriggers.add(revision);
}
}
}
class DiagResolverHook implements ResolverHook, ResolutionReport.Listener {
public void handleResolutionReport(ResolutionReport report) {
DiagReportListener.this.report = report;
}
public void filterResolvable(Collection<BundleRevision> candidates) { }
public void filterSingletonCollisions(BundleCapability singleton,
Collection<BundleCapability> collisionCandidates) { }
public void filterMatches(BundleRequirement requirement,
Collection<BundleCapability> candidates) { }
public void end() { }
}
public ResolverHook begin(Collection<BundleRevision> triggers) {
if (triggers.containsAll(targetTriggers)) {
// this is the triggers we are looking for
return new DiagResolverHook();
}
// did not find the expected triggers do not participate
// in the resolve process to gather the report
return null;
}
ResolutionReport getReport() {
return report;
}
}
*
* public static ResolutionReport getResolutionReport(Bundle[] bundles, BundleContext context) {
* DiagReportListener reportListener = new DiagReportListener(bundles);
* ServiceRegistration&lt;ResolverHookFactory&gt; hookReg = context.registerService(ResolverHookFactory.class,
* reportListener, null);
* try {
* Bundle systemBundle = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
* FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class);
* frameworkWiring.resolveBundles(Arrays.asList(bundles));
* return reportListener.getReport();
* } finally {
* hookReg.unregister();
* }
* }
*
* private static class DiagReportListener implements ResolverHookFactory {
* private final Collection&lt;BundleRevision&gt; targetTriggers = new ArrayList&lt;BundleRevision&gt;();
* volatile ResolutionReport report = null;
*
* public DiagReportListener(Bundle[] bundles) {
* for (Bundle bundle : bundles) {
* BundleRevision revision = bundle.adapt(BundleRevision.class);
* if (revision != null &amp;&amp; revision.getWiring() == null) {
* targetTriggers.add(revision);
* }
* }
*
* }
*
* class DiagResolverHook implements ResolverHook, ResolutionReport.Listener {
*
* public void handleResolutionReport(ResolutionReport report) {
* DiagReportListener.this.report = report;
* }
*
* public void filterResolvable(Collection&lt;BundleRevision&gt; candidates) {
* }
*
* public void filterSingletonCollisions(BundleCapability singleton,
* Collection&lt;BundleCapability&gt; collisionCandidates) {
* }
*
* public void filterMatches(BundleRequirement requirement, Collection&lt;BundleCapability&gt; candidates) {
* }
*
* public void end() {
* }
*
* }
*
* public ResolverHook begin(Collection&lt;BundleRevision&gt; triggers) {
* if (triggers.containsAll(targetTriggers)) {
* // this is the triggers we are looking for
* return new DiagResolverHook();
* }
* // did not find the expected triggers do not participate
* // in the resolve process to gather the report
* return null;
* }
*
* ResolutionReport getReport() {
* return report;
* }
* }
* </pre>
*
* @since 3.10
*/
public interface ResolutionReport {
Expand Down

0 comments on commit 1e7f338

Please sign in to comment.