KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > bind > annotation > XmlAttachmentRef


1 /*
2  * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6
7 package javax.xml.bind.annotation;
8
9 import javax.activation.DataHandler JavaDoc;
10 import static java.lang.annotation.ElementType JavaDoc.*;
11 import java.lang.annotation.Retention JavaDoc;
12 import static java.lang.annotation.RetentionPolicy.RUNTIME JavaDoc;
13 import java.lang.annotation.Target JavaDoc;
14
15 /**
16  * Marks a field/property that its XML form is a uri reference to mime content.
17  * The mime content is optimally stored out-of-line as an attachment.
18  *
19  * A field/property must always map to the {@link DataHandler} class.
20  *
21  * <h2>Usage</h2>
22  * <pre>
23  * &#64;{@link XmlRootElement}
24  * class Foo {
25  * &#64;{@link XmlAttachmentRef}
26  * &#64;{@link XmlAttribute}
27  * {@link DataHandler} data;
28  *
29  * &#64;{@link XmlAttachmentRef}
30  * &#64;{@link XmlElement}
31  * {@link DataHandler} body;
32  * }
33  * </pre>
34  * The above code maps to the following XML:
35  * <pre><xmp>
36  * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
37  * <xs:complexType>
38  * <xs:sequence>
39  * <xs:element name="body" type="ref:swaRef" minOccurs="0" />
40  * </xs:sequence>
41  * <xs:attribute name="data" type="ref:swaRef" use="optional" />
42  * </xs:complexType>
43  * </xs:element>
44  * </xmp></pre>
45  *
46  * <p>
47  * 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>
48  *
49  * @author Kohsuke Kawaguchi
50  * @since JAXB2.0
51  */

52 @Retention JavaDoc(RUNTIME)
53 @Target JavaDoc({FIELD,METHOD,PARAMETER})
54 public @interface XmlAttachmentRef {
55 }
56
Popular Tags