Package com.highdeal.mappingtable.hci
Class MappingTableColumnModel
java.lang.Object
com.highdeal.hci.HCIModelAdapter
com.highdeal.mappingtable.hci.MappingTableColumnModel
- All Implemented Interfaces:
ITagNameProvider,IXMLMarshallable,XMLMarshallable
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" />
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThisenumerationlists all the possible type values of a column in a mapping table class (in and out columns). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.getName()Gets the name of the column.Gets the value as aBigDecimalif the column type isNumber.Gets the value as aStringif the column type isStringorCurrency.Gets the XML tag name of the HCI model.getType()Gets the column type.voidmarshalAttributes(XMLOutputter output) Gives an XML representation of the attributes of an object.voidmarshalChildren(XMLOutputter output) Gives an XML representation of the child objects of an object.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetCurrencyValue(String value) Sets aStringvalue and sets the type of the column toMappingTableColumnModel.MappingTableType.CURRENCY.voidSets the name of the column.voidsetNumberValue(BigDecimal value) Sets aBigDecimalvalue and sets the type of the column toMappingTableColumnModel.MappingTableType.NUMBER.voidsetStringValue(String value) Sets aStringvalue and sets the type of the column toMappingTableColumnModel.MappingTableType.STRING.voidSets the type of the column.Methods inherited from class com.highdeal.hci.HCIModelAdapter
marshal
-
Field Details
-
TAG_NAME
The XML tag name of a generic column of a row: "column"- See Also:
-
-
Constructor Details
-
MappingTableColumnModel
public MappingTableColumnModel()
-
-
Method Details
-
getName
Gets the name of the column.- Returns:
- A string that contains the name of the column
-
setName
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
Sets the type of the column. If the type specified in the method parameter does not match with the internaltypeof column, then the object value is set tonull.- Parameters:
newType- The type of the column to set- See Also:
-
getStringValue
Gets the value as aStringif the column type isStringorCurrency.- Returns:
- The
Stringvalue of the column if the type isStringorCurrency,nullotherwise
-
setStringValue
Sets aStringvalue and sets the type of the column toMappingTableColumnModel.MappingTableType.STRING.- Parameters:
value- TheStringvalue to set in the column
-
setCurrencyValue
Sets aStringvalue and sets the type of the column toMappingTableColumnModel.MappingTableType.CURRENCY.- Parameters:
value- TheStringvalue to set in the column
-
getNumberValue
Gets the value as aBigDecimalif the column type isNumber.- Returns:
- The
BigDecimalvalue of the column if the type isNumber,nullotherwise
-
setNumberValue
Sets aBigDecimalvalue and sets the type of the column toMappingTableColumnModel.MappingTableType.NUMBER.- Parameters:
value- TheBigDecimalvalue to set in the column
-
getTagName
Description copied from interface:ITagNameProviderGets the XML tag name of the HCI model.- Returns:
- The XML tag name
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Parameters:
atts- TheXML attributesof the current element
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Parameters:
cData- The character data to be added
-
marshalAttributes
Description copied from interface:IXMLMarshallableGives an XML representation of the attributes of an object.- Parameters:
output- TheXML outputto marshal the object attributes into
-
marshalChildren
Description copied from interface:IXMLMarshallableGives an XML representation of the child objects of an object.- Parameters:
output- TheXML outputto marshal the child objects into
-