Debian Codegraph @

src/aQute/bnd/annotation/headers/RequireCapability.java

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 package aQute.bnd.annotation.headers;
2
3 import java.lang.annotation.ElementType;
4 import java.lang.annotation.Retention;
5 import java.lang.annotation.RetentionPolicy;
6 import java.lang.annotation.Target;
7
8 /**
9 * <p>
10 * The Bundle’s Require-Capability header
11 * </p>
12 * <p>
13 * Typically used as a meta-annotation, i.e. an annotation placed on another
14 * annotation, which we will call the <em>user-defined annotation</em>. When the
15 * user-defined annotation is found on a class within the bundle, an entry in
16 * the <code>Require-Capability</code> header is added. The filter expression of
17 * the requirement may be parameterised with values from the user-defined
18 * annotation. For example, given the following declarations:
19 * </p>
20 *
21 * <pre>
22 * &#64;RequireCapability( ns = "com.acme.engine", effective = "active", filter = "(com.acme.engine=${type})")
23 * public &#64;interface Engine { String type(); }
24 * &#64;Engine(type = "wankel") public class Vehicle { ... }
25 * </pre>
26 * <p>
27 * ... the following header will be generated in MANIFEST.MF:
28 * </p>
29 *
30 * <pre>
31 * Require-Capability:\ com.acme.engine; \ effective:=active; \
32 * filter:="(com.acme.engine=wankel)",\ ...
33 * </pre>
34 *
35 * @deprecated see {@code org.osgi.annotation.bundle.Requirement}
36 */
37 @Deprecated
38 @Retention(RetentionPolicy.CLASS)
39 @Target({
40 ElementType.ANNOTATION_TYPE, ElementType.TYPE
41 })
42 public @interface RequireCapability {
43
44 String value() default "";
45
46 String extra() default "";
47
48 /**
49 * The capability namespace. For example: {@code osgi.contract}.
50 */
51 String ns();
52
53 /**
54 * Specifies the time a Requirement is considered, either 'resolve'
55 * (default) or another name. The OSGi framework resolver only considers
56 * Requirements without an effective directive or effective:=resolve. Other
57 * Requirements can be considered by an external agent. Additional names for
58 * the effective directive should be registered with the OSGi Alliance. See
59 * <a href="http://www.osgi.org/Specifications/Reference">OSGi Reference
60 * Page</a>
61 */
62 String effective() default "resolve";
63
64 /**
65 * A filter expression that is asserted on the Capabilities belonging to the
66 * given namespace. The matching of the filter against the Capability is
67 * done on one Capability at a time. A filter like {@code (&(a=1)(b=2))}
68 * matches only a Capability that specifies both attributes at the required
69 * value, not two capabilties that each specify one of the attributes
70 * correctly. A filter is optional, if no filter directive is specified the
71 * Requirement always matches.
72 */
73 String filter() default "";
74
75 /**
76 * A mandatory Requirement forbids the bundle to resolve when the
77 * Requirement is not satisfied; an optional Requirement allows a bundle to
78 * resolve even if the Requirement is not satisfied. No wirings are created
79 * when this Requirement cannot be resolved, this can result in Class Not
80 * Found Exceptions when the bundle attempts to use a package that was not
81 * resolved because it was optional.
82 *
83 * @deprecated
84 */
85 @Deprecated
86 aQute.bnd.annotation.headers.Resolution resolution() default aQute.bnd.annotation.headers.Resolution.mandatory;
87
88 }