01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
03: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
04: */
05:
06: package javax.xml.bind.annotation;
07:
08: import static java.lang.annotation.ElementType.TYPE;
09: import java.lang.annotation.Retention;
10: import static java.lang.annotation.RetentionPolicy.RUNTIME;
11: import java.lang.annotation.Target;
12:
13: /**
14: * <p>
15: * Maps an enum type {@link Enum} to XML representation.
16: *
17: * <p>This annotation, together with {@link XmlEnumValue} provides a
18: * mapping of enum type to XML representation.
19: *
20: * <p> <b>Usage</b> </p>
21: * <p>
22: * The <tt>@XmlEnum</tt> annotation can be used with the
23: * following program elements:
24: * <ul>
25: * <li>enum type</li>
26: * </ul>
27: *
28: * <p> The usage is subject to the following constraints:
29: * <ul>
30: * <li> This annotation can be used the following other annotations:
31: * {@link XmlType},
32: * {@link XmlRootElement} </li>
33: * </ul>
34: * <p>See "Package Specification" in javax.xml.bind.package javadoc for
35: * additional common information </p>
36: *
37: * <p>An enum type is mapped to a schema simple type with enumeration
38: * facets. The schema type is derived from the Java type to which
39: * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
40: * must have a valid lexical representation for the type
41: * <tt>@XmlEnum.value()</tt> .
42: *
43: * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
44: *
45: * @since JAXB2.0
46: */
47:
48: @Retention(RUNTIME)
49: @Target({TYPE})
50: public @interface XmlEnum {
51: /**
52: * Java type that is mapped to a XML simple type.
53: *
54: */
55: Class<?> value() default String.class;
56: }
|