Class DetailTemplateModel

java.lang.Object
com.highdeal.pnr.hci.DetailTemplateModel
All Implemented Interfaces:
XMLMarshallable

public class DetailTemplateModel extends Object implements 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 Details

    • DetailTemplateModel

      public DetailTemplateModel()
      Builds an empty DetailTemplate.
    • DetailTemplateModel

      public DetailTemplateModel(String name, int type, Object defaultValue, String propertyName)
      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

      public String getName()
      Returns the name of the DetailTemplate.
      Returns:
      the detail name.
    • setName

      public void setName(String name)
      Set the name of the DetailTemplate
      Parameters:
      name - : name of the DetailTemplate.
    • getPropertyName

      public String getPropertyName()
      Returns the name of the property mapped to this detail.
      Returns:
      the property name.
    • setPropertyName

      public void setPropertyName(String propertyName)
      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

      public Object getDefaultValue()
      Returns the default value of the DetailTemplate. According to the type, this value can be cast into :
    • java.math.BigDecimal for a NUMBER type.
    • java.util.Date for a DATE type.
    • java.lang.String for a STRING type.
    • Returns:
      the default value of the detail.
      See Also:
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
      Sets the value of the DetailTemplate.
      Parameters:
      defaultValue - the value of the DetailTemplate.
      See Also:
    • duplicate

      public DetailTemplateModel duplicate()
      Returns a new clone instance of this DetailTemplateModel
      Returns:
      a new intance of this DetailTemplateModel.
    • addCharacterData

      public void addCharacterData(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
    • 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
    • addChild

      public void addChild(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
    • marshal

      public void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into