The following table shows the JAXB mapping annotations that can be associated with each program element.
| Program Element | JAXB annotation |
|---|---|
| Package | |
| Class | |
| Enum type | |
| JavaBean Property/field | |
| Parameter |
JavaBean property and field: For the purposes of mapping, there is no semantic difference between a field and a JavaBean property. Thus, an annotation that can be applied to a JavaBean property can always be applied to a field. Hence in the Javadoc documentation, for brevity, the term JavaBean property or property is used to mean either JavaBean property or a field. Where required, both are explicitly mentioned.
top level class: For the purpose of mapping, there is no semantic difference between a top level class and a static nested class. Thus, an annotation that can be applied to a top level class, can always be applied to a nested static class. Hence in the Javadoc documentation, for brevity, the term "top level class" or just class is used to mean either a top level class or a nested static class.
mapping annotation:A JAXB 2.0 defined program annotation based on the JSR 175 programming annotation facility.
The following usage constraints are defined here since they apply to more than annotation:
The following namespace prefixes are used in the XML Schema fragments in this package.
| Prefix | Namespace | Notes |
|---|---|---|
| xs | http://www.w3.org/2001/XMLSchema | Namespace of XML Schema namespace |
| ref | http://ws-i.org/profiles/basic/1.1/xsd | Namespace for swaref schema component |
| xsi | http://www.w3.org/2001/XMLSchema-instance | XML Schema namespace for instances |
| Modifier and Type | Interface and Description |
|---|---|
| public interface | DomHandler<ElementT, ResultT extends Result>
Converts an element (and its descendants) from/to DOM (or similar) representation. |
| Modifier and Type | Annotation and Description |
|---|---|
| public @interface | XmlAccessorOrder
Controls the ordering of fields and properties in a class. |
| public @interface | XmlAccessorType
Controls whether fields or Javabean properties are serialized by default. |
| public @interface | XmlAnyAttribute
Maps a JavaBean property to a map of wildcard attributes. |
| public @interface | XmlAnyElement
Maps a JavaBean property to XML infoset representation and/or JAXB element. |
| public @interface | XmlAttachmentRef
Marks a field/property that its XML form is a uri reference to mime content. |
| public @interface | XmlAttribute
Maps a JavaBean property to a XML attribute. |
| public @interface | XmlElement
Maps a JavaBean property to a XML element derived from property name. |
| public @interface | XmlElementDecl
Maps a factory method to a XML element. |
| public @interface | XmlElementRef
Maps a JavaBean property to a XML element derived from property's type. |
| public @interface | XmlElementRefs
Marks a property that refers to classes with |
| public @interface | XmlElements
A container for multiple @ |
| public @interface | XmlElementWrapper
Generates a wrapper element around XML representation. |
| public @interface | |
| public @interface | XmlEnumValue
Maps an enum constant in |
| public @interface | XmlID
Maps a JavaBean property to XML ID. To preserve referential integrity of an object graph across XML serialization followed by a XML deserialization, requires an object reference to be marshalled by reference or containment appropriately. |
| public @interface | XmlIDREF
Maps a JavaBean property to XML IDREF. |
| public @interface | XmlInlineBinaryData
Disable consideration of XOP encoding for datatypes that are bound to base64-encoded binary data in XML. |
| public @interface | XmlList
Used to map a property to a list simple type. |
| public @interface | XmlMimeType
Associates the MIME type that controls the XML representation of the property. |
| public @interface | XmlMixed
Annotate a JavaBean multi-valued property to support mixed content. |
| public @interface | XmlNs
Associates a namespace prefix with a XML namespace URI. |
| public @interface | XmlRegistry
Marks a class that has |
| public @interface | XmlRootElement
Maps a class or an enum type to an XML element. |
| public @interface | XmlSchema
Maps a package name to a XML namespace. |
| public @interface | XmlSchemaType
Maps a Java type to a simple schema built-in type. |
| public @interface | XmlSchemaTypes
A container for multiple @ |
| public @interface | XmlSeeAlso
Instructs JAXB to also bind other classes when binding this class. |
| public @interface | XmlTransient
Prevents the mapping of a JavaBean property/type to XML representation. |
| public @interface | XmlType
Maps a class or an enum type to a XML Schema type. |
| public @interface | XmlValue
Enables mapping a class to a XML Schema complex type with a simpleContent or a XML Schema simple type. |
| Modifier and Type | Class and Description |
|---|---|
| public class | W3CDomHandler
|
| Modifier and Type | Enum and Description |
|---|---|
| public enum | XmlAccessOrder
Used by XmlAccessorOrder to control the ordering of properties and fields in a JAXB bound class. |
| public enum | XmlAccessType
Used by XmlAccessorType to control serialization of fields or properties. |
| public enum | XmlNsForm
Enumeration of XML Schema namespace qualifications. |