Package com.highdeal.rangetable.hci
Class RangeTableColumnModel
java.lang.Object
com.highdeal.rangetable.hci.RangeTableColumnModel
- All Implemented Interfaces:
IXMLMarshallable,XMLMapping,XMLMarshallable,Comparable<RangeTableColumnModel>
public class RangeTableColumnModel
extends Object
implements IXMLMarshallable, XMLMapping, Comparable<RangeTableColumnModel>
This
Java class is a generic range table column model used by RangeTableRowModel and RangeTableRangeModel.XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:complexType name="RangeTableColumnType">
<xs:sequence>
<xs:choice>
<xs:element ref="string" />
<xs:element ref="number" />
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
-
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.intcompareTo(RangeTableColumnModel rangeTableColumnModel) Class<?>getClass(String nsUri, String tag, XMLAttributes atts) Returns theJava classfor a specifiedXML tagand its attributes in a namespace.getName()Gets the name of the column.Gets the value as aBigDecimalif the column type isNumber.Gets the value as aStringif the column type isString.getType()Gets the column type.voidmarshal(XMLOutputter output) Deprecated.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.voidSets the name of the column.voidsetNumberValue(BigDecimal value) Sets aBigDecimalvalue and sets the type of the column toRangeTableClassOutColumnModel.OutRangeTableClassType.SINGLE_NUMBER.voidsetStringValue(String value) Sets aStringvalue and sets the type of the column toRangeTableClassOutColumnModel.OutRangeTableClassType.STRING.voidsetType(RangeTableColumnType newType) Sets the type of the column.
-
Field Details
-
NAME_TAG_NAME
The XML tag name of the data model: "name"- See Also:
-
-
Constructor Details
-
RangeTableColumnModel
public RangeTableColumnModel()
-
-
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
-
getType
Gets the column type.- Returns:
- The type of the column
- See Also:
-
setType
Sets the type of the column. If thetypespecified in parameter does not match with the internaltype, then thevalueis set tonull.- Parameters:
newType- The type of the column to set- See Also:
-
getStringValue
Gets the value as aStringif the column type isString.- Returns:
- The
Stringvalue of the column if the type isString,nullotherwise
-
setStringValue
Sets aStringvalue and sets the type of the column toRangeTableClassOutColumnModel.OutRangeTableClassType.STRING.- 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 toRangeTableClassOutColumnModel.OutRangeTableClassType.SINGLE_NUMBER.- Parameters:
value- TheBigDecimalvalue to set in the column
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- 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.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshalAttributes
Description copied from interface:IXMLMarshallableGives an XML representation of the attributes of an object.- Specified by:
marshalAttributesin interfaceIXMLMarshallable- 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.- Specified by:
marshalChildrenin interfaceIXMLMarshallable- Parameters:
output- TheXML outputto marshal the child objects into
-
marshal
Deprecated.Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceIXMLMarshallable- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
getClass
Description copied from interface:XMLMappingReturns theJava classfor a specifiedXML tagand its attributes in a namespace.- Specified by:
getClassin interfaceXMLMapping- Parameters:
nsUri- The unique resource identifier of the namespace of the XML tagtag- The local part of the XML tagatts- The attributes of the XML tag- Returns:
- A
Java classwith a default constructor
-
compareTo
- Specified by:
compareToin interfaceComparable<RangeTableColumnModel>
-