Class AnnotationHeaders

java.lang.Object
aQute.bnd.osgi.ClassDataCollector
aQute.bnd.osgi.AnnotationHeaders
All Implemented Interfaces:
Closeable, AutoCloseable

class AnnotationHeaders extends ClassDataCollector implements Closeable
This class parses the 'header annotations'. Header annotations are annotations that cause headers in the manifest. There are a number of those headers annotations defined in the aQute.bnd.annotation.headers package, e.g. BundleCopyright. This module applies the semantics of the defined fields in those annotations. It is called at the post parse phase in Analyzer. This ClassDataCollector is called for all classes in our scope. We first look if any header annotations are applied. We also keep track of what other annotations are applied to these classes. After all the classes have been parsed, we look at any of the annotations that was applied to one of the contained classes. These annotations are also parsed then to check if they have header annotations applied to them.

This may sound a bit bizarre, so let me explain. The idea is that you can create a custom annotation for a specific resource.

 @RequireCapability("osgi.webresource;filter:='(&(osgi.
 webresource=/google/angular)(version>=${@version}))") @interface
 Angular {}
 
Now all a user has to do is apply the @Angular annotation. It will then automatically create a Require-Capability, with the version of the package.
  @Angular public class MySpace {...}
 
About provides some more information.