Package com.adaptris.core
Class AbstractMarshaller
java.lang.Object
com.adaptris.core.AbstractMarshaller
- All Implemented Interfaces:
AdaptrisMarshaller
- Direct Known Subclasses:
StatisticMarshaller
,XStreamMarshallerImpl
Abstract implementation of AdaptrisMarshaller.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
protected static interface
Nested classes/interfaces inherited from interface com.adaptris.core.AdaptrisMarshaller
AdaptrisMarshaller.MarshalInputStream, AdaptrisMarshaller.MarshalOutputStream
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Object
Wrap the unmarshalling sequence by catching exceptions and re-throwing as CoreExceptions.protected static void
Wrap the marshalling sequence by catching exceptions and re-throwing as CoreExceptions.void
Marshalls an object to XML.void
marshal
(Object obj, OutputStream outputStream) Marshalls an object to XML.void
Marshalls an object to XML.void
Marshalls an XML representation of the passedObject
to the file sytem location denoted by the passedURL
.Unmarshals anObject
from the passedURLString
location.Unmarshalls anObject
based on the passedfile
.unmarshal
(InputStream stream) Unmarshals anObject
based on the passedInputStream
.Unmarshalls anObject
from the passed XML.Unmarshalls anObject
based on the passed file systemURL
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.AdaptrisMarshaller
marshal, marshal, unmarshal
-
Constructor Details
-
AbstractMarshaller
public AbstractMarshaller()
-
-
Method Details
-
marshal
Description copied from interface:AdaptrisMarshaller
Marshalls an object to XML.- Specified by:
marshal
in interfaceAdaptrisMarshaller
- Parameters:
obj
- theObject
to marshall to XMLfileName
- the name of the file to write to- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
marshal
Description copied from interface:AdaptrisMarshaller
Marshalls an object to XML.- Specified by:
marshal
in interfaceAdaptrisMarshaller
- Parameters:
obj
- theObject
to marshall to XMLfileName
- the file to write to- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
marshal
Description copied from interface:AdaptrisMarshaller
Marshalls an object to XML.- Specified by:
marshal
in interfaceAdaptrisMarshaller
- Parameters:
obj
- the object to marshall to XMLoutputStream
- the OutputStream to write to- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
marshal
Description copied from interface:AdaptrisMarshaller
Marshalls an XML representation of the passed
Object
to the file sytem location denoted by the passedURL
.- Specified by:
marshal
in interfaceAdaptrisMarshaller
- Parameters:
obj
- theObject
to marshall to XMLfileUrl
- the file system location to write to- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
unmarshal
Description copied from interface:AdaptrisMarshaller
Unmarshalls an
Object
from the passed XML.- Specified by:
unmarshal
in interfaceAdaptrisMarshaller
- Parameters:
xml
- theString
to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
unmarshal
Description copied from interface:AdaptrisMarshaller
Unmarshalls an
Object
based on the passedfile
.- Specified by:
unmarshal
in interfaceAdaptrisMarshaller
- Parameters:
file
- a file containing XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
unmarshal
Description copied from interface:AdaptrisMarshaller
Unmarshalls an
Object
based on the passed file systemURL
.- Specified by:
unmarshal
in interfaceAdaptrisMarshaller
- Parameters:
url
- the file system location to read from- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
- See Also:
-
unmarshal
Description copied from interface:AdaptrisMarshaller
Unmarshals an
Object
from the passedURLString
location.- Specified by:
unmarshal
in interfaceAdaptrisMarshaller
- Parameters:
loc
- the location to unmarshal from- Returns:
- the unmarshalled
Object
- Throws:
CoreException
- wrapping any underlyingException
s
-
unmarshal
Description copied from interface:AdaptrisMarshaller
Unmarshals an
Object
based on the passedInputStream
.- Specified by:
unmarshal
in interfaceAdaptrisMarshaller
- Parameters:
stream
- anInputStream
of XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
invokeDeserialize
Wrap the unmarshalling sequence by catching exceptions and re-throwing as CoreExceptions.- Throws:
CoreException
-
invokeSerialize
Wrap the marshalling sequence by catching exceptions and re-throwing as CoreExceptions.- Throws:
CoreException
-