Class ObjectXmlMapping
- java.lang.Object
-
- net.officefloor.plugin.xml.marshall.tree.AbstractXmlMapping
-
- net.officefloor.plugin.xml.marshall.tree.ObjectXmlMapping
-
- All Implemented Interfaces:
XmlMapping,XmlWriter
public class ObjectXmlMapping extends AbstractXmlMapping
Writes an object into XML.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected XmlContextcontextXmlContextfor marshalling the object.protected java.lang.StringelementNameName of XML element for this mapping.-
Fields inherited from class net.officefloor.plugin.xml.marshall.tree.AbstractXmlMapping
getMethod
-
-
Constructor Summary
Constructors Constructor Description ObjectXmlMapping(java.lang.String elementName, java.lang.reflect.Method getMethod, java.lang.Class<?> upperType, XmlMappingMetaData[] configuration, java.lang.String contextReference, XmlContext context, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry)Initiate the object XML mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwriteXml(java.lang.Object object, XmlOutput output)Writes the XML for the input object.-
Methods inherited from class net.officefloor.plugin.xml.marshall.tree.AbstractXmlMapping
getWriter, map
-
-
-
-
Field Detail
-
elementName
protected final java.lang.String elementName
Name of XML element for this mapping.
-
context
protected final XmlContext context
XmlContextfor marshalling the object.
-
-
Constructor Detail
-
ObjectXmlMapping
public ObjectXmlMapping(java.lang.String elementName, java.lang.reflect.Method getMethod, java.lang.Class<?> upperType, XmlMappingMetaData[] configuration, java.lang.String contextReference, XmlContext context, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry) throws XmlMarshallExceptionInitiate the object XML mapping.- Parameters:
elementName- Name of XML element for this mapping ornullif no element.getMethod- Method to obtain the object to map.upperType- Upper bound type for this mapping.configuration- Configuration for the object being mapped.contextReference- Reference by which to register the context as a child context.context- Current context to register the object's child context.referenceRegistry- Registry ofXmlMappingthat may be referenced.translatorRegistry- Registry ofTranslatorinstances.- Throws:
XmlMarshallException- If fails to configure.
-
-
Method Detail
-
writeXml
public void writeXml(java.lang.Object object, XmlOutput output) throws XmlMarshallExceptionDescription copied from interface:XmlWriterWrites the XML for the input object.- Parameters:
object- Object to have XML written for it.output- Output to write the XML.- Throws:
XmlMarshallException- If fails to write the object into XML.
-
-