Class MappingTableColumnModel

java.lang.Object
com.highdeal.hci.HCIModelAdapter
com.highdeal.mappingtable.hci.MappingTableColumnModel
All Implemented Interfaces:
ITagNameProvider, IXMLMarshallable, XMLMarshallable

public class MappingTableColumnModel extends HCIModelAdapter
This Java class is a generic model that represents a data value in a row of a mapping table or subscriber mapping table.

The data value can be a number, a string, or a currency depending on the definition of the corresponding column in the mapping table class.

Note

It can contain any type of values, so it can be used as a value in an input or output column.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:complexType name="MappingTableColumn">
   <xs:sequence>
     <xs:choice>
       <xs:element ref="string" />
       <xs:element name="currency" type="CurrencyType" />
       <xs:element ref="number" />
     </xs:choice>
   </xs:sequence>
   <xs:attribute name="name" type="xs:string" use="required"/>  <!-- the name of the input or output column as declared in the mapping table class -->
 </xs:complexType>

 <xs:element name="column" type="MappingTableColumn" />

  • Field Details

    • TAG_NAME

      public static final String TAG_NAME
      The XML tag name of a generic column of a row: "column"
      See Also:
  • Constructor Details

    • MappingTableColumnModel

      public MappingTableColumnModel()
  • Method Details

    • getName

      public String getName()
      Gets the name of the column.
      Returns:
      A string that contains the name of the column
    • setName

      public void setName(String name)
      Sets the name of the column.
      Parameters:
      name - The name of the column to set up
    • getType

      Gets the column type.
      Returns:
      The type of the column
      See Also:
    • setType

      public void setType(MappingTableColumnModel.MappingTableType newType)
      Sets the type of the column. If the type specified in the method parameter does not match with the internal type of column, then the object value is set to null.
      Parameters:
      newType - The type of the column to set
      See Also:
    • getStringValue

      public String getStringValue()
      Gets the value as a String if the column type is String or Currency.
      Returns:
      The String value of the column if the type is String or Currency, null otherwise
    • setStringValue

      public void setStringValue(String value)
      Sets a String value and sets the type of the column to MappingTableColumnModel.MappingTableType.STRING.
      Parameters:
      value - The String value to set in the column
    • setCurrencyValue

      public void setCurrencyValue(String value)
      Sets a String value and sets the type of the column to MappingTableColumnModel.MappingTableType.CURRENCY.
      Parameters:
      value - The String value to set in the column
    • getNumberValue

      public BigDecimal getNumberValue()
      Gets the value as a BigDecimal if the column type is Number.
      Returns:
      The BigDecimal value of the column if the type is Number, null otherwise
    • setNumberValue

      public void setNumberValue(BigDecimal value)
      Sets a BigDecimal value and sets the type of the column to MappingTableColumnModel.MappingTableType.NUMBER.
      Parameters:
      value - The BigDecimal value to set in the column
    • getTagName

      public String getTagName()
      Description copied from interface: ITagNameProvider
      Gets the XML tag name of the HCI model.
      Returns:
      The XML tag name
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Parameters:
      atts - The XML attributes of the current element
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Parameters:
      cData - The character data to be added
    • marshalAttributes

      public void marshalAttributes(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the attributes of an object.
      Parameters:
      output - The XML output to marshal the object attributes into
    • marshalChildren

      public void marshalChildren(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the child objects of an object.
      Parameters:
      output - The XML output to marshal the child objects into