Annotation Type XmlElement
-
@Retention(RUNTIME) @Target({METHOD,TYPE}) public @interface XmlElement
Specifies the name of the XML element.Used on method
When used on methods declared on interfaces that derive from
TypedXmlWriter
, it specifies that the invocation of the method will produce an element of the specified name.The method signature has to match one of the following patterns.
- Child writer:
TW foo()
- TW must be an interface derived from
TypedXmlWriter
. When this method is called, a new child element is started, and its content can be written by using the returnedTW
object. This child element will be ended when its _commit method is called. - Leaf element:
void foo(DT1,DT2,...)
- DTi must be datatype objects. When this method is called, a new child element is started, followed by the whitespace-separated text data from each of the datatype objects, followed by the end tag.
Used on interface
When used on interfaces that derive from
TypedXmlWriter
, it associates an element name with that interface. This name is used in a few places, such as inTXW.create(Class,XmlSerializer)
andTypedXmlWriter._element(Class)
.- Author:
- Kohsuke Kawaguchi
- Child writer:
-
-
Element Detail
-
value
String value
The local name of the element.- Default:
- ""
-
-
-
ns
String ns
The namespace URI of this element.If the annotation is on an interface and this paramter is left unspecified, then the namespace URI is taken from
XmlNamespace
annotation on the package that the interface is in. IfXmlNamespace
annotation doesn't exist, the namespace URI will be "".If the annotation is on a method and this parameter is left unspecified, then the namespace URI is the same as the namespace URI of the writer interface.
- Default:
- "##default"
-
-