Constructor and Description |
---|
XmlParser() |
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 . |
public ParserConfigurator configureParser(List<String> contextPath, ClassLoader loader)
Parser
configureParser
in interface Parser
contextPath
- a list of paths that implementations can search in order to find binding
informationloader
- the classloader for the parser to usecontextPath
and loader
public void marshal(ParserConfigurator configurator, Object obj, OutputStream os) throws ParserException
Parser
marshal
in interface Parser
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
public void marshal(ParserConfigurator configurator, Object obj, Node node) throws ParserException
Parser
marshal
in interface Parser
ParserException
public <T> T unmarshal(ParserConfigurator configurator, Class<? extends T> cls, InputStream stream) throws ParserException
Parser
T
.unmarshal
in interface Parser
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
public <T> T unmarshal(ParserConfigurator configurator, Class<? extends T> cls, Node node) throws ParserException
Parser
T
.unmarshal
in interface Parser
T
as read and converted from the nodeParserException
public <T> T unmarshal(ParserConfigurator configurator, Class<? extends T> cls, Source source) throws ParserException
Parser
T
.unmarshal
in interface Parser
T
as read and converted from the sourceParserException
This work is licensed under a Creative Commons Attribution 4.0 International License.