Debian Codegraph @

src/aQute/bnd/annotation/headers/ProvideCapability.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 * Define a Provide Capability clause in the manifest.
10 * <p>
11 * Since this annotation can only be applied once, it is possible to create an
12 * annotation that models a specific capability. For example:
13 *
14 * <pre>
15 * interface Webserver {
16 * &#64;ProvideCapability(ns = "osgi.extender", name = "aQute.webserver", version = "${&#64;version}")
17 * &#64;interface Provide {}
18 *
19 * &#64;RequireCapability(ns = "osgi.extender", filter = "(&amp;(osgi.extender=aQute.webserver)${frange;${&#64;version}})")
20 * &#64;interface Require {}
21 * }
22 *
23 * &#64;Webserver.Provide
24 * public class MyWebserver {}
25 * </pre>
26 *
27 * @deprecated see {@code org.osgi.annotation.bundle.Capability}
28 */
29 @Deprecated
30 @Retention(RetentionPolicy.CLASS)
31 @Target({
32 ElementType.ANNOTATION_TYPE, ElementType.TYPE
33 })
34 public @interface ProvideCapability {
35 /**
36 * Appended at the end of the clause (after a ';'). Can be used to add
37 * additional attributes and directives.
38 */
39 String value() default "";
40
41 /**
42 * The capability namespace. For example: {@code osgi.contract}.
43 */
44 String ns();
45
46 /**
47 * The name of the capability. If this is set, a property will be added as
48 * {ns}={name}. This is the custom pattern for OSGi namespaces. Leaving this
49 * unfilled, requires the {@link #value()} to be used to specify the name of
50 * the capability, if needed. For example {@code aQute.sse}.
51 */
52 String name() default "";
53
54 /**
55 * The version of the capability. This must be a valid OSGi version.
56 */
57 String version() default "";
58
59 /**
60 * Effective time. Specifies the time a capability is available, either
61 * resolve (default) or another name. The OSGi framework resolver only
62 * considers Capabilities without an effective directive or
63 * effective:=resolve. Capabilities with other values for the effective
64 * directive can be considered by an external agent.
65 */
66 String effective() default "resolve";
67
68 /**
69 * The uses directive lists package names that are used by this Capability.
70 * This information is intended to be used for <em>uses constraints</em>,
71 */
72 String[] uses() default {};
73
74 /**
75 * Mandatory attributes. Forces the resolver to only satisfy filters that
76 * refer to all listed attributes.
77 */
78 String[] mandatory() default {};
79 }