XmlAttachmentRef (Java EE 5)

Java EE API


javax.xml.bind.annotation Annotation Type XmlAttachmentRef


@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER})
public @interface XmlAttachmentRef

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value={FIELD, METHOD, PARAMETER})

标记字段/属性,其 XML 形式是对 MIME 内容的 URI 引用。MIME 内容作为附件被优化存储在行外(out-of-line)。 字段/属性必须始终映射到 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 DataHandler class.

Usage

 @XmlRootElement
 class Foo {
   @XmlAttachmentRef
   @XmlAttribute
   DataHandler data;

   @XmlAttachmentRef
   @XmlElement
   DataHandler body;
 }
 
The above code maps to the following XML:

 <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
   <xs:complextype>
     <xs:sequence>
       </xs:sequence></xs:complextype></xs:element><xs:element name="body" type="ref:swaRef" minoccurs="0">
     
     <xs:attribute name="data" type="ref:swaRef" use="optional">
   
 </xs:attribute></xs:element>
 

The above binding supports WS-I AP 1.0 WS-I Attachments Profile Version 1.0.

Since:
JAXB2.0
Author:
Kohsuke Kawaguchi



Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!