background image

JAXB Annotations

<< Java-to-Schema | Java Properties and Fields >>
<< Java-to-Schema | Java Properties and Fields >>

JAXB Annotations

TABLE 17­4
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"
)
Table 17­5
summarizes JAXB annotations that can be used with a Java enum type.
TABLE 17­5
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