Class XmlMappingMetaData

java.lang.Object
net.officefloor.plugin.xml.unmarshall.tree.XmlMappingMetaData

public class XmlMappingMetaData extends Object
Meta-data of the XmlContext.
Author:
Daniel Sagenschneider
  • Field Details

    • id

      protected String id
      Identifies this XML mapping for reuse (or if already configured to use the same configuration).
    • elementName

      protected String elementName
      Name of XML element/attribute which is the focus of this mapping.
    • loadMethodName

      protected String loadMethodName
      Name of method to load value/object to target object.
    • loadObjectClassName

      protected String loadObjectClassName
      Should this be an object loading mapping, then this should be specified and be the fully quanlified name of the class of the object to load.
    • format

      protected String format
      Format for loading a value.
    • staticValue

      protected String staticValue
      Static value to load to target object.
    • loadObjectConfiguration

      protected List<XmlMappingMetaData> loadObjectConfiguration
      The mappings of the loaded object, should the loadObjectClassName be specified.
    • type

      protected XmlMappingType type
      Type of this mapping.
  • Constructor Details

    • XmlMappingMetaData

      public XmlMappingMetaData()
      Default constructor to allow the TreeXmlUnmarshaller to configure itself.
    • XmlMappingMetaData

      public XmlMappingMetaData(Class<?> targetObjectType, String rootElementName, XmlMappingMetaData[] targetObjectConfiguration)
      Convenience constructor for configuring the root of the mapping tree.
      Parameters:
      targetObjectType - Class of the target object.
      rootElementName - Root XML element name.
      targetObjectConfiguration - Configuration of the target object.
    • XmlMappingMetaData

      public XmlMappingMetaData(String elementName, String loadMethodName, String format)
      Convenience constructor for configuring to load a value.
      Parameters:
      elementName - XML element/attribute name containing the value.
      loadMethodName - Method by which to load the value onto the target object.
      format - Format of the value if required otherwise make pass null.
    • XmlMappingMetaData

      public XmlMappingMetaData(String elementName, String loadMethodName, Class<?> loadObjectClass, XmlMappingMetaData[] loadObjectConfiguration, String id)
      Convenience constructor for configuring to load an object.
      Parameters:
      elementName - XML element name.
      loadMethodName - Method by which to load the object onto the target object.
      loadObjectClass - Class of the object to load onto the target object.
      loadObjectConfiguration - Configuration of load object.
      id - Identifier of the XML mapping. If not be re-used may be null.
    • XmlMappingMetaData

      public XmlMappingMetaData(String loadMethodName, String id)
      Convenience constructor for configuring to load by reference.
      Parameters:
      loadMethodName - Method by which to begin reference loading to target object.
      id - Identifier of the XML mapping to re-use.
    • XmlMappingMetaData

      public XmlMappingMetaData(XmlMappingType type, String loadMethodName, String staticValue)
      Convenience constructor for configuring to load a static reference.
      Parameters:
      type - Type of this XML mapping.
      loadMethodName - Method by which to load the static value to target object.
      staticValue - Static value to load to target object.
  • Method Details

    • getType

      public XmlMappingType getType() throws XmlMarshallException
      Obtains the type of this mapping.
      Returns:
      Type of this mapping.
      Throws:
      XmlMarshallException - If no type has been specified.
    • setType

      public void setType(String typeName)
      Enables specifying the type name.
      Parameters:
      typeName - Name of the type.
    • getId

      public String getId()
      Obtains the identifier of this XML mapping.
      Returns:
      Identifier of XML mapping.
    • setId

      public void setId(String id)
      Specifies the identifier of the XML mapping.
      Parameters:
      id - Identifier of the XML mapping.
    • getElementName

      public String getElementName()
      Obtains the XML element/attribute name.
      Returns:
      XML element/attribute name.
    • setElementName

      public void setElementName(String elementName)
      Specifies the XML element/attribute name.
      Parameters:
      elementName - XML element/attribute name.
    • getLoadMethodName

      public String getLoadMethodName()
      Obtains the name of the method on the target object to load the value/object.
      Returns:
      Load method name.
    • setLoadMethodName

      public void setLoadMethodName(String loadMethodName)
      Specifies the name of the method on the target object to load the value/object.
      Parameters:
      loadMethodName - Load method name.
    • getLoadObjectClassName

      public String getLoadObjectClassName()
      Obtains the fully qualified name of the class of the object to be loaded to the target object.
      Returns:
      Load object class name.
    • setLoadObjectClassName

      public void setLoadObjectClassName(String loadObjectClassName)
      Specifies the fully qualified name of the class of the object to be loaded to the target object.
      Parameters:
      loadObjectClassName - Load object class name.
    • getFormat

      public String getFormat()
      Obtains the format for loading the value.
      Returns:
      Format for loading the value.
    • setFormat

      public void setFormat(String format)
      Specifies the format for loading the value.
      Parameters:
      format - Format for loading the value.
    • getStaticValue

      public String getStaticValue()
      Obtains the static value to load to target object.
      Returns:
      Static value.
    • setStaticValue

      public void setStaticValue(String staticValue)
      Specifies the static value to load to target object.
      Parameters:
      staticValue - Static value.
    • getLoadObjectConfiguration

      public XmlMappingMetaData[] getLoadObjectConfiguration()
      Obtains the configuration for the object to load onto the target object.
      Returns:
      Load object configuration.
    • addLoadObjectConfiguration

      public void addLoadObjectConfiguration(XmlMappingMetaData loadObjectMapping)
      Adds another XmlMappingMetaData configuration for the object to load onto the target object.
      Parameters:
      loadObjectMapping - XmlMappingMetaData for the object to load onto the target object.