KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > bind > annotation > XmlEnum


1 /*
2  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.bind.annotation;
7
8 import static java.lang.annotation.ElementType.TYPE JavaDoc;
9 import java.lang.annotation.Retention JavaDoc;
10 import static java.lang.annotation.RetentionPolicy.RUNTIME JavaDoc;
11 import java.lang.annotation.Target JavaDoc;
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 JavaDoc(RUNTIME) @Target JavaDoc({TYPE})
49 public @interface XmlEnum {
50     /**
51      * Java type that is mapped to a XML simple type.
52      *
53      */

54     Class JavaDoc<?> value() default String JavaDoc.class;
55 }
56
Popular Tags