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 Classes Modifier and Type Interface Description static interface
AdaptrisMarshaller.MarshalInputStream
static interface
AdaptrisMarshaller.MarshalOutputStream
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
marshal(java.lang.Object obj)
Marshalls an object to XML.void
marshal(java.lang.Object obj, java.io.File file)
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.io.Writer writer)
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 passedObject
to the file sytem location denoted by the passedURL
.static void
uncheckedMarshal(AdaptrisMarshaller m, java.lang.Object o, AdaptrisMarshaller.MarshalOutputStream out)
Convenience method to wrap marshalling activities with a RuntimeException .static java.lang.Object
uncheckedUnmarshal(AdaptrisMarshaller m, java.lang.Object o, AdaptrisMarshaller.MarshalInputStream in)
Convenience method to wrap unmarshalling activities with a RuntimeException .java.lang.Object
unmarshal(URLString location)
Unmarshals anObject
from the passedURLString
location.java.lang.Object
unmarshal(java.io.File file)
Unmarshalls anObject
based on the passedfile
.java.lang.Object
unmarshal(java.io.InputStream stream)
Unmarshals anObject
based on the passedInputStream
.java.lang.Object
unmarshal(java.io.Reader reader)
Unmarshalls anObject
based on the passedReader
.java.lang.Object
unmarshal(java.lang.String xml)
Unmarshalls anObject
from the passed XML.java.lang.Object
unmarshal(java.net.URL fileUrl)
Unmarshalls anObject
based on the passed file systemURL
.
-
-
-
Method Detail
-
marshal
java.lang.String marshal(java.lang.Object obj) throws CoreException
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
void marshal(java.lang.Object obj, java.lang.String fileName) throws CoreException
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
void marshal(java.lang.Object obj, java.io.File file) throws CoreException
Marshalls an object to XML.- Parameters:
obj
- theObject
to marshall to XMLfile
- the file to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
void marshal(java.lang.Object obj, java.io.Writer writer) throws CoreException
Marshalls an object to XML.- Parameters:
obj
- theObject
to marshall to XMLwriter
- the writer to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
void marshal(java.lang.Object obj, java.io.OutputStream outputStream) throws CoreException
Marshalls an object to XML.- Parameters:
obj
- the object to marshall to XMLoutputStream
- the OutputStream to write to- Throws:
CoreException
- wrapping any underlyingException
-
marshal
void marshal(java.lang.Object obj, java.net.URL fileUrl) throws CoreException
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
java.lang.Object unmarshal(java.lang.String xml) throws CoreException
Unmarshalls an
Object
from the passed XML.- Parameters:
xml
- theString
to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
java.lang.Object unmarshal(java.io.File file) throws CoreException
Unmarshalls an
Object
based on the passedfile
.- Parameters:
file
- a file containing XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
java.lang.Object unmarshal(java.net.URL fileUrl) throws CoreException
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
java.lang.Object unmarshal(java.io.Reader reader) throws CoreException
Unmarshalls an
Object
based on the passedReader
.- Parameters:
reader
- aReader
with XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
java.lang.Object unmarshal(java.io.InputStream stream) throws CoreException
Unmarshals an
Object
based on the passedInputStream
.- Parameters:
stream
- anInputStream
of XML to unmarshal- Returns:
- an
Object
- Throws:
CoreException
- wrapping any underlyingException
-
unmarshal
java.lang.Object unmarshal(URLString location) throws CoreException
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, java.lang.Object o, AdaptrisMarshaller.MarshalOutputStream out)
Convenience method to wrap marshalling activities with a RuntimeException .- Since:
- 3.8.2
-
uncheckedUnmarshal
static java.lang.Object uncheckedUnmarshal(AdaptrisMarshaller m, java.lang.Object o, AdaptrisMarshaller.MarshalInputStream in)
Convenience method to wrap unmarshalling activities with a RuntimeException .- Since:
- 3.8.2
-
-