org.simpleframework.xml
Annotation Type Version
@Retention(value=RUNTIME)
public @interface Version
The Version
annotation is used to specify an attribute
that is used to represent a revision of the class XML schema. This
annotation can annotate only floating point types such as double,
float, and the java primitive object types. This can not be used to
annotate strings, enumerations or other primitive types.
- Author:
- Niall Gallagher
Optional Element Summary |
java.lang.String |
name
This represents the name of the XML attribute. |
boolean |
required
Determines whether the version is required within an XML
element. |
double |
revision
This represents the revision of the class. |
name
public abstract java.lang.String name
- This represents the name of the XML attribute. Annotated fields
or methods can optionally provide the name of the XML attribute
they represent. If a name is not provided then the field or
method name is used in its place. A name can be specified if
the field or method name is not suitable for the XML attribute.
- Returns:
- the name of the XML attribute this represents
- Default:
- ""
revision
public abstract double revision
- This represents the revision of the class. A revision is used
by the deserialization process to determine how to match the
annotated fields and methods to the XML elements and attributes.
If the version deserialized is different to the annotated
revision then annotated fields and methods are not required
and if there are excessive XML nodes they are ignored.
- Returns:
- this returns the version of the XML class schema
- Default:
- 1.0
required
public abstract boolean required
- Determines whether the version is required within an XML
element. Any field marked as not required will not have its
value set when the object is deserialized. This is written
only if the version is not the same as the default version.
- Returns:
- true if the version is required, false otherwise
- Default:
- false