30 import static java.lang.annotation.RetentionPolicy.RUNTIME;
31 import static java.lang.annotation.ElementType.FIELD;
32 import static java.lang.annotation.ElementType.METHOD;
33 import static java.lang.annotation.ElementType.PARAMETER;
34
35 import javax.xml.transform.Source;
36
37 /**
38 * Associates the MIME type that controls the XML representation of the property.
39 *
40 * <p>
41 * This annotation is used in conjunction with datatypes such as
42 * {@link java.awt.Image} or {@link Source} that are bound to base64-encoded binary in XML.
43 *
44 * <p>
45 * If a property that has this annotation has a sibling property bound to
46 * the xmime:contentType attribute, and if in the instance the property has a value,
47 * the value of the attribute takes precedence and that will control the marshalling.
48 *
49 * @author Kohsuke Kawaguchi
50 * @since JAXB2.0
51 */
52 @Retention(RUNTIME)
53 @Target({FIELD,METHOD,PARAMETER})
54 public @interface XmlMimeType {
55 /**
56 * The textual representation of the MIME type,
57 * such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.
58 */
59 String value();
60 }
|
30 import static java.lang.annotation.RetentionPolicy.RUNTIME;
31 import static java.lang.annotation.ElementType.FIELD;
32 import static java.lang.annotation.ElementType.METHOD;
33 import static java.lang.annotation.ElementType.PARAMETER;
34
35 import javax.xml.transform.Source;
36
37 /**
38 * Associates the MIME type that controls the XML representation of the property.
39 *
40 * <p>
41 * This annotation is used in conjunction with datatypes such as
42 * {@link java.awt.Image} or {@link Source} that are bound to base64-encoded binary in XML.
43 *
44 * <p>
45 * If a property that has this annotation has a sibling property bound to
46 * the xmime:contentType attribute, and if in the instance the property has a value,
47 * the value of the attribute takes precedence and that will control the marshalling.
48 *
49 * @author Kohsuke Kawaguchi
50 * @since 1.6, JAXB 2.0
51 */
52 @Retention(RUNTIME)
53 @Target({FIELD,METHOD,PARAMETER})
54 public @interface XmlMimeType {
55 /**
56 * The textual representation of the MIME type,
57 * such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.
58 */
59 String value();
60 }
|