Top Description Methods
aQute.bnd.annotation.xml

public @Interface XMLAttribute

extends Annotation
Annotations
@Retention:CLASS
@Target:ANNOTATION_TYPE
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Define an xml attribute extension annotation. In cooperation with an XMLAttribute-aware annotation processor, such as the bnd plugins for DS and (spec) metatype annotations, the values specified for the members of the annotation will be added to the appropriate xml element in the document being generated, using the namespace specified and attempting to use the prefix specified. This will only occur if the generated document namespace matches one of the embedIn strings. Supporting classes for this are in the aQute.bnd.xmlattribute package.

For example:

@XMLAttribute(namespace = "org.foo.extensions.v1", prefix =
"foo", embedIn = "*")
@Retention(RetentionPolicy.CLASS) @Target(ElementType.TYPE)
@interface OCDTestExtensions { boolean booleanAttr() default true; //
default provided, thus optional String stringAttr(); // no default, must be
specified Foo fooAttr(); } @ObjectClassDefinition
@OCDTestExtensions(stringAttr = "ocd", fooAttr = Foo.A) public
static interface TestExtensions {}
results in
 
 ...

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

array of applicable xml namespaces
embedIn
()

Array of document namespaces this annotation should embed attributes in.

public String[]

Returns:

Array of member-name to xml-attribute-name mappings.
mapping
()

Array of Strings of the form key=value where the key is the name of a member and the value is the xml attribute name to use for that member's value.

public String

Returns:

xml namespace for the emitted attritrbutes
namespace
()

xml namespace for the emitted attritrbutes

public String

Returns:

suggested prefix for the specified namespace.
prefix
()

Suggested prefix for the specified namespace.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

embedInback to summary
public String[] embedIn()

Array of document namespaces this annotation should embed attributes in.

Returns:String[]

array of applicable xml namespaces

mappingback to summary
public String[] mapping()

Array of Strings of the form key=value where the key is the name of a member and the value is the xml attribute name to use for that member's value. For instance, "value=simple" causes @Simple("foo") to emit ns:simple="foo".

Returns:String[]

Array of member-name to xml-attribute-name mappings.

Since
1.1
namespaceback to summary
public String namespace()

xml namespace for the emitted attritrbutes

Returns:String

xml namespace for the emitted attritrbutes

prefixback to summary
public String prefix()

Suggested prefix for the specified namespace. This will be modified as necessary to avoid conflicts.

Returns:String

suggested prefix for the specified namespace.