Class XmlContext
java.lang.Object
net.officefloor.plugin.xml.unmarshall.tree.XmlContext
Context for XML unmarshalling to target object.
- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,ElementXmlMapping> Mappings of XML element to appropriateElementXmlMapping. -
Constructor Summary
ConstructorsModifierConstructorDescriptionXmlContext(Class<?> targetObjectType, String rootNode, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referencedRegistry) Constructor that should be used by external classes to instantiate this.protectedXmlContext(Class<?> targetObjectType, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, String outerElementName, XmlContext outerContext, ReferencedXmlMappingRegistry referencedRegistry) Initiate theXmlContextfrom configuration. -
Method Summary
Modifier and TypeMethodDescriptiongetElementXmlMapping(String elementName) Obtains theElementXmlMappingfor the element.
-
Field Details
-
mappings
Mappings of XML element to appropriateElementXmlMapping.
-
-
Constructor Details
-
XmlContext
public XmlContext(Class<?> targetObjectType, 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 referencedXmlMappinginstances.- Throws:
XmlMarshallException- Should thisXmlContextfail to be configured.
-
XmlContext
protected XmlContext(Class<?> targetObjectType, XmlMappingMetaData[] configuration, TranslatorRegistry translatorRegistry, String outerElementName, XmlContext outerContext, ReferencedXmlMappingRegistry referencedRegistry) throws XmlMarshallException Initiate 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 Details
-
getElementXmlMapping
Obtains theElementXmlMappingfor the element.- Parameters:
elementName- Element name.- Returns:
ElementXmlMappingfor element ornullif there is no mapping.
-