01: /*
02: * Copyright 2005 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 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
09: 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 whether fields or Javabean properties are serialized by default. </p>
18: *
19: * <p> <b> Usage </b> </p>
20: *
21: * <p> <tt>@XmlAccessorType</tt> annotation can be used with the following program elements:</p>
22: *
23: * <ul>
24: * <li> package</li>
25: * <li> a top level class </li>
26: * </ul>
27: *
28: * <p> See "Package Specification" in javax.xml.bind.package javadoc for
29: * additional common information.</p>
30: *
31: * <p>This annotation provides control over the default serialization
32: * of properties and fields in a class.
33: *
34: * <p>The annotation <tt> @XmlAccessorType </tt> on a package applies to
35: * all classes in the package. The following inheritance
36: * semantics apply:
37: *
38: * <ul>
39: * <li> If there is a <tt>@XmlAccessorType</tt> on a class, then it
40: * is used. </li>
41: * <li> Otherwise, if a <tt>@XmlAccessorType</tt> exists on one of
42: * its super classes, then it is inherited.
43: * <li> Otherwise, the <tt>@XmlAccessorType </tt> on a package is
44: * inherited.
45: * </ul>
46: * <p> <b> Defaulting Rules: </b> </p>
47: *
48: * <p>By default, if <tt>@XmlAccessorType </tt> on a package is absent,
49: * then the following package level annotation is assumed.</p>
50: * <pre>
51: * @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
52: * </pre>
53: * <p> By default, if <tt>@XmlAccessorType</tt> on a class is absent,
54: * and none of its super classes is annotated with
55: * <tt>@XmlAccessorType</tt>, then the following default on the class
56: * is assumed: </p>
57: * <pre>
58: * @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
59: * </pre>
60: * <p>This annotation can be used with the following annotations:
61: * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder},
62: * {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
63: * , {@link XmlJavaTypeAdapter}. It can also be used with the
64: * following annotations at the package level: {@link XmlJavaTypeAdapter}.
65: *
66: * @author Sekhar Vajjhala, Sun Microsystems, Inc.
67: * @since JAXB2.0
68: * @see XmlAccessType
69: * @version $Revision: 1.9 $
70: */
71:
72: @Inherited
73: @Retention(RUNTIME)
74: @Target({PACKAGE,TYPE})
75: public @interface XmlAccessorType {
76:
77: /**
78: * Specifies whether fields or properties are serialized.
79: *
80: * @see XmlAccessType
81: */
82: XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
83: }
|