Package esendex.sdk.java.parser.xstream
Class XStreamParser
java.lang.Object
esendex.sdk.java.parser.xstream.XStreamParser
- All Implemented Interfaces:
XmlParser
XmlParser that uses the XStream library to convert between XML and Dto
Objects.
- Author:
- Mike Whittaker
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate the parser by configuration of the underlying XStream instance. -
Method Summary
-
Constructor Details
-
XStreamParser
public XStreamParser()Instantiate the parser by configuration of the underlying XStream instance. Developers are directed to XStream documentation for details on how to modify this configuration.
-
-
Method Details
-
fromXml
Converts if possible, a String, that must be in XML format, to a Dto.- Specified by:
fromXml
in interfaceXmlParser
- Parameters:
xml
- the character data to be converted- Returns:
- a Dto object representing the argument
- Throws:
EsendexException
- if there is any problem reading or parseing the XML.
-
toXml
Converts a Dto Object to XML character data.
-