@Retention(value=RUNTIME) public @interface Attribute
Attribute
annotation represents a serializable XML
attribute within an XML element. An object annotated with this is
typically a primitive or enumerated type. Conversion from the
attribute to primitive type is done with a Transform
object. If a suitable transform can be found then this will convert
the attribute string value to an object instance, which can be
assigned to the annotated field, or passed to the annotated method.Transformer
Modifier and Type | Optional Element and Description |
---|---|
String |
empty
This is used to provide a default value for the attribute if
the annotated field or method is null.
|
String |
name
This represents the name of the XML attribute.
|
boolean |
required
Determines whether the attribute is required within an XML
element.
|
public abstract String name
public abstract String empty
public abstract boolean required