@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) public @interface XmlID
图一个JavaBean属性的XML ID。
保存在XML序列化一个对象图参照完整性由XML反序列化,要求对象引用是通过引用或包含适当的整理。注释@XmlID和@XmlIDREF允许自定义映射通过遏制或参考JavaBean属性的类型。
使用
的 @XmlID注释可以用下面的程序元素:看到“包装规范”的额外的信息共享javax.xml.bind.package javadoc。
的使用是受以下限制:例子:Map一个JavaBean属性的类型xs:ID
/ /例如:代码片段公共类客户@ XmlAttribute@ XmlIDgetcustomerid()字符串;公共无效setcustomerid(字符串ID);的…未显示的其他属性}<!——例如:XML模式片段- >< xs:complexType名称=“客户”>< xs:复杂的内容>< xs:序列>的…< / xs:序列>< xs:属性名=“CustomerID”type=“XS:ID”/>< / xs:复杂的内容>< / xs:名称>
XmlIDREF
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.