View Javadoc

1   /*
2    * Copyright 2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.oxm.mime;
18  
19  import java.io.IOException;
20  import javax.xml.transform.Source;
21  
22  import org.springframework.oxm.Unmarshaller;
23  import org.springframework.oxm.XmlMappingException;
24  
25  /**
26   * Subinterface of {@link org.springframework.oxm.Marshaller} that can use MIME attachments to optimize storage of
27   * binary data. Attachments can be added as MTOM, XOP, or SwA.
28   *
29   * @author Arjen Poutsma
30   * @see <a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">SOAP Message Transmission Optimization
31   *      Mechanism</a>
32   * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
33   * @since 1.0.0
34   */
35  public interface MimeUnmarshaller extends Unmarshaller {
36  
37      /**
38       * Unmarshals the given provided {@link Source} into an object graph, reading binary attachments from a {@link
39       * MimeContainer}.
40       *
41       * @param source        the source to marshal from
42       * @param mimeContainer the MIME container to read extracted binary content from
43       * @return the object graph
44       * @throws XmlMappingException if the given source cannot be mapped to an object
45       * @throws IOException         if an I/O Exception occurs
46       */
47      Object unmarshal(Source source, MimeContainer mimeContainer) throws XmlMappingException, IOException;
48  }