Top Description Inners Methods
javax.xml.bind.annotation.adapters

public @Interface XmlJavaTypeAdapter

extends Annotation
Annotations
@Retention:RUNTIME
@Target:PACKAGE, FIELD, METHOD, TYPE, PARAMETER
Imports
javax.xml.bind.annotation.XmlAnyElement, .XmlElementRefs, .XmlElement, .XmlSchemaType, .XmlElementRef, .XmlAttribute, .XmlSchema, .XmlAccessorType, .XmlSchemaTypes, java.lang.annotation.Target, .Retention

Use an adapter that implements XmlAdapter for custom marshaling.

Usage:

The @XmlJavaTypeAdapter annotation can be used with the following program elements:

When @XmlJavaTypeAdapter annotation is defined on a class, it applies to all references to the class.

When @XmlJavaTypeAdapter annotation is defined at the package level it applies to all references from within the package to @XmlJavaTypeAdapter.type().

When @XmlJavaTypeAdapter annotation is defined on the field, property or parameter, then the annotation applies to the field, property or the parameter only.

A @XmlJavaTypeAdapter annotation on a field, property or parameter overrides the @XmlJavaTypeAdapter annotation associated with the class being referenced by the field, property or parameter.

A @XmlJavaTypeAdapter annotation on a class overrides the @XmlJavaTypeAdapter annotation specified at the package level for that class.

This annotation can be used with the following other annotations: XmlElement, XmlAttribute, XmlElementRef, XmlElementRefs, XmlAnyElement. This can also be used at the package level with the following annotations: XmlAccessorType, XmlSchema, XmlSchemaType, XmlSchemaTypes.

Example: See example in XmlAdapter

Author
Since
1.6, JAXB 2.0
See Also
XmlAdapter

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
XmlJavaTypeAdapter.DEFAULT

Used in XmlJavaTypeAdapter#type() to signal that the type be inferred from the signature of the field, property, parameter or the class.

Method Summary

Modifier and TypeMethod and Description
public Class<T>
type()

If this annotation is used at the package level, then value of the type() must be specified.

public Class<? extends XmlAdapter<ValueType, BoundType>>
value()

Points to the class that converts a value type to a bound type or vice versa.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

typeback to summary
public Class<T> type()

If this annotation is used at the package level, then value of the type() must be specified.

valueback to summary
public Class<? extends XmlAdapter<ValueType, BoundType>> value()

Points to the class that converts a value type to a bound type or vice versa. See XmlAdapter for more details.

javax.xml.bind.annotation.adapters back to summary

public final Class XmlJavaTypeAdapter.DEFAULT

extends Object
Class Inheritance
  • java.lang.Object
  • javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT

Used in XmlJavaTypeAdapter#type() to signal that the type be inferred from the signature of the field, property, parameter or the class.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DEFAULTback to summary
public DEFAULT()