blob: c07f45535543eee67bf94fd36705f75d70f09a74 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>AttachmentUnmarshaller</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AttachmentUnmarshaller";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../jakarta/xml/bind/attachment/AttachmentMarshaller.html" title="class in jakarta.xml.bind.attachment"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?jakarta/xml/bind/attachment/AttachmentUnmarshaller.html" target="_top">Frames</a></li>
<li><a href="AttachmentUnmarshaller.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">jakarta.xml.bind.attachment</div>
<h2 title="Class AttachmentUnmarshaller" class="title">Class AttachmentUnmarshaller</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>jakarta.xml.bind.attachment.AttachmentUnmarshaller</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">AttachmentUnmarshaller</span>
extends java.lang.Object</pre>
<div class="block"><p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p>
<p>This API enables an efficient cooperative processing of optimized
binary data formats between a JAXB 2.0 implementation and MIME-based package
processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the
understanding of the packaging format being used to a MIME-based
package processor that implements this abstract class.</p>
<p>This abstract class identifies if a package requires XOP processing, <a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#isXOPPackage--"><code>isXOPPackage()</code></a>
and provides retrieval of binary content stored as attachments by content-id.</p>
<h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2>
<ul>
<li>
For XOP processing, the infoset representation of the cid is described
in step 2a in
<a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
</li>
<li>
For WS-I AP 1.0, the cid is identified as an element or attribute of
type <code>ref:swaRef</code> specified in
<a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">
Section 4.4 Referencing Attachments from the SOAP Envelope</a>
</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.6, JAXB 2.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../jakarta/xml/bind/Unmarshaller.html#setAttachmentUnmarshaller-jakarta.xml.bind.attachment.AttachmentUnmarshaller-"><code>Unmarshaller.setAttachmentUnmarshaller(AttachmentUnmarshaller)</code></a>,
<a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>,
<a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>,
<a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#AttachmentUnmarshaller--">AttachmentUnmarshaller</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>abstract byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#getAttachmentAsByteArray-java.lang.String-">getAttachmentAsByteArray</a></span>(java.lang.String&nbsp;cid)</code>
<div class="block">Retrieve the attachment identified by content-id, <code>cid</code>, as a <code>byte[]</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract DataHandler</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#getAttachmentAsDataHandler-java.lang.String-">getAttachmentAsDataHandler</a></span>(java.lang.String&nbsp;cid)</code>
<div class="block">Lookup MIME content by content-id, <code>cid</code>, and return as a <code>DataHandler</code>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#isXOPPackage--">isXOPPackage</a></span>()</code>
<div class="block">Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="AttachmentUnmarshaller--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AttachmentUnmarshaller</h4>
<pre>public&nbsp;AttachmentUnmarshaller()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getAttachmentAsDataHandler-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttachmentAsDataHandler</h4>
<pre>public abstract&nbsp;DataHandler&nbsp;getAttachmentAsDataHandler(java.lang.String&nbsp;cid)</pre>
<div class="block"><p>Lookup MIME content by content-id, <code>cid</code>, and return as a <code>DataHandler</code>.</p>
<p>The returned <code>DataHandler</code> instance must be configured
to meet the following required mapping constaint.
<table class="striped">
<caption>Required Mappings between MIME and Java Types</caption>
<thead>
<tr>
<th scope="col">MIME Type</th>
<th scope="col">Java Type</th>
</tr>
<tr>
<th scope="col"><code>DataHandler.getContentType()</code></th>
<th scope="col"><code>instanceof DataHandler.getContent()</code></th>
</tr>
</thead>
<tbody style="text-align:left">
<tr>
<th scope="row">image/gif</th>
<td>java.awt.Image</td>
</tr>
<tr>
<th scope="row">image/jpeg</th>
<td>java.awt.Image</td>
</tr>
<tr>
<th scope="row">text/xml or application/xml</th>
<td>javax.xml.transform.Source</td>
</tr>
</tbody>
</table>
Note that it is allowable to support additional mappings.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cid</code> - It is expected to be a valid lexical form of the XML Schema
<code>xs:anyURI</code> datatype. If <a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#isXOPPackage--"><code>isXOPPackage()</code></a><code>==true</code>,
it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>DataHandler</code> that represents the MIME attachment.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the attachment for the given cid is not found.</dd>
</dl>
</li>
</ul>
<a name="getAttachmentAsByteArray-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttachmentAsByteArray</h4>
<pre>public abstract&nbsp;byte[]&nbsp;getAttachmentAsByteArray(java.lang.String&nbsp;cid)</pre>
<div class="block"><p>Retrieve the attachment identified by content-id, <code>cid</code>, as a <code>byte[]</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cid</code> - It is expected to be a valid lexical form of the XML Schema
<code>xs:anyURI</code> datatype. If <a href="../../../../jakarta/xml/bind/attachment/AttachmentUnmarshaller.html#isXOPPackage--"><code>isXOPPackage()</code></a><code>==true</code>,
it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>byte[] representation of attachment identified by cid.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the attachment for the given cid is not found.</dd>
</dl>
</li>
</ul>
<a name="isXOPPackage--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isXOPPackage</h4>
<pre>public&nbsp;boolean&nbsp;isXOPPackage()</pre>
<div class="block"><p>Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</p>
<p>This method returns <code>true</code> when the constraints specified
in <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#identifying_xop_documents">Identifying XOP Documents</a> are met.
This value must not change during the unmarshalling process.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true when MIME context is a XOP Document.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../jakarta/xml/bind/attachment/AttachmentMarshaller.html" title="class in jakarta.xml.bind.attachment"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?jakarta/xml/bind/attachment/AttachmentUnmarshaller.html" target="_top">Frames</a></li>
<li><a href="AttachmentUnmarshaller.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>