com.highdeal.rangetable.hci
Class RangeTableColumnModel

java.lang.Object
  extended by com.highdeal.rangetable.hci.RangeTableColumnModel
All Implemented Interfaces:
IXMLMarshallable, XMLMapping, XMLMarshallable

public class RangeTableColumnModel
extends java.lang.Object
implements IXMLMarshallable, XMLMapping

This Java class is a generic range table column model used by RangeTableRowModel.

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
static java.lang.String NAME_TAG_NAME
          The XML tag name of the data model: "name"
 
Constructor Summary
RangeTableColumnModel()
           
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 java.lang.Class<?> getClass(java.lang.String nsUri, java.lang.String tag, XMLAttributes atts)
          Returns the Java class for a specified XML tag and its attributes in a namespace.
 java.lang.String getName()
          Gets the name of the column.
 java.math.BigDecimal getNumberValue()
          Gets the value as a BigDecimal if the column type is Number.
 java.lang.String getStringValue()
          Gets the value as a String if the column type is String.
 RangeTableColumnType getType()
          Gets the column type.
 void marshal(XMLOutputter output)
          Deprecated. 
 void marshalAttributes(XMLOutputter output)
          Gives an XML representation of the attributes of an object.
 void marshalChildren(XMLOutputter output)
          Gives an XML representation of the child objects of an object.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setName(java.lang.String name)
          Sets the name of the column.
 void setNumberValue(java.math.BigDecimal value)
          Sets a BigDecimal value and sets the type of the column to RangeTableClassOutColumnModel.OutRangeTableClassType.SINGLE_NUMBER.
 void setStringValue(java.lang.String value)
          Sets a String value and sets the type of the column to RangeTableClassOutColumnModel.OutRangeTableClassType.STRING.
 void setType(RangeTableColumnType newType)
          Sets the type of the column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_TAG_NAME

public static final java.lang.String NAME_TAG_NAME
The XML tag name of the data model: "name"

See Also:
Constant Field Values
Constructor Detail

RangeTableColumnModel

public RangeTableColumnModel()
Method Detail

getName

public java.lang.String getName()
Gets the name of the column.

Returns:
A string that contains the name of the column

setName

public void setName(java.lang.String name)
Sets the name of the column.

Parameters:
name - The name of the column to set

getType

public RangeTableColumnType getType()
Gets the column type.

Returns:
The type of the column
See Also:
RangeTableClassOutColumnModel.OutRangeTableClassType

setType

public void setType(RangeTableColumnType newType)
Sets the type of the column. If the type specified in parameter does not match with the internal type, then the value is set to null.

Parameters:
newType - The type of the column to set
See Also:
RangeTableColumnType

getStringValue

public java.lang.String getStringValue()
Gets the value as a String if the column type is String.

Returns:
The String value of the column if the type is String, null otherwise

setStringValue

public void setStringValue(java.lang.String value)
Sets a String value and sets the type of the column to RangeTableClassOutColumnModel.OutRangeTableClassType.STRING.

Parameters:
value - The String value to set in the column.

getNumberValue

public java.math.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(java.math.BigDecimal value)
Sets a BigDecimal value and sets the type of the column to RangeTableClassOutColumnModel.OutRangeTableClassType.SINGLE_NUMBER.

Parameters:
value - The BigDecimal value to set in the column

addChild

public void addChild(java.lang.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.

Specified by:
addChild in interface XMLMarshallable
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.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
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.

Specified by:
marshalAttributes in interface IXMLMarshallable
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.

Specified by:
marshalChildren in interface IXMLMarshallable
Parameters:
output - The XML output to marshal the child objects into

marshal

@Deprecated
public void marshal(XMLOutputter output)
Deprecated. 

Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface IXMLMarshallable
Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

getClass

public java.lang.Class<?> getClass(java.lang.String nsUri,
                                   java.lang.String tag,
                                   XMLAttributes atts)
Description copied from interface: XMLMapping
Returns the Java class for a specified XML tag and its attributes in a namespace.

Specified by:
getClass in interface XMLMapping
Parameters:
nsUri - The unique resource identifier of the namespace of the XML tag
tag - The local part of the XML tag
atts - The attributes of the XML tag
Returns:
A Java class with a default constructor

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)