Top Description Methods
org.osgi.annotation.bundle

public @Interface Capability

extends Annotation
Annotations
@Documented
@Retention:CLASS
@Target:TYPE, PACKAGE
@Repeatable:Capabilities
Imports
java.lang.annotation.Documented, .ElementType, .Repeatable, .Retention, .RetentionPolicy, .Target

Define a capability for a bundle.

For example:

@Capability(namespace=ExtenderNamespace.EXTENDER_NAMESPACE,
            name="osgi.component", version="1.3.0")

This annotation is not retained at runtime. It is for use by tools to generate bundle manifests or otherwise process the type or package.

This annotation can be used to annotate an annotation

Author
$Id: 11a1102cbf7b185c0cae0a0b34da890439d078d6 $

Method Summary

Modifier and TypeMethod and Description
public String[]
attribute()

A list of attribute or directive names and values.

public String
effective()

The effective time of this capability.

public String
name()

The name of this capability within the namespace.

public String
namespace()

The namespace of this capability.

public Class<?>[]
uses()

A list of classes whose packages are inspected to calculate the uses directive for this capability.

public String
version()

The version of this capability.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

attributeback to summary
public String[] attribute()

A list of attribute or directive names and values.

Each string should be specified in the form:

  • "name=value" for attributes.
  • "name:type=value" for typed attributes.
  • "name:=value" for directives.
These are added, separated by semicolons, to the capability clause.
effectiveback to summary
public String effective()

The effective time of this capability.

Specifies the time the capability is available. The OSGi framework resolver only considers capabilities without an effective directive or effective:=resolve. Capabilities with other values for the effective directive can be considered by an external agent.

If not specified, the effective directive is omitted from the capability clause.

nameback to summary
public String name()

The name of this capability within the namespace.

If specified, adds an attribute with the name of the namespace and the value of the specified name to the capability clause.

namespaceback to summary
public String namespace()

The namespace of this capability.

usesback to summary
public Class<?>[] uses()

A list of classes whose packages are inspected to calculate the uses directive for this capability.

If not specified, the uses directive is omitted from the capability clause.

versionback to summary
public String version()

The version of this capability.

If specified, adds an attribute with the name and type of version:Version and the value of the specified version to the capability clause.

The specified version must be a valid OSGi version string.