public interface Parser
Modifier and Type | Method and Description |
---|---|
ParserConfigurator |
configureParser(List<String> contextPath,
ClassLoader loader)
Creates an initial configurator object to be used to facilitate the marshaling and unmarshaling
processes.
|
void |
marshal(ParserConfigurator configurator,
Object obj,
Node node)
Converts an object graph into a Node,
|
void |
marshal(ParserConfigurator configurator,
Object obj,
OutputStream os)
Converts an object graph into the appropriate output format, writing it to the given stream.
|
<T> T |
unmarshal(ParserConfigurator configurator,
Class<? extends T> cls,
InputStream stream)
Converts a representation of an object graph into an instance of type
T . |
<T> T |
unmarshal(ParserConfigurator configurator,
Class<? extends T> cls,
Node node)
Converts a representation of an object graph into an instance of type
T . |
<T> T |
unmarshal(ParserConfigurator configurator,
Class<? extends T> cls,
Source source)
Converts a representation of an object graph into an instance of type
T . |
ParserConfigurator configureParser(List<String> contextPath, ClassLoader loader)
contextPath
- a list of paths that implementations can search in order to find binding
informationloader
- the classloader for the parser to usecontextPath
and loader
void marshal(ParserConfigurator configurator, Object obj, OutputStream os) throws ParserException
configurator
- object containing the relevant configuration information needed to perform
the conversionobj
- the root of the object graph to convertos
- the output stream on which the converted object is writtenParserException
void marshal(ParserConfigurator configurator, Object obj, Node node) throws ParserException
configurator
- obj
- node
- ParserException
<T> T unmarshal(ParserConfigurator configurator, Class<? extends T> cls, InputStream stream) throws ParserException
T
.T
- expected return objectconfigurator
- object containing the relevant configuration information needed to perform
the conversioncls
- Class
for the conversionstream
- input stream which is read for the object dataT
as read and converted from the streamParserException
<T> T unmarshal(ParserConfigurator configurator, Class<? extends T> cls, Node node) throws ParserException
T
.T
- cls
- node
- T
as read and converted from the nodeParserException
<T> T unmarshal(ParserConfigurator configurator, Class<? extends T> cls, Source source) throws ParserException
T
.T
- cls
- source
- T
as read and converted from the sourceParserException
This work is licensed under a Creative Commons Attribution 4.0 International License.