01: /*
02: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
03: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
04: */
05:
06: package javax.xml.bind.annotation;
07:
08: import javax.activation.DataHandler;
09: import static java.lang.annotation.ElementType.*;
10: import java.lang.annotation.Retention;
11: import static java.lang.annotation.RetentionPolicy.RUNTIME;
12: import java.lang.annotation.Target;
13:
14: /**
15: * Marks a field/property that its XML form is a uri reference to mime content.
16: * The mime content is optimally stored out-of-line as an attachment.
17: *
18: * A field/property must always map to the {@link DataHandler} class.
19: *
20: * <h2>Usage</h2>
21: * <pre>
22: * @{@link XmlRootElement}
23: * class Foo {
24: * @{@link XmlAttachmentRef}
25: * @{@link XmlAttribute}
26: * {@link DataHandler} data;
27: *
28: * @{@link XmlAttachmentRef}
29: * @{@link XmlElement}
30: * {@link DataHandler} body;
31: * }
32: * </pre>
33: * The above code maps to the following XML:
34: * <pre><xmp>
35: * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
36: * <xs:complexType>
37: * <xs:sequence>
38: * <xs:element name="body" type="ref:swaRef" minOccurs="0" />
39: * </xs:sequence>
40: * <xs:attribute name="data" type="ref:swaRef" use="optional" />
41: * </xs:complexType>
42: * </xs:element>
43: * </xmp></pre>
44: *
45: * <p>
46: * The above binding supports WS-I AP 1.0 <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
47: *
48: * @author Kohsuke Kawaguchi
49: * @since JAXB2.0
50: */
51: @Retention(RUNTIME)
52: @Target({FIELD,METHOD,PARAMETER})
53: public @interface XmlAttachmentRef {
54: }
|