Class XmlContext
- java.lang.Object
-
- net.officefloor.plugin.xml.unmarshall.tree.XmlContext
-
public class XmlContext extends java.lang.ObjectContext 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>mappingsMappings 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.protectedXmlContext(java.lang.Class<?> targetObjectType, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, java.lang.String outerElementName, XmlContext outerContext, ReferencedXmlMappingRegistry referencedRegistry)Initiate theXmlContextfrom configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementXmlMappinggetElementXmlMapping(java.lang.String elementName)Obtains theElementXmlMappingfor 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 XmlMarshallExceptionConstructor 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 referencedXmlMappinginstances.- Throws:
XmlMarshallException- Should thisXmlContextfail to be configured.
-
XmlContext
protected XmlContext(java.lang.Class<?> targetObjectType, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, java.lang.String outerElementName, XmlContext outerContext, ReferencedXmlMappingRegistry referencedRegistry) throws XmlMarshallExceptionInitiate theXmlContextfrom 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- OuterXmlContextto map attributes on.referencedRegistry- Registry of referencedXmlMappinginstances.- Throws:
XmlMarshallException- Should thisXmlContextfail to be configured.
-
-
Method Detail
-
getElementXmlMapping
public ElementXmlMapping getElementXmlMapping(java.lang.String elementName)
Obtains theElementXmlMappingfor the element.- Parameters:
elementName- Element name.- Returns:
ElementXmlMappingfor element ornullif there is no mapping.
-
-