Class XmlContext
- java.lang.Object
-
- net.officefloor.plugin.xml.unmarshall.tree.XmlContext
-
public class XmlContext extends java.lang.Object
Context for XML unmarshalling to target object.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,ElementXmlMapping>
mappings
Mappings of XML element to appropriateElementXmlMapping
.
-
Constructor Summary
Constructors Modifier Constructor Description XmlContext(java.lang.Class<?> targetObjectType, java.lang.String rootNode, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referencedRegistry)
Constructor that should be used by external classes to instantiate this.protected
XmlContext(java.lang.Class<?> targetObjectType, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, java.lang.String outerElementName, XmlContext outerContext, ReferencedXmlMappingRegistry referencedRegistry)
Initiate theXmlContext
from configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementXmlMapping
getElementXmlMapping(java.lang.String elementName)
Obtains theElementXmlMapping
for the element.
-
-
-
Field Detail
-
mappings
protected final java.util.Map<java.lang.String,ElementXmlMapping> mappings
Mappings of XML element to appropriateElementXmlMapping
.
-
-
Constructor Detail
-
XmlContext
public XmlContext(java.lang.Class<?> targetObjectType, java.lang.String rootNode, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referencedRegistry) throws XmlMarshallException
Constructor that should be used by external classes to instantiate this.- Parameters:
targetObjectType
- Class of the target object.rootNode
- Name of root node to begin XML unmarshalling.configuration
- Configuration of thisXmlContext
.translatorRegistry
- Registry of translators for value translation.referencedRegistry
- Registry of referencedXmlMapping
instances.- Throws:
XmlMarshallException
- Should thisXmlContext
fail to be configured.
-
XmlContext
protected XmlContext(java.lang.Class<?> targetObjectType, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, java.lang.String outerElementName, XmlContext outerContext, ReferencedXmlMappingRegistry referencedRegistry) throws XmlMarshallException
Initiate theXmlContext
from configuration.- Parameters:
targetObjectType
- Class of the target object.configuration
- Configuration of thisXmlContext
.translatorRegistry
- Registry of translators for value translation.outerElementName
- Element name of outer context to enable mapping attributes onto appropriate context.outerContext
- OuterXmlContext
to map attributes on.referencedRegistry
- Registry of referencedXmlMapping
instances.- Throws:
XmlMarshallException
- Should thisXmlContext
fail to be configured.
-
-
Method Detail
-
getElementXmlMapping
public ElementXmlMapping getElementXmlMapping(java.lang.String elementName)
Obtains theElementXmlMapping
for the element.- Parameters:
elementName
- Element name.- Returns:
ElementXmlMapping
for element ornull
if there is no mapping.
-
-