${@package} – The package name
${@class} – The class name to which this macro is
applied to
${@class-short} – The short class name to which this
macro is applied to
${@version} – The package version if set
${@frange;version[;isProvider]} – A macro to create a
filter expression on a version based on the semantic versioning rules.
Default is consumer, specify true for the isProvider to get provider
semantics.
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 {
...
}
| Modifier and Type | Annotation 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 |
| public @interface | ProvideCapability
Deprecated
see Define a Provide Capability clause in the manifest.
org.osgi.annotation.bundle.Capability
|
| 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. |
| Modifier and Type | Enum and Description |
|---|---|
| public enum | Category
Standard categories as specified on OSGi References Page |
| public enum | Resolution
Deprecated
see The resolution values for a RequireCapability annotation.
org.osgi.annotation.bundle.Requirement.Resolution
|