@Inherited @Retention(value=RUNTIME) @Target(value={PACKAGE,TYPE}) public @interface XmlAccessorType
控制字段或Javabean属性是否默认序列化。
用法
@XmlAccessorType注释可以与以下程序元素一起使用:
有关其他常见信息,请参阅javax.xml.bind.package javadoc中的“Package Specification”。
此注释提供了对类中属性和字段的默认序列化的控制。
程序包上的注释@XmlAccessorType适用于程序包中的所有类。 以下继承语义适用:
默认规则:
默认情况下,如果@XmlAccessorType上的包不存在,则假定以下包级别的注释。
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
默认情况下,如果一个类不存在@XmlAccessorType ,并且没有一个超级类用@XmlAccessorType进行注释 ,则假定该类的以下默认值为:
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
此注释可与以下注释一起使用: XmlType
, XmlRootElement
, XmlAccessorOrder
, XmlSchema
, XmlSchemaType
, XmlSchemaTypes
, XmlJavaTypeAdapter
。 它也可以在包级别与以下注释一起使用: XmlJavaTypeAdapter
。
XmlAccessType
Modifier and Type | Optional Element and Description |
---|---|
XmlAccessType |
value
指定字段或属性是否序列化。
|
public abstract XmlAccessType value
XmlAccessType
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.