Package com.highdeal.pnr.hci
Class OutMacroPropertyModel
java.lang.Object
com.highdeal.pnr.hci.OutMacroPropertyModel
- All Implemented Interfaces:
XMLMarshallable
This class represents an output property of a pricing macro
and contains a name, a description, a type and a default value.
The type of an output property must be
string,
number, or date.- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="outProperty">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="defaultValue" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
</xs:complexType>
</xs:element>
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty output property model.OutMacroPropertyModel(String name, String description, int type) Constructs an output property with a name, a description and a type.OutMacroPropertyModel(String name, String description, int type, Object defaultValue) Constructs an output property with a name, a description, a type and a default value. -
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 true if the property is valid.Gets the default value of the output property as a date.Gets the default value of the output property.Returns the description of the output property.getName()Returns the name of the output property.Gets the default value of the output property as a decimal.Gets the default value of the output property as a string.intgetType()Gets the type of the output property.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetDefaultValue(Object defaultValue) Sets the default value of the output property.voidSets the description of the output property.voidSets the name of the output property.voidsetType(int t) Sets the type of the output property.
-
Constructor Details
-
OutMacroPropertyModel
public OutMacroPropertyModel()Constructs an empty output property model. -
OutMacroPropertyModel
Constructs an output property with a name, a description, a type and a default value. (seesetType(int)for allowed type value)- Parameters:
name- the name of the output property.description- the description of the output property.type- the type of the output property.defaultValue- the default value of the output property.
-
OutMacroPropertyModel
Constructs an output property with a name, a description and a type. (seesetType(int)for type allowed value)- Parameters:
name- the name of the output property.description- the description of the output property.type- the type of the output property.
-
-
Method Details
-
getName
Returns the name of the output property.- Returns:
- the name of the output property.
-
setName
Sets the name of the output property.- Parameters:
n- the name of the output property.
-
getDescription
Returns the description of the output property.- Returns:
- the description of the output property.
-
setDescription
Sets the description of the output property.- Parameters:
d- the description of the output property.
-
getType
public int getType()- Returns:
- the type of the output property.
-
setType
public void setType(int t) - Parameters:
t- the type of the output property.
-
getDefaultValue
Gets the default value of the output property.- Returns:
- the default value of the output property.
-
setDefaultValue
Sets the default value of the output property.- Parameters:
defaultValue- the default value of the output property.
-
getStringValue
Gets the default value of the output property as a string.- Returns:
- the default value of the output property, or null if the default value is not a string.
-
getNumberValue
Gets the default value of the output property as a decimal.- Returns:
- the default value of the output property, or null if the default value is not a decimal.
-
getDateValue
Gets the default value of the output property as a date.- Returns:
- the default value of the output property, or null if the default value is not a date.
-
checkValidity
public boolean checkValidity()Returns true if the property is valid. Property is valid if its name is not null or empty, and if its default value is valid according to the specified type (seesetType(int)).- Returns:
- true if the property is valid, false otherwise.
-
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
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
-