Annotation Type XmlRootElement
-
@Retention(RUNTIME) @Target(TYPE) public @interface XmlRootElementMaps a class or an enum type to an XML element.Usage
The XmlRootElement annotation can be used with the following program elements:
- a top level class
- an enum type
See "Package Specification" in jakarta.xml.bind.package javadoc for additional common information.
When a top level class or an enum type is annotated with the XmlRootElement annotation, then its value is represented as XML element in an XML document.
This annotation can be used with the following annotations:
XmlType,XmlEnum,XmlAccessorType,XmlAccessorOrder.Example 1: Associate an element with XML Schema type {@snippet : // Example: Code fragment
- Since:
- 1.6, JAXB 2.0
- Author:
- Sekhar Vajjhala, Sun Microsystems, Inc.
-
-
Element Detail
-
namespace
java.lang.String namespace
namespace name of the XML element.If the value is "##default", then the XML namespace name is derived from the package of the class (
XmlSchema). If the package is unnamed, then the XML namespace is the default empty namespace.- Default:
- "##default"
-
-