1 /* 2 * Copyright 2005 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 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 9 import java.lang.annotation.Target; 10 import java.lang.annotation.Retention; 11 import java.lang.annotation.Inherited; 12 13 import static java.lang.annotation.ElementType.*; 14 import static java.lang.annotation.RetentionPolicy.*; 15 16 /** 17 * <p> Controls the ordering of fields and properties in a class. </p> 18 * 19 * <h3>Usage </h3> 20 * 21 * <p> <tt> @XmlAccessorOrder </tt> annotation can be used with the following 22 * program elements:</p> 23 * 24 * <ul> 25 * <li> package</li> 26 * <li> a top level class </li> 27 * </ul> 28 * 29 * <p> See "Package Specification" in <tt>javax.xml.bind</tt> package javadoc for 30 * additional common information.</p> 31 * 32 * <p>The effective {@link XmlAccessOrder} on a class is determined 33 * as follows: 34 * 35 * <ul> 36 * <li> If there is a <tt>@XmlAccessorOrder</tt> on a class, then 37 * it is used. </li> 38 * <li> Otherwise, if a <tt>@XmlAccessorOrder </tt> exists on one of 39 * its super classes, then it is inherited (by the virtue of 40 * {@link Inherited}) 41 * <li> Otherwise, the <tt>@XmlAccessorOrder</tt> on the package 42 * of the class is used, if it's there. 43 * <li> Otherwise {@link XmlAccessOrder#UNDEFINED}. 44 * </ul> 45 * 46 * <p>This annotation can be used with the following annotations: 47 * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType}, 48 * {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes}, 49 * , {@link XmlJavaTypeAdapter}. It can also be used with the 50 * following annotations at the package level: {@link XmlJavaTypeAdapter}. 51 * 52 * @author Sekhar Vajjhala, Sun Microsystems, Inc. 53 * @since JAXB2.0 54 * @version $Revision: 1.11 $ 55 * @see XmlAccessOrder 56 */ 57 58 @Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE}) 59 public @interface XmlAccessorOrder { 60 XmlAccessOrder value() default XmlAccessOrder.UNDEFINED; 61 } 62