< prev index next >

src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnum.java

Print this page




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.bind.annotation;
  27 
  28 import static java.lang.annotation.ElementType.TYPE;
  29 import java.lang.annotation.Retention;
  30 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  31 import java.lang.annotation.Target;
  32 
  33 /**
  34  * <p>
  35  * Maps an enum type {@link Enum} to XML representation.
  36  *
  37  * <p>This annotation, together with {@link XmlEnumValue} provides a
  38  * mapping of enum type to XML representation.
  39  *
  40  * <p> <b>Usage</b> </p>
  41  * <p>
  42  * The <tt>@XmlEnum</tt> annotation can be used with the
  43  * following program elements:
  44  * <ul>
  45  *   <li>enum type</li>
  46  * </ul>
  47  *
  48  * <p> The usage is subject to the following constraints:
  49  * <ul>
  50  *   <li> This annotation can be used the following other annotations:
  51  *         {@link XmlType},
  52  *         {@link XmlRootElement} </li>
  53  * </ul>
  54  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
  55  * additional common information </p>
  56  *
  57  * <p>An enum type is mapped to a schema simple type with enumeration
  58  * facets. The schema type is derived from the Java type to which
  59  * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
  60  * must have a valid lexical representation for the type
  61  * <tt>@XmlEnum.value()</tt> .
  62  *
  63  * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
  64  *
  65  * @since 1.6, JAXB 2.0
  66  */
  67 
  68 @Retention(RUNTIME) @Target({TYPE})
  69 public @interface XmlEnum {
  70     /**
  71      * Java type that is mapped to a XML simple type.
  72      *
  73      */
  74     Class<?> value() default String.class;
  75 }


  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.bind.annotation;
  27 
  28 import static java.lang.annotation.ElementType.TYPE;
  29 import java.lang.annotation.Retention;
  30 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  31 import java.lang.annotation.Target;
  32 
  33 /**
  34  * <p>
  35  * Maps an enum type {@link Enum} to XML representation.
  36  *
  37  * <p>This annotation, together with {@link XmlEnumValue} provides a
  38  * mapping of enum type to XML representation.
  39  *
  40  * <p> <b>Usage</b> </p>
  41  * <p>
  42  * The {@code @XmlEnum} annotation can be used with the
  43  * following program elements:
  44  * <ul>
  45  *   <li>enum type</li>
  46  * </ul>
  47  *
  48  * <p> The usage is subject to the following constraints:
  49  * <ul>
  50  *   <li> This annotation can be used the following other annotations:
  51  *         {@link XmlType},
  52  *         {@link XmlRootElement} </li>
  53  * </ul>
  54  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
  55  * additional common information </p>
  56  *
  57  * <p>An enum type is mapped to a schema simple type with enumeration
  58  * facets. The schema type is derived from the Java type to which
  59  * {@code @XmlEnum.value()}. Each enum constant {@code @XmlEnumValue}
  60  * must have a valid lexical representation for the type
  61  * {@code @XmlEnum.value()}.
  62  *
  63  * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
  64  *
  65  * @since 1.6, JAXB 2.0
  66  */
  67 
  68 @Retention(RUNTIME) @Target({TYPE})
  69 public @interface XmlEnum {
  70     /**
  71      * Java type that is mapped to a XML simple type.
  72      *
  73      */
  74     Class<?> value() default String.class;
  75 }
< prev index next >