mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-07-06 09:02:49 +08:00
49 lines
3.2 KiB
HTML
49 lines
3.2 KiB
HTML
<div class="header">
|
||
<div class="subTitle">
|
||
javax.xml.bind.annotation
|
||
</div>
|
||
<h2 class="title" title="Annotation Type XmlAttachmentRef">Annotation Type XmlAttachmentRef</h2>
|
||
</div><div class="contentContainer">
|
||
<div class="description">
|
||
<ul class="blockList">
|
||
<li class="blockList">
|
||
<hr/> <br/> <pre><a href="../../../../java/lang/annotation/Retention.html" title="annotation in java.lang.annotation">@Retention</a>(<a href="../../../../java/lang/annotation/Retention.html#value--">value</a>=<a href="../../../../java/lang/annotation/RetentionPolicy.html#RUNTIME">RUNTIME</a>)
|
||
<a href="../../../../java/lang/annotation/Target.html" title="annotation in java.lang.annotation">@Target</a>(<a href="../../../../java/lang/annotation/Target.html#value--">value</a>={<a href="../../../../java/lang/annotation/ElementType.html#FIELD">字段</a>,<a href="../../../../java/lang/annotation/ElementType.html#METHOD">METHOD</a>,<a href="../../../../java/lang/annotation/ElementType.html#PARAMETER">PARAMETER</a>})
|
||
public @interface <span class="memberNameLabel">XmlAttachmentRef</span></pre>
|
||
<div class="block">
|
||
<span>标记一个字段/属性,它的XML表单是一个uri引用mime内容。</span>
|
||
<span>mime内容被最佳地作为附件存储在行外。</span>
|
||
<span>字段/属性必须始终映射到<a href="../../../../javax/activation/DataHandler.html" title="javax.activation中的类"><code>DataHandler</code></a>类。</span>
|
||
<h2> <span>用法</span> </h2>
|
||
<pre> <span>@<a href="../../../../javax/xml/bind/annotation/XmlRootElement.html" title="annotation in javax.xml.bind.annotation"><code>XmlRootElement</code></a>
|
||
class Foo {
|
||
@<a href="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html" title="annotation in javax.xml.bind.annotation"><code>XmlAttachmentRef</code></a>
|
||
@<a href="../../../../javax/xml/bind/annotation/XmlAttribute.html" title="annotation in javax.xml.bind.annotation"><code>XmlAttribute</code></a>
|
||
<a href="../../../../javax/activation/DataHandler.html" title="class in javax.activation"><code>DataHandler</code></a> data;
|
||
|
||
@<a href="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html" title="annotation in javax.xml.bind.annotation"><code>XmlAttachmentRef</code></a>
|
||
@<a href="../../../../javax/xml/bind/annotation/XmlElement.html" title="annotation in javax.xml.bind.annotation"><code>XmlElement</code></a>
|
||
<a href="../../../../javax/activation/DataHandler.html" title="class in javax.activation"><code>DataHandler</code></a> body;
|
||
}</span> </pre>
|
||
<span>以上代码映射到以下XML:</span>
|
||
<pre> <span><xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
|
||
<xs:complexType>
|
||
<xs:sequence>
|
||
<xs:element name="body" type="ref:swaRef" minOccurs="0" />
|
||
</xs:sequence>
|
||
<xs:attribute name="data" type="ref:swaRef" use="optional" />
|
||
</xs:complexType>
|
||
</xs:element></span> </pre>
|
||
<p> <span>上述绑定支持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></span> </p>
|
||
</div>
|
||
<dl>
|
||
<dt>
|
||
<span class="simpleTagLabel">从以下版本开始:</span>
|
||
</dt>
|
||
<dd>
|
||
JAXB2.0
|
||
</dd>
|
||
</dl> </li>
|
||
</ul>
|
||
</div>
|
||
</div> |