Package com.highdeal.pnr.hci
Class ComponentProperty
java.lang.Object
com.highdeal.pnr.hci.ComponentProperty
- All Implemented Interfaces:
XMLMarshallable
This
Java class is a Helper class to marshal and unmarshal all the rating components.- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="componentPropertyType">
<xs:restriction base="xs:string">
<xs:enumeration value="number"/>
<xs:enumeration value="decimal"/>
<xs:enumeration value="string"/>
<xs:enumeration value="date"/>
<xs:enumeration value="money"/>
<xs:enumeration value="boolean"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="property">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="componentPropertyType"/>
<xs:attribute name="value" type="xs:string"/>
<xs:attribute name="propertyNameValue" type="xs:boolean" default="false"/>
</xs:complexType>
</xs:element>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant for property type boolean.static final intConstant for property type date.static final intConstant for property type money.static final intConstant for property type number.static final intConstant for property type string. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty component property.ComponentProperty(String name, int type, Object value, boolean isPropertyNameValue) Build the ComponentProperty from the given parameters. -
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.booleanReturns the value of the component property as a boolean.static intgetComponentPropertyType(int hciType) Returns the value of the component property as a date.Returns the value of the component property as a decimal.intstatic intgetHciType(int componentPropertyType) Returns the value of the component property as a money.getName()Returns the name of the component property.Returns the value of the component property as a property name.Returns the value of the component property as a string.intgetType()Returns the type of the component property.getValue()Get the value of the component property as an object.booleanWhether the property value is a property namevoidisPropertyNameValue(boolean isPropertyNameValue) Set whether the component property is pointing to a property.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidmarshal(XMLOutputter output, String fullName) static voidmarshal(XMLOutputter output, String name, boolean value) Helper static method to marshall a component property of type boolean.static voidmarshal(XMLOutputter output, String name, Money value) Helper static method to marshall a component property of type money.static voidmarshal(XMLOutputter output, String name, String value) Helper static method to marshall a component property of type string.static voidmarshal(XMLOutputter output, String name, String value, int type) Helper static method to marshall a component property of any type with a value which is a name property.static voidmarshal(XMLOutputter output, String name, BigDecimal value) Helper static method to marshall a component property of type decimal.static voidmarshal(XMLOutputter output, String name, Date value) Helper static method to marshall a component property of type date.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetBooleanValue(boolean booleanValue) Set the value of the component property with a boolean.voidsetDateValue(Date dateValue) Set the value f the component property with a date.voidsetDecimalValue(BigDecimal decimalValue) Set the value of the component property with a decimal.voidsetMoneyValue(Money moneyValue) Set the value of the component property with a money.voidSet the component property name.voidsetPropertyNameValue(String propertyNameValue) Set the value of the component property with a property name.voidsetStringValue(String stringValue) Set the value of the component property with a string.voidsetType(int type) Set the component property type.voidSet the value of the component property with an object.Convert theComponentPropertyto aProperty.static StringDeprecated.
-
Field Details
-
TYPE_STRING
public static final int TYPE_STRINGConstant for property type string.- See Also:
-
TYPE_NUMBER
public static final int TYPE_NUMBERConstant for property type number.- See Also:
-
TYPE_DATE
public static final int TYPE_DATEConstant for property type date.- See Also:
-
TYPE_MONEY
public static final int TYPE_MONEYConstant for property type money.- See Also:
-
TYPE_BOOLEAN
public static final int TYPE_BOOLEANConstant for property type boolean.- See Also:
-
-
Constructor Details
-
ComponentProperty
public ComponentProperty()Constructs an empty component property. -
ComponentProperty
Build the ComponentProperty from the given parameters.
-
-
Method Details
-
getName
Returns the name of the component property.- Returns:
- The name of the component property
-
setName
Set the component property name.- Parameters:
name- The new name of the component property
-
getStringValue
Returns the value of the component property as a string.- Returns:
- The value of the component property as a string
-
setStringValue
Set the value of the component property with a string.- Parameters:
stringValue- The value to set up
-
getDecimalValue
Returns the value of the component property as a decimal.- Returns:
- The value of the component property as a decimal
-
setDecimalValue
Set the value of the component property with a decimal.- Parameters:
decimalValue- The value to set up
-
getDateValue
Returns the value of the component property as a date.- Returns:
- The value of the component property as a date
-
setDateValue
Set the value f the component property with a date.- Parameters:
dateValue- The value to set up
-
getMoneyValue
Returns the value of the component property as a money.- Returns:
- The value of the component property as a money
-
setMoneyValue
Set the value of the component property with a money.- Parameters:
moneyValue- The value to set up
-
getBooleanValue
public boolean getBooleanValue()Returns the value of the component property as a boolean.- Returns:
- The value of the component property as a boolean
-
setBooleanValue
public void setBooleanValue(boolean booleanValue) Set the value of the component property with a boolean.- Parameters:
booleanValue- The value to set up
-
getPropertyNameValue
Returns the value of the component property as a property name.- Returns:
- The value of the component property as a property name
-
setPropertyNameValue
Set the value of the component property with a property name.- Parameters:
propertyNameValue- The value to set up
-
getValue
Get the value of the component property as an object.- Returns:
- The component property value
-
setValue
Set the value of the component property with an object.- Parameters:
value- The value to set up
-
isPropertyNameValue
public boolean isPropertyNameValue()Whether the property value is a property name- Returns:
- Whether the property value is a property name
-
isPropertyNameValue
public void isPropertyNameValue(boolean isPropertyNameValue) Set whether the component property is pointing to a property.- Parameters:
isPropertyNameValue- Whether the component property is pointing to a property
-
getType
public int getType()Returns the type of the component property.- Returns:
- The type of the component property
-
setType
public void setType(int type) Set the component property type.- Parameters:
type- The type to set up
-
getHciType
public static int getHciType(int componentPropertyType) -
getComponentPropertyType
public static int getComponentPropertyType(int hciType) -
getHciType
public int getHciType() -
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
-
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
-
marshal
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
marshal
Helper static method to marshall a component property of type string.- Parameters:
output- The XML outputter where the output has to goname- The name of the propertyvalue- The value of the property
-
marshal
Helper static method to marshall a component property of type date.- Parameters:
output- The XML outputter where the output has to goname- The name of the propertyvalue- The value of the property
-
marshal
Helper static method to marshall a component property of type decimal.- Parameters:
output- The XML outputter where the output has to goname- The name of the propertyvalue- The value of the property
-
marshal
Helper static method to marshall a component property of type money.- Parameters:
output- The XML outputter where the output has to goname- The name of the propertyvalue- The value of the property
-
marshal
Helper static method to marshall a component property of type boolean.- Parameters:
output- The XML outputter where the output has to goname- The name of the propertyvalue- The value of the property
-
marshal
Helper static method to marshall a component property of any type with a value which is a name property.- Parameters:
output- The XML outputter where the output has to goname- The name of the propertyvalue- The value of the property (the property name to which the current property is pointing)type- The type of the property
-
translate
Deprecated.- Parameters:
propertyName-
-
toProperty
Convert theComponentPropertyto aProperty.- Returns:
- The
Propertyresults from the conversion - Throws:
IllegalArgumentException- throws if the type of theComponentPropertyis notTYPE_DATE,TYPE_NUMBERneitherTYPE_STRING
-