Package com.highdeal.pnr.hci
Class DetailTemplateModel
java.lang.Object
com.highdeal.pnr.hci.DetailTemplateModel
- All Implemented Interfaces:
XMLMarshallable
This class represents a detail template.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="propertyDTType">
<xs:restriction base="xs:string">
<xs:enumeration value="string"/>
<xs:enumeration value="number"/>
<xs:enumeration value="date"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="detailTemplate">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="propertyDTType"/>
<xs:attribute name="defaultValue" type="xs:string"/>
<xs:attribute name="propertyName" type="xs:string"/>
</xs:complexType>
</xs:element>
-
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty DetailTemplate.DetailTemplateModel(String name, int type, Object defaultValue, String propertyName) Builds a DetailTemplate. -
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.Returns a new clone instance of this DetailTemplateModelReturns the default value of the DetailTemplate.getName()Returns the name of the DetailTemplate.Returns the name of the property mapped to this detail.intgetType()Returns the type of the DetailTemplate.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 value of the DetailTemplate.voidSet the name of the DetailTemplatevoidsetPropertyName(String propertyName) Returns the name of the DetailTemplate.voidsetType(int type) Set the type of the DetailTemplate.
-
Constructor Details
-
DetailTemplateModel
public DetailTemplateModel()Builds an empty DetailTemplate. -
DetailTemplateModel
Builds a DetailTemplate.- Parameters:
name- the name of the detail.type- the type of the detail.defaultValue- the default value (null if no default value) of the detail. This value must be compatible with the declared type. This value is taken if the propertyName is not found in the Rating Context.propertyName- the mapped property name (null if no mapping required).- See Also:
-
-
Method Details
-
getName
Returns the name of the DetailTemplate.- Returns:
- the detail name.
-
setName
Set the name of the DetailTemplate- Parameters:
name- : name of the DetailTemplate.
-
getPropertyName
Returns the name of the property mapped to this detail.- Returns:
- the property name.
-
setPropertyName
Returns the name of the DetailTemplate.- Parameters:
propertyName- the name of the mapped rating property. can be null if no mapping required.
-
getType
public int getType()Returns the type of the DetailTemplate.- Returns:
- the detail type.
- See Also:
-
setType
public void setType(int type) Set the type of the DetailTemplate.- Parameters:
type- : The new type;
-
getDefaultValue
Returns the default value of the DetailTemplate. According to the type, this value can be cast into :java.math.BigDecimalfor aNUMBERtype.java.util.Datefor aDATEtype.java.lang.Stringfor aSTRINGtype.- Returns:
- the default value of the detail.
- See Also:
-
setDefaultValue
Sets the value of the DetailTemplate.- Parameters:
defaultValue- the value of the DetailTemplate.- See Also:
-
duplicate
Returns a new clone instance of this DetailTemplateModel- Returns:
- a new intance of this DetailTemplateModel.
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data 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
-
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
-