|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
javax.xml.bind.annotation Annotation Type XmlAnyAttribute
@Target(value={FIELD, METHOD})
将 JavaBean 属性映射到通配符属性的映射表中。
用法
@XmlAnyAttribute 注释可以与以下程序元素一起使用:
- JavaBean 属性
- 非 static、非 transient 字段
有关其他公共信息,请参阅 javax.xml.bind.package javadoc 中的“包规范”。
用法受到以下约束的限制:- 最多只能使用 @XmlAnyAttribute 注释类中的一个字段或属性。
- 属性或字段的类型必须是 java.util.Map。
在处理将解组成为一个值类的属性时,与另一个 JavaBean 属性不存在静态关联的(通过 XmlAttribute
)每个属性都被输入 Map
<QName
,Object
> 表示的通配符属性映射表中。属性 QName 是映射表的键。键值是属性的字符串值。
since | JAXB2.0 |
Maps a JavaBean property to a map of wildcard attributes.
Usage
The @XmlAnyAttribute annotation can be used with the following program elements:
- JavaBean property
- non static, non transient field
See "Package Specification" in javax.xml.bind.package javadoc for additional common information.
The usage is subject to the following constraints:- At most one field or property in a class can be annotated with @XmlAnyAttribute.
- The type of the property or the field must java.util.Map
While processing attributes to be unmarshalled into a value class,
each attribute that is not statically associated with another
JavaBean property, via XmlAttribute
, is entered into the
wildcard attribute map represented by
Map
<QName
,Object
>. The attribute QName is the
map's key. The key's value is the String value of the attribute.
- Since:
- JAXB2.0
- Author:
- Kohsuke Kawaguchi, Sun Microsystems, Inc.
|
|||||||||
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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!