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 Details

    • elementName

      protected final String elementName
      Name of XML element for this mapping.
    • context

      protected final XmlContext context
      XmlContext for marshalling the object.
  • Constructor Details

    • ObjectXmlMapping

      public ObjectXmlMapping(String elementName, Method getMethod, Class<?> upperType, XmlMappingMetaData[] configuration, String contextReference, XmlContext context, TranslatorRegistry translatorRegistry, ReferencedXmlMappingRegistry referenceRegistry) throws XmlMarshallException
      Initiate the object XML mapping.
      Parameters:
      elementName - Name of XML element for this mapping or null if 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 of XmlMapping that may be referenced.
      translatorRegistry - Registry of Translator instances.
      Throws:
      XmlMarshallException - If fails to configure.
  • Method Details

    • writeXml

      public void writeXml(Object object, XmlOutput output) throws XmlMarshallException
      Description copied from interface: XmlWriter
      Writes 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.