< prev index next >

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

Print this page




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  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 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  29 import java.lang.annotation.Target;
  30 import java.lang.annotation.Retention;
  31 import java.lang.annotation.Inherited;
  32 
  33 import static java.lang.annotation.ElementType.*;
  34 import static java.lang.annotation.RetentionPolicy.*;
  35 
  36 /**
  37  * <p> Controls the ordering of fields and properties in a class. </p>
  38  *
  39  * <h3>Usage </h3>
  40  *
  41  * <p> <tt> @XmlAccessorOrder </tt> annotation can be used with the following
  42  * program elements:</p>
  43  *
  44  * <ul>
  45  *   <li> package</li>
  46  *   <li> a top level class </li>
  47  * </ul>
  48  *
  49  * <p> See "Package Specification" in <tt>javax.xml.bind</tt> package javadoc for
  50  * additional common information.</p>
  51  *
  52  * <p>The effective {@link XmlAccessOrder} on a class is determined
  53  * as follows:
  54  *
  55  * <ul>
  56  *   <li> If there is a <tt>@XmlAccessorOrder</tt> on a class, then
  57  *        it is used. </li>
  58  *   <li> Otherwise, if a <tt>@XmlAccessorOrder </tt> exists on one of
  59  *        its super classes, then it is inherited (by the virtue of
  60  *        {@link Inherited})
  61  *   <li> Otherwise, the <tt>@XmlAccessorOrder</tt> on the package
  62  *        of the class is used, if it's there.
  63  *   <li> Otherwise {@link XmlAccessOrder#UNDEFINED}.
  64  * </ul>
  65  *
  66  * <p>This annotation can be used with the following annotations:
  67  *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType},
  68  *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
  69  *    , {@link XmlJavaTypeAdapter}. It can also be used with the
  70  *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
  71  *
  72  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  73  * @since 1.6, JAXB 2.0
  74  * @see XmlAccessOrder
  75  */
  76 
  77 @Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
  78 public @interface XmlAccessorOrder {
  79         XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
  80 }


  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  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 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  29 import java.lang.annotation.Target;
  30 import java.lang.annotation.Retention;
  31 import java.lang.annotation.Inherited;
  32 
  33 import static java.lang.annotation.ElementType.*;
  34 import static java.lang.annotation.RetentionPolicy.*;
  35 
  36 /**
  37  * <p> Controls the ordering of fields and properties in a class. </p>
  38  *
  39  * <h3>Usage </h3>
  40  *
  41  * <p> {@code @XmlAccessorOrder} annotation can be used with the following
  42  * program elements:</p>
  43  *
  44  * <ul>
  45  *   <li> package</li>
  46  *   <li> a top level class </li>
  47  * </ul>
  48  *
  49  * <p> See "Package Specification" in {@code javax.xml.bind} package javadoc for
  50  * additional common information.</p>
  51  *
  52  * <p>The effective {@link XmlAccessOrder} on a class is determined
  53  * as follows:
  54  *
  55  * <ul>
  56  *   <li> If there is a {@code @XmlAccessorOrder} on a class, then
  57  *        it is used. </li>
  58  *   <li> Otherwise, if a {@code @XmlAccessorOrder} exists on one of
  59  *        its super classes, then it is inherited (by the virtue of
  60  *        {@link Inherited})
  61  *   <li> Otherwise, the {@code @XmlAccessorOrder} on the package
  62  *        of the class is used, if it's there.
  63  *   <li> Otherwise {@link XmlAccessOrder#UNDEFINED}.
  64  * </ul>
  65  *
  66  * <p>This annotation can be used with the following annotations:
  67  *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType},
  68  *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
  69  *    , {@link XmlJavaTypeAdapter}. It can also be used with the
  70  *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
  71  *
  72  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  73  * @since 1.6, JAXB 2.0
  74  * @see XmlAccessOrder
  75  */
  76 
  77 @Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
  78 public @interface XmlAccessorOrder {
  79         XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
  80 }
< prev index next >