jakarta.xml.bind.annotation.XmlAttachmentRef Maven / Gradle / Ivy
/*
* Copyright (c) 2005, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package jakarta.xml.bind.annotation;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import jakarta.activation.DataHandler;
/**
* Marks a field/property that its XML form is a URI reference to mime content.
* The mime content is optimally stored out-of-line as an attachment.
*
* A field/property must always map to the {@link DataHandler} class.
*
*
Usage
* {@snippet :
* @XmlRootElement
* class Foo {
* @XmlAttachmentRef
* @XmlAttribute
* DataHandler data;
*
* @XmlAttachmentRef
* @XmlElement
* DataHandler body;
* }
* }
* The above code maps to the following XML:
* {@snippet lang="XML" :
*
*
*
*
*
*
*
*
* }
*
*
* The above binding supports WS-I AP 1.0 WS-I Attachments Profile Version 1.0.
*
* @author Kohsuke Kawaguchi
* @since 1.6, JAXB 2.0
*/
@Retention(RUNTIME)
@Target({FIELD,METHOD,PARAMETER})
public @interface XmlAttachmentRef {
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy