public abstract class AbstractMarshaller extends java.lang.Object implements AdaptrisMarshaller
Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractMarshaller.Deserializer |
protected static interface |
AbstractMarshaller.Serializer |
AdaptrisMarshaller.MarshalInputStream, AdaptrisMarshaller.MarshalOutputStream
Constructor and Description |
---|
AbstractMarshaller() |
Modifier and Type | Method and Description |
---|---|
protected static java.lang.Object |
invokeDeserialize(AbstractMarshaller.Deserializer u)
Wrap the unmarshalling sequence by catching exceptions and re-throwing as CoreExceptions.
|
protected static void |
invokeSerialize(AbstractMarshaller.Serializer m)
Wrap the marshalling sequence by catching exceptions and re-throwing as CoreExceptions.
|
void |
marshal(java.lang.Object obj,
java.io.File fileName)
Marshalls an object to XML.
|
void |
marshal(java.lang.Object obj,
java.io.OutputStream outputStream)
Marshalls an object to XML.
|
void |
marshal(java.lang.Object obj,
java.lang.String fileName)
Marshalls an object to XML.
|
void |
marshal(java.lang.Object obj,
java.net.URL fileUrl)
Marshalls an XML representation of the passed
Object to the
file sytem location denoted by the passed URL . |
java.lang.Object |
unmarshal(java.io.File file)
Unmarshalls an
Object based on the passed file . |
java.lang.Object |
unmarshal(java.io.InputStream stream)
Unmarshals an
Object based on the passed
InputStream . |
java.lang.Object |
unmarshal(java.lang.String xml)
Unmarshalls an
Object from the passed XML. |
java.lang.Object |
unmarshal(java.net.URL url)
Unmarshalls an
Object based on the passed file system
URL . |
java.lang.Object |
unmarshal(URLString loc)
Unmarshals an
Object from the passed URLString
location. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
marshal, marshal, uncheckedMarshal, uncheckedUnmarshal, unmarshal
public void marshal(java.lang.Object obj, java.lang.String fileName) throws CoreException
AdaptrisMarshaller
marshal
in interface AdaptrisMarshaller
obj
- the Object
to marshall to XMLfileName
- the name of the file to write toCoreException
- wrapping any underlying Exception
AdaptrisMarshaller.marshal(java.lang.Object, java.lang.String)
public void marshal(java.lang.Object obj, java.io.File fileName) throws CoreException
AdaptrisMarshaller
marshal
in interface AdaptrisMarshaller
obj
- the Object
to marshall to XMLfileName
- the file to write toCoreException
- wrapping any underlying Exception
AdaptrisMarshaller.marshal(java.lang.Object, File)
public void marshal(java.lang.Object obj, java.io.OutputStream outputStream) throws CoreException
AdaptrisMarshaller
marshal
in interface AdaptrisMarshaller
obj
- the object to marshall to XMLoutputStream
- the OutputStream to write toCoreException
- wrapping any underlying Exception
AdaptrisMarshaller.marshal(java.lang.Object, OutputStream)
public void marshal(java.lang.Object obj, java.net.URL fileUrl) throws CoreException
AdaptrisMarshaller
Marshalls an XML representation of the passed Object
to the
file sytem location denoted by the passed URL
.
marshal
in interface AdaptrisMarshaller
obj
- the Object
to marshall to XMLfileUrl
- the file system location to write toCoreException
- wrapping any underlying Exception
AdaptrisMarshaller.marshal(java.lang.Object, java.net.URL)
public java.lang.Object unmarshal(java.lang.String xml) throws CoreException
AdaptrisMarshaller
Unmarshalls an Object
from the passed XML.
unmarshal
in interface AdaptrisMarshaller
xml
- the String
to unmarshalObject
CoreException
- wrapping any underlying Exception
AdaptrisMarshaller.unmarshal(java.lang.String)
public java.lang.Object unmarshal(java.io.File file) throws CoreException
AdaptrisMarshaller
Unmarshalls an Object
based on the passed file
.
unmarshal
in interface AdaptrisMarshaller
file
- a file containing XML to unmarshalObject
CoreException
- wrapping any underlying Exception
AdaptrisMarshaller.unmarshal(java.io.File)
public java.lang.Object unmarshal(java.net.URL url) throws CoreException
AdaptrisMarshaller
Unmarshalls an Object
based on the passed file system
URL
.
unmarshal
in interface AdaptrisMarshaller
url
- the file system location to read fromObject
CoreException
- wrapping any underlying Exception
AdaptrisMarshaller.unmarshal(java.net.URL)
public java.lang.Object unmarshal(URLString loc) throws CoreException
AdaptrisMarshaller
Unmarshals an Object
from the passed URLString
location.
unmarshal
in interface AdaptrisMarshaller
loc
- the location to unmarshal fromObject
CoreException
- wrapping any underlying Exception
spublic java.lang.Object unmarshal(java.io.InputStream stream) throws CoreException
AdaptrisMarshaller
Unmarshals an Object
based on the passed
InputStream
.
unmarshal
in interface AdaptrisMarshaller
stream
- an InputStream
of XML to unmarshalObject
CoreException
- wrapping any underlying Exception
protected static java.lang.Object invokeDeserialize(AbstractMarshaller.Deserializer u) throws CoreException
CoreException
protected static void invokeSerialize(AbstractMarshaller.Serializer m) throws CoreException
CoreException