MimeMarshaller.java 1.9 KB
Newer Older
A
Arjen Poutsma 已提交
1
/*
2
 * Copyright 2002-2009 the original author or authors.
A
Arjen Poutsma 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.oxm.mime;

import java.io.IOException;
import javax.xml.transform.Result;

22
import org.springframework.lang.Nullable;
A
Arjen Poutsma 已提交
23 24 25 26
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.XmlMappingException;

/**
27 28
 * Subinterface of {@link Marshaller} that can use MIME attachments to optimize
 * storage of binary data. Attachments can be added as MTOM, XOP, or SwA.
A
Arjen Poutsma 已提交
29 30
 *
 * @author Arjen Poutsma
A
Arjen Poutsma 已提交
31
 * @since 3.0
S
Spring Operator 已提交
32 33
 * @see <a href="https://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">SOAP Message Transmission Optimization Mechanism</a>
 * @see <a href="https://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
A
Arjen Poutsma 已提交
34 35 36
 */
public interface MimeMarshaller extends Marshaller {

A
Arjen Poutsma 已提交
37
	/**
38 39 40 41
	 * Marshals the object graph with the given root into the provided {@link Result},
	 * writing binary data to a {@link MimeContainer}.
	 * @param graph the root of the object graph to marshal
	 * @param result the result to marshal to
A
Arjen Poutsma 已提交
42 43
	 * @param mimeContainer the MIME container to write extracted binary content to
	 * @throws XmlMappingException if the given object cannot be marshalled to the result
44
	 * @throws IOException if an I/O exception occurs
A
Arjen Poutsma 已提交
45
	 */
46
	void marshal(Object graph, Result result, @Nullable MimeContainer mimeContainer) throws XmlMappingException, IOException;
A
Arjen Poutsma 已提交
47 48

}