JAXB Annotations
JAXB Annotations
TABLE 174
JAXB Annotations Associated with a Java Class
Annotation
Description and Default Setting
@XmlType
Maps a Java class to a schema type. Default Settings:
@XmlType (
name =
"##default",
propOrder = {
""},
namespace =
"##default",
factoryClass = DEFAULT.class,
factoryMethod =
""
)
@XmlRootElement
Associates a global element with the schema type to which the class is mapped. Default
Settings:
@XmlRootElement (
name =
"##default",
namespace =
"##default"
)
summarizes JAXB annotations that can be used with a Java enum type.
TABLE 175
JAXB Annotations Associated with a Java enum Type
Annotation
Description and Default Setting
@XmlEnum
Maps a Java type to an XML simple type. Default Settings:
@XmlEnum ( value = String.class )
@XmlEnumValue
Maps a Java type to an XML simple type. Default Settings:
None
@XmlType
Maps a Java class to a schema type. Default Settings:
@XmlType (
name =
"##default",
propOrder = {
""},
namespace =
"##default",
factoryClass = DEFAULT.class,
factoryMethod =
""
)
Customizing Generated Classes and Java Program Elements
Chapter 17 · Binding between XML Schema and Java Classes
497