Top Description Inners Methods
org.osgi.annotation.bundle

public @Interface Requirement

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

Define a requirement for a bundle.

For example:

@Requirement(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 a package.

This annotation can be used to annotate an annotation.

Author
$Id: 8acf269bcf8de7a1b533c4ffcfb01856232b6c9f $

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Requirement.Cardinality

Cardinality for this requirement.

public static class
Requirement.Resolution

Resolution for this requirement.

Method Summary

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

A list of attribute or directive names and values.

public String
cardinality()

The cardinality of this requirement.

public String
effective()

The effective time of this requirement.

public String
filter()

The filter expression of this requirement, if any.

public String
name()

The name of this requirement within the namespace.

public String
namespace()

The namespace of this requirement.

public String
resolution()

The resolution policy of this requirement.

public String
version()

The floor version of the version range for this requirement.

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 requirement clause.
cardinalityback to summary
public String cardinality()

The cardinality of this requirement.

Indicates if this requirement can be wired a single time or multiple times.

If not specified, the cardinality directive is omitted from the requirement clause.

effectiveback to summary
public String effective()

The effective time of this requirement.

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

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

filterback to summary
public String filter()

The filter expression of this requirement, if any.

nameback to summary
public String name()

The name of this requirement within the namespace.

If specified, adds an expression, using the & operator with any specified filter(), to the requirement's filter directive to test that an attribute with the name of the namespace is equal to the value of the specified name.

namespaceback to summary
public String namespace()

The namespace of this requirement.

resolutionback to summary
public String resolution()

The resolution policy of this requirement.

A mandatory requirement forbids the bundle to resolve when this requirement is not satisfied; an optional requirement allows a bundle to resolve even if this requirement is not satisfied.

If not specified, the resolution directive is omitted from the requirement clause.

versionback to summary
public String version()

The floor version of the version range for this requirement.

If specified, adds a version range expression, using the & operator with any specified filter(), to the requirement's filter directive. The ceiling version of the version range is the next major version from the floor version. For example, if the specified version is 1.3, then the version range expression is (&(version>=1.3)(!(version>=2.0))).

The specified version must be a valid OSGi version string.

org.osgi.annotation.bundle back to summary

public final Class Requirement.Cardinality

extends Object
Class Inheritance

Cardinality for this requirement.

Field Summary

Modifier and TypeField and Description
public static final String
MULTIPLE

Indicates if the requirement can be wired multiple times.

public static final String
SINGLE

Indicates if the requirement can only be wired a single time.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MULTIPLEback to summary
public static final String MULTIPLE

Indicates if the requirement can be wired multiple times.

SINGLEback to summary
public static final String SINGLE

Indicates if the requirement can only be wired a single time.

Constructor Detail

Cardinalityback to summary
private Cardinality()
org.osgi.annotation.bundle back to summary

public final Class Requirement.Resolution

extends Object
Class Inheritance

Resolution for this requirement.

Field Summary

Modifier and TypeField and Description
public static final String
MANDATORY

A mandatory requirement forbids the bundle to resolve when the requirement is not satisfied.

public static final String
OPTIONAL

An optional requirement allows a bundle to resolve even if the requirement is not satisfied.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MANDATORYback to summary
public static final String MANDATORY

A mandatory requirement forbids the bundle to resolve when the requirement is not satisfied.

OPTIONALback to summary
public static final String OPTIONAL

An optional requirement allows a bundle to resolve even if the requirement is not satisfied.

Constructor Detail

Resolutionback to summary
private Resolution()