|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) public @interface Text
The Text
annotation is used to represent a field or
method that appears as text within an XML element. Methods and
fields annotated with this must represent primitive values, which
means that the type is converted to and from an XML representation
using a Transform
object. For example, the primitive
types typically annotated could be strings, integers, or dates.
One restriction on this annotation is that it can only appear once
within a schema class, and it can not appear with the another XML
element annotations, such as the Element
annotation.
It can however appear with any number of Attribute
annotations.
<example one="value" two="value"> Example text value </example>Text values are used when an element containing attributes is used to wrap a text value with no child elements. This can be used in place of an element annotation to represent a primitive which is wrapped in a surrounding XML element.
Transformer
Optional Element Summary | |
---|---|
boolean |
data
This is used to determine whether the text is written within CDATA block or not. |
java.lang.String |
empty
This is used to provide a default value for the text data if the annotated field or method is null. |
boolean |
required
Determines whether the text value is required within the XML document. |
public abstract java.lang.String empty
public abstract boolean data
public abstract boolean required
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |