public interface Marshaller
Although the marshal
method accepts a java.lang.Object
as its
first parameter, most Marshaller
implementations cannot handle arbitrary
Object
s. Instead, a object class must be registered with the marshaller,
or have a common base class.
Unmarshaller
Modifier and Type | Method and Description |
---|---|
void |
marshal(java.lang.Object graph,
javax.xml.transform.Result result)
Marshal the object graph with the given root into the provided
Result . |
boolean |
supports(java.lang.Class<?> clazz)
Indicate whether this marshaller can marshal instances of the supplied type.
|
boolean supports(java.lang.Class<?> clazz)
clazz
- the class that this marshaller is being asked if it can marshaltrue
if this marshaller can indeed marshal instances of the supplied class;
false
otherwisevoid marshal(java.lang.Object graph, javax.xml.transform.Result result) throws java.io.IOException, XmlMappingException
Result
.graph
- the root of the object graph to marshalresult
- the result to marshal tojava.io.IOException
- if an I/O error occursXmlMappingException
- if the given object cannot be marshalled to the result