@Retention(value=RUNTIME) @Target(value={字段,METHOD,PARAMETER}) public @interface XmlAttachmentRef
DataHandler
类。
@XmlRootElement
class Foo {
@XmlAttachmentRef
@XmlAttribute
DataHandler
data;
@XmlAttachmentRef
@XmlElement
DataHandler
body;
}
以上代码映射到以下XML:
<xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
<xs:complexType>
<xs:sequence>
<xs:element name="body" type="ref:swaRef" minOccurs="0" />
</xs:sequence>
<xs:attribute name="data" type="ref:swaRef" use="optional" />
</xs:complexType>
</xs:element>
上述绑定支持WS-I AP 1.0 WS-I Attachments Profile Version 1.0.