Top Description Annotations Enums
[default module]

Package aQute.bnd.annotation.headers

Annotations
@Export
@Version:2.0.0

This package contains a number of annotations that create or append headers in the manifest. These annotations simplify maintaining these headers: The annotations provide the following features:

Macros

Any strings in the annotations are run through the bnd preprocessor and can therefore use any of the myriad of bnd macros (except system commands, for obvious reason they are excluded). As a convenience, a number of local macros are set from the context:

Coloring

Annotations can only be applied once, making it impossible to add for example two Provide-Capability headers on the same type. It also would become unreadable quickly. The advised way to use most of these annotation headers is therefore through 'annotation coloring'. These header annotations should be applied to custom annotations that represents the 'thing'. This is clearly represented in the BundleLicense custom annotations like for example the ASL_2_0 annotation. This annotation can be applied to any type and will automatically then create the appropriate clauses.

For example:

public class Webserver {
  @RequireCapability(ns="osgi.extender", name="webserver", version="${@version}")
  @interface Require {}
  @ProvideCapability(ns="osgi.extender", filter="(&(osgi.extender=webserver)${@frange;${@version}}))")
  @interface Provide {}
  ...
}
This resource can now be stored in a library to be used by others. If a component now wants to depend this resource, it can declare its component as follows:
@Webserver.Require
public class MyResource {
  ...
}

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
BundleCategory

The Bundle-Category header holds a comma-separated list of category names.

public @interface
BundleContributors

Maven defines contributors and developers in the POM.

public @interface
BundleCopyright

The Bundle-Copyright header contains the copyright specification for this bundle.

public @interface
BundleDevelopers

Maven defines developers in the POM.

public @interface
BundleDocURL

The Bundle-DocURL headers must contain a URL pointing to documentation about this bundle.

public @interface
BundleLicense

The Bundle-License header provides an optional machine readable form of license information.

public @interface
ProvideCapability

Deprecated see org.osgi.annotation.bundle.Capability
Define a Provide Capability clause in the manifest.
public @interface
RequireCapability

Deprecated see org.osgi.annotation.bundle.Requirement

The Bundle’s Require-Capability header

Typically used as a meta-annotation, i.e. an annotation placed on another annotation, which we will call the user-defined annotation.

Enum Summary

Modifier and TypeEnum and Description
public enum
Category

Standard categories as specified on OSGi References Page

public enum
Resolution

Deprecated see org.osgi.annotation.bundle.Requirement.Resolution
The resolution values for a RequireCapability annotation.