Package com.adaptris.core
Interface AdaptrisMarshaller
- All Known Implementing Classes:
AbstractMarshaller
,PreProcessingXStreamMarshaller
,StatisticMarshaller
,XStreamJsonMarshaller
,XStreamMarshaller
,XStreamMarshallerImpl
public interface AdaptrisMarshaller
Defines methods required to 'marshal' Java objects to XML.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionMarshalls an object to XML.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 object to XML.void
Marshalls an XML representation of the passedObject
to the file sytem location denoted by the passedURL
.static void
Convenience method to wrap marshalling activities with a RuntimeException .static Object
Convenience method to wrap unmarshalling activities with a RuntimeException .Unmarshals anObject
from the passedURLString
location.Unmarshalls anObject
based on the passedfile
.unmarshal
(InputStream stream) Unmarshals anObject
based on the passedInputStream
.Unmarshalls anObject
based on the passedReader
.Unmarshalls anObject
from the passed XML.Unmarshalls anObject
based on the passed file systemURL
.
-
Method Details
-
marshal
Marshalls an object to XML.- Parameters:
obj
- theObject
to marshall to XML- Returns:
- a XML representation of the
Object
- Throws:
CoreException
- wrapping any underlyingException
-
marshal
Marshalls an object to XML.- Parameters:
obj
- theObject
to marshall to XMLfileName
- the name of the file to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
Marshalls an object to XML.- Parameters:
obj
- theObject
to marshall to XMLfile
- the file to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
Marshalls an object to XML.- Parameters:
obj
- theObject
to marshall to XMLwriter
- the writer to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
Marshalls an object to XML.- Parameters:
obj
- the object to marshall to XMLoutputStream
- the OutputStream to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
Marshalls an XML representation of the passed
Object
to the file sytem location denoted by the passedURL
.- Parameters:
obj
- theObject
to marshall to XMLfileUrl
- the file system location to write to- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
Unmarshalls an
Object
from the passed XML.- Parameters:
xml
- theString
to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
Unmarshalls an
Object
based on the passedfile
.- Parameters:
file
- a file containing XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
Unmarshalls an
Object
based on the passed file systemURL
.- Parameters:
fileUrl
- the file system location to read from- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
Unmarshalls an
Object
based on the passedReader
.- Parameters:
reader
- aReader
with XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
Unmarshals an
Object
based on the passedInputStream
.- Parameters:
stream
- anInputStream
of XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
Unmarshals an
Object
from the passedURLString
location.- Parameters:
location
- the location to unmarshal from- Returns:
- the unmarshalled
Object
- Throws:
CoreException
- wrapping any underlyingException
s
-
uncheckedMarshal
static void uncheckedMarshal(AdaptrisMarshaller m, Object o, AdaptrisMarshaller.MarshalOutputStream out) Convenience method to wrap marshalling activities with a RuntimeException .- Since:
- 3.8.2
-
uncheckedUnmarshal
static Object uncheckedUnmarshal(AdaptrisMarshaller m, Object o, AdaptrisMarshaller.MarshalInputStream in) Convenience method to wrap unmarshalling activities with a RuntimeException .- Since:
- 3.8.2
-