325N/A * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * <p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p> 325N/A * <p>This API enables an efficient cooperative processing of optimized 325N/A * binary data formats between a JAXB 2.0 implementation and MIME-based package 325N/A * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the 325N/A * understanding of the packaging format being used to a MIME-based 325N/A * package processor that implements this abstract class.</p> 325N/A * <p>This abstract class identifies if a package requires XOP processing, {@link #isXOPPackage()} and provides retrieval of binary content stored as attachments by content-id.</p> 325N/A * <h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2> 325N/A * For XOP processing, the infoset representation of the cid is described 325N/A * For WS-I AP 1.0, the cid is identified as an element or attribute of 325N/A * type <code>ref:swaRef </code> specified in 325N/A * @author Kohsuke Kawaguchi 325N/A * @author Joseph Fialli 325N/A * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller) 325N/A * <p>Lookup MIME content by content-id, <code>cid</code>, and return as a {@link DataHandler}.</p> 325N/A * <p>The returned <code>DataHandler</code> instance must be configured 325N/A * to meet the following required mapping constaint. 325N/A * <table border="2" rules="all" cellpadding="4"> 325N/A * <th align="center" colspan="2"> 325N/A * Required Mappings between MIME and Java Types 325N/A * <th><code>DataHandler.getContentType()</code></th> 325N/A * <th><code>instanceof DataHandler.getContent()</code></th> 325N/A * <td>java.awt.Image</td> 325N/A * <td>java.awt.Image</td> 325N/A * Note that it is allowable to support additional mappings.</p> 325N/A * @param cid It is expected to be a valid lexical form of the XML Schema 325N/A * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()} 325N/A * a {@link DataHandler} that represents the MIME attachment. 325N/A * @throws IllegalArgumentException if the attachment for the given cid is not found. 325N/A * <p>Retrieve the attachment identified by content-id, <code>cid</code>, as a <tt>byte[]</tt></p>. 325N/A * @param cid It is expected to be a valid lexical form of the XML Schema 325N/A * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()} 325N/A * @return byte[] representation of attachment identified by cid. 325N/A * @throws IllegalArgumentException if the attachment for the given cid is not found. 325N/A * <p>Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</p> 325N/A * <p>This method returns <code>true</code> when the constraints specified 325N/A * This value must not change during the unmarshalling process.</p> 325N/A * @return true when MIME context is a XOP Document.