|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
javax.xml.bind.annotation Annotation Type XmlAccessorType
@Inherited @Retention(value=RUNTIME) @Target(value={PACKAGE,TYPE}) public @interface XmlAccessorType
@Retention(value=RUNTIME)
@Target(value={PACKAGE, TYPE})
控制默认情况下是否对字段或 Javabean 属性进行系列化。
用法
@XmlAccessorType 注释可以与以下程序元素一起使用:
- 包
- 顶层类
有关其他公共信息,请参阅 javax.xml.bind.package javadoc 中的“包规范”。
此注释可控制类中的属性和字段的默认序列化。
包上的 @XmlAccessorType 注释可应用于包中的所有类。继承语义的应用如下:
- 如果类中有 @XmlAccessorType,则使用它。
- 如果 @XmlAccessorType 存在于该类的一个超类中,则继承它。
- 否则,将继承包中的 @XmlAccessorOrder。
默认规则:
默认情况下,如果包中不存在 @XmlAccessorType,那么假定使用以下包级别注释。
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
默认情况下,如果类中不存在 @XmlAccessorType,并且没有任何超类是使用 @XmlAccessorType 注释的,则假定在类中使用以下默认注释:
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
此注释可与以下注释一起使用:XmlType
、XmlRootElement
、XmlSchema
、XmlSchemaType
、XmlSchemaTypes
和 XmlJavaTypeAdapter
。在包级别上它还可以与以下注释一起使用:XmlJavaTypeAdapter
。
since | JAXB2.0 | |
version |
| |
See also | javax.xml.bind.annotation.XmlAccessType |
Controls whether fields or Javabean properties are serialized by default.
Usage
@XmlAccessorType annotation can be used with the following program elements:
- package
- a top level class
See "Package Specification" in javax.xml.bind.package javadoc for additional common information.
This annotation provides control over the default serialization of properties and fields in a class.
The annotation @XmlAccessorType on a package applies to all classes in the package. The following inheritance semantics apply:
- If there is a @XmlAccessorType on a class, then it is used.
- Otherwise, if a @XmlAccessorType exists on one of its super classes, then it is inherited.
- Otherwise, the @XmlAccessorType on a package is inherited.
Defaulting Rules:
By default, if @XmlAccessorType on a package is absent, then the following package level annotation is assumed.
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
By default, if @XmlAccessorType on a class is absent, and none of its super classes is annotated with @XmlAccessorType, then the following default on the class is assumed:
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
This annotation can be used with the following annotations:
XmlType
, XmlRootElement
, XmlAccessorOrder
,
XmlSchema
, XmlSchemaType
, XmlSchemaTypes
,
, XmlJavaTypeAdapter
. It can also be used with the
following annotations at the package level: XmlJavaTypeAdapter
.
- Since:
- JAXB2.0
- Version:
- $Revision: 1.9 $
- Author:
- Sekhar Vajjhala, Sun Microsystems, Inc.
- See Also:
XmlAccessType
Optional Element Summary | |
---|---|
XmlAccessType |
value
Specifies whether fields or properties are serialized. |
abstract public XmlAccessType
value()
指定是否对字段或属性进行系列化。
See also | javax.xml.bind.annotation.XmlAccessType |
value
public abstract XmlAccessType value
- Specifies whether fields or properties are serialized.
- See Also:
XmlAccessType
- Default:
- PUBLIC_MEMBER
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!