Class TreeXmlUnmarshaller
- java.lang.Object
-
- net.officefloor.plugin.xml.unmarshall.tree.TreeXmlUnmarshaller
-
- All Implemented Interfaces:
XmlUnmarshaller
public class TreeXmlUnmarshaller extends java.lang.Object implements XmlUnmarshaller
Implementation ofXmlUnmarshaller
that is capable of unmarshalling a tree structure of objects from XML.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TreeXmlUnmarshaller.HandlerImpl
Handler to load XML values onto target object.
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
ATTRIBUTE_SEPARATOR
Separator of the attribute and element name for loading.protected TreeXmlUnmarshaller.HandlerImpl
handler
Handler to load the XML to the target object.protected javax.xml.parsers.SAXParser
parser
Parses the XML.
-
Constructor Summary
Constructors Constructor Description TreeXmlUnmarshaller(XmlMappingMetaData metaData, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry)
Initiate with details to unmarshall the XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
unmarshall(java.io.InputStream xml, java.lang.Object target)
Unmarshalls the input xml onto the input target object.
-
-
-
Field Detail
-
ATTRIBUTE_SEPARATOR
protected static final java.lang.String ATTRIBUTE_SEPARATOR
Separator of the attribute and element name for loading.- See Also:
- Constant Field Values
-
parser
protected final javax.xml.parsers.SAXParser parser
Parses the XML.
-
handler
protected final TreeXmlUnmarshaller.HandlerImpl handler
Handler to load the XML to the target object.
-
-
Constructor Detail
-
TreeXmlUnmarshaller
public TreeXmlUnmarshaller(XmlMappingMetaData metaData, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry) throws XmlMarshallException
Initiate with details to unmarshall the XML.- Parameters:
metaData
- Meta-data of the mappings.translatorRegistry
- Registry of translators.referenceRegistry
- Registry of referencedXmlMapping
instances.- Throws:
XmlMarshallException
- If fail to configure.
-
-
Method Detail
-
unmarshall
public void unmarshall(java.io.InputStream xml, java.lang.Object target) throws XmlMarshallException
Description copied from interface:XmlUnmarshaller
Unmarshalls the input xml onto the input target object.- Specified by:
unmarshall
in interfaceXmlUnmarshaller
- Parameters:
xml
- XML to unmarshall.target
- Target object to load XML data onto.- Throws:
XmlMarshallException
- Should fail to load XML data onto the target object.
-
-