Package jakarta.xml.bind.annotation
Annotation Type XmlEnumValue
-
@Retention(RUNTIME) @Target(FIELD) public @interface XmlEnumValueMaps an enum constant inEnumtype to XML representation.Usage
The
@XmlEnumValueannotation can be used with the following program elements:- enum constant
See "Package Specification" in jakarta.xml.bind.package javadoc for additional common information.
This annotation, together with
XmlEnumprovides a mapping of enum type to XML representation.An enum type is mapped to a schema simple type with enumeration facets. The schema type is derived from the Java type specified in
@XmlEnum.value(). Each enum constant@XmlEnumValuemust have a valid lexical representation for the type@XmlEnum.value()In the absence of this annotation,
Enum.name()is used as the XML representation.Example 1: Map enum constant name -> enumeration facet
{@snippet : //Example: Code fragment- Since:
- 1.6, JAXB 2.0
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Stringvalue
-