Class XmlMappingMetaData

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

public class XmlMappingMetaData extends Object
Contains the meta-data of the XML mappings.
Author:
Daniel Sagenschneider
  • Field Details

    • upperBoundType

      protected String upperBoundType
      Upper bound type of the object that this mapping is sourcing from.
    • elementName

      protected String elementName
      Element name for this mapping.
    • attributeName

      protected String attributeName
      Attribute name flagging this mapping, if set, to be an attribute.
    • getMethodName

      protected String getMethodName
      Name of method to object the value/object for this mapping.
    • staticValue

      protected String staticValue
      Static value for the mapping.
    • isUseRaw

      protected boolean isUseRaw
      Indicates if to use the value raw.
    • objectMappings

      protected List<XmlMappingMetaData> objectMappings
      The mappings of the object in current context.
    • type

      protected XmlMappingType type
      Type of this Xml Mapping.
    • id

      protected String id
      Id for referencing.
  • Constructor Details

    • XmlMappingMetaData

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

      public XmlMappingMetaData(XmlMappingType type, String elementName, Class<?> upperType, XmlMappingMetaData[] configuration, String id)
      Convenience constructor for creating the root/item mapping configuration.
      Parameters:
      type - Either XmlMappingType.ROOT or XmlMappingType.ITEM.
      elementName - Name of root element.
      upperType - Upper bound type of root object.
      configuration - Configuration of the root object.
      id - Id to reference. May be null if not referenced.
    • XmlMappingMetaData

      public XmlMappingMetaData(XmlMappingType type, XmlMappingMetaData[] attributes)
      Convenience constructor for creating attributes mapping.
      Parameters:
      type - XmlMappingType.ATTRIBUTES.
      attributes - Mapping for the attributes of element.
    • XmlMappingMetaData

      public XmlMappingMetaData(XmlMappingType type, String tagName, String getMethodName, boolean isUseRaw)
      Convenience constructor for creating an attribute/value mapping.
      Parameters:
      type - Either XmlMappingType.ATTRIBUTE or XmlMappingType.VALUE.
      tagName - Name of the attribute/element.
      getMethodName - Method to obtain the value.
      isUseRaw - Indicates if use the raw value from object.
    • XmlMappingMetaData

      public XmlMappingMetaData(XmlMappingType type, String elementName, String getMethodName, XmlMappingMetaData[] objectMappings, String id)
      Convenience constructor for creating a collection/object mapping.
      Parameters:
      type - Either XmlMappingType.COLLECTION, XmlMappingType.TYPE or XmlMappingType.OBJECT.
      elementName - Name of element for context.
      getMethodName - Method to obtain object.
      objectMappings - Configuration of the mappings for the object.
      id - Id for referencing this.
    • XmlMappingMetaData

      public XmlMappingMetaData(XmlMappingType type, String getMethodName, String id)
      Convenience constructor for creating a reference mapping.
      Parameters:
      type - XmlMappingType.REFERENCE.
      getMethodName - Method to obtain object.
      id - Id of mapping to handle object.
  • Method Details

    • getElementName

      public String getElementName()
      Obtains the elemenet name.
      Returns:
      Name for the element.
    • setElementName

      public void setElementName(String elementName)
      Specifies the element name.
      Parameters:
      elementName - Name for the element.
    • getAttributeName

      public String getAttributeName()
      Obtains the attribute name.
      Returns:
      Name for the attribute.
    • setAttributeName

      public void setAttributeName(String attributeName)
      Specifies the attribute name.
      Parameters:
      attributeName - Name for the attribute.
    • getObjectMappings

      public XmlMappingMetaData[] getObjectMappings()
      Obtains the meta-data of the mappings for the object in the current context.
      Returns:
      Meta-data of the mappings for the object in the current context.
    • addObjectMapping

      public void addObjectMapping(XmlMappingMetaData mapping)
      Adds a XmlMappingMetaData for the object in the current context.
      Parameters:
      mapping - Meta-data mapping for object in current context.
    • getUpperBoundType

      public String getUpperBoundType()
      Obtains the class name of the upper bound type of the current object in the context.
      Returns:
      Upper bound type of the current object in the context.
    • setUpperBoundType

      public void setUpperBoundType(String type)
      Specifies the class name of the upper bound type of the current object in the context.
      Parameters:
      type - Upper bound type of the current object in the context.
    • getGetMethodName

      public String getGetMethodName()
      Obtains the name of the method to get the value from the object in the current context.
      Returns:
      Name of method.
    • setGetMethodName

      public void setGetMethodName(String getMethodName)
      Specifies the name of the method to get the value from the object in the current context.
      Parameters:
      getMethodName - Name of method.
    • getStaticValue

      public String getStaticValue()
      Obtains the static value for the element/attribute.
      Returns:
      Static value for the element/attribute.
    • isUseRaw

      public boolean isUseRaw()
      Indicates whether the value should be used raw or whether it should be transformed for XML (ie special characters substituted).
      Returns:
      Flag indicate whether to use the raw value.
    • setIsUseRaw

      public void setIsUseRaw(String isUseRaw)
      Specifies whether the value should be used raw or whether it should be transformed for XML (ie special characters subsituted).
      Parameters:
      isUseRaw - Flag indicating whether to use the raw value.
    • getType

      public XmlMappingType getType()
      Obtains the type of this XML mapping.
      Returns:
      Type of this XML mapping.
    • setType

      public void setType(String type)
      Specifies the type of this XML mapping.
      Parameters:
      type - Type for this XML mapping.
    • getId

      public String getId()
      Obtains the Id for reference mapping.
      Returns:
      Id for referencing.
    • setId

      public void setId(String id)
      Specifies the Id for reference mapping.
      Parameters:
      id - Id for referencing.
    • loadObjectMappings

      protected void loadObjectMappings(XmlMappingMetaData[] objectMappings)
      Loads the object mappings.
      Parameters:
      objectMappings - Object mappings.