Spring Web Services Framework

org.springframework.oxm
Interface Marshaller

All Known Subinterfaces:
GenericMarshaller, MimeMarshaller
All Known Implementing Classes:
AbstractJaxbMarshaller, AbstractMarshaller, AnnotationXStreamMarshaller, CastorMarshaller, Jaxb1Marshaller, Jaxb2Marshaller, JibxMarshaller, XmlBeansMarshaller, XStreamMarshaller

public interface Marshaller

Defines the contract for Object XML Mapping Marshallers. Implementations of this interface can serialize a given Object to an XML Stream.

Although the marshal method accepts a java.lang.Object as its first parameter, most Marshaller implementations cannot handle arbitrary java.lang.Object. Instead, a object class must be registered with the marshaller, or have a common base class.

Since:
1.0.0
Author:
Arjen Poutsma

Method Summary
 void marshal(Object graph, Result result)
          Marshals the object graph with the given root into the provided Result.
 boolean supports(Class clazz)
          Indicates whether this marshaller can marshal instances of the supplied type.
 

Method Detail

marshal

void marshal(Object graph,
             Result result)
             throws XmlMappingException,
                    IOException
Marshals the object graph with the given root into the provided Result.

Parameters:
graph - the root of the object graph to marshal
result - the result to marshal to
Throws:
XmlMappingException - if the given object cannot be marshalled to the result
IOException - if an I/O exception occurs

supports

boolean supports(Class clazz)
Indicates whether this marshaller can marshal instances of the supplied type.

Parameters:
clazz - the class that this marshaller is being asked if it can marshal
Returns:
true if this marshaller can indeed marshal instances of the supplied class; false otherwise

Spring Web Services Framework

Copyright 2005-2008 The Spring Web Services Framework. All Rights Reserved.