JavaTM 2 Platform
Standard Ed. 6

javax.xml.bind.annotation
枚举 XmlAccessType

java.lang.Object
  继承者 java.lang.Enum<XmlAccessType>
      继承者 javax.xml.bind.annotation.XmlAccessType
所有已实现的接口:
Serializable, Comparable<XmlAccessType>

public enum XmlAccessType
extends Enum<XmlAccessType>

由 XmlAccessorType 使用,用于控制字段或属性的序列化。

从以下版本开始:
JAXB2.0
另请参见:
XmlAccessorType

枚举常量摘要
FIELD
          JAXB 绑定类中的每个非静态、非瞬态字段将会自动绑定到 XML,除非由 XmlTransient 注释。
NONE
          所有字段或属性都不能绑定到 XML,除非使用一些 JAXB 注释专门对它们进行注释。
PROPERTY
          JAXB 绑定类中的每个获取方法/设置方法对将会自动绑定到 XML,除非由 XmlTransient 注释。
PUBLIC_MEMBER
          每个公共获取方法/设置方法对和每个公共字段将会自动绑定到 XML,除非由 XmlTransient 注释。
 
方法摘要
static XmlAccessType valueOf(String name)
          返回带有指定名称的该类型的枚举常量。
static XmlAccessType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
从类 java.lang.Enum 继承的方法
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

枚举常量详细信息

PROPERTY

public static final XmlAccessType PROPERTY
JAXB 绑定类中的每个获取方法/设置方法对将会自动绑定到 XML,除非由 XmlTransient 注释。 只在用一些 JAXB 注释来显式注释字段时,这些字段才绑定到 XML。


FIELD

public static final XmlAccessType FIELD
JAXB 绑定类中的每个非静态、非瞬态字段将会自动绑定到 XML,除非由 XmlTransient 注释。 只在用一些 JAXB 注释来显式注释字段时,getter/setter 对才绑定到 XML。


PUBLIC_MEMBER

public static final XmlAccessType PUBLIC_MEMBER
每个公共获取方法/设置方法对和每个公共字段将会自动绑定到 XML,除非由 XmlTransient 注释。 只在用适当的 JAXB 注释来显式注释那些仅对打包访问而言专用、受保护或默认的字段或获取方法/设置方法对时,才将它们绑定到 XML。


NONE

public static final XmlAccessType NONE
所有字段或属性都不能绑定到 XML,除非使用一些 JAXB 注释专门对它们进行注释。

方法详细信息

values

public static final XmlAccessType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for(XmlAccessType c : XmlAccessType.values())
        System.out.println(c);

返回:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static XmlAccessType valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格。)

参数:
指定要返回的枚举常量的名称。 -
返回:
返回带有指定名称的枚举常量
抛出:
如果该枚举类型没有带有指定名称的常量, - 则抛出 IllegalArgumentException

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only