@Retention(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 | Description |
---|---|---|
java.lang.String |
empty |
This is used to provide a default value for the attribute if
the annotated field or method is null.
|
java.lang.String |
name |
This represents the name of the XML attribute.
|
boolean |
required |
Determines whether the attribute is required within an XML
element.
|
java.lang.String name
java.lang.String empty
boolean required