Class RateComponentModel

java.lang.Object
com.highdeal.pnr.hci.RateComponentModel
All Implemented Interfaces:
XMLMarshallable, ContextualNode
Direct Known Subclasses:
ChargeModel, DefaultChargeActionModel, ExternalChargeActionModel, MacroComponentModel, OutPropertyUpdateComponentModel, PreTableComponentModel, PreTierTableComponentModel

public abstract class RateComponentModel extends Object implements ContextualNode, XMLMarshallable
Abstract representation of a rate component.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="component">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="component" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="type" type="xs:string"/>
    <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
  </xs:element>

  • Constructor Details

    • RateComponentModel

      public RateComponentModel()
      Builds an empty RateComponentModel.
  • Method Details

    • setName

      public void setName(String name)
      Sets the name.
      Parameters:
      name - the name.
    • getName

      public String getName()
      Gets the name.
      Returns:
      the name.
    • setDescription

      public void setDescription(String description)
      Sets the description.
      Parameters:
      description - the description.
    • getDescription

      public String getDescription()
      Gets the description.
      Returns:
      the description.
    • getChildCount

      public int getChildCount()
      Gets the child count.
      Returns:
      the child count.
    • getChildAt

      public RateComponentModel getChildAt(int index)
      Gets a child.
      Parameters:
      index - the index of the desired child.
      Returns:
      the child at the index or null if invalid index.
    • getMaxChildCount

      public abstract int getMaxChildCount()
      Gets the maximum child count.
      Returns:
      the maximum child count.
    • checkValidity

      public abstract boolean checkValidity()
      Returns true if the component is valid.
      Returns:
      true if the component is valid, false otherwise.
    • getPropertyReferences

      public abstract List<com.highdeal.pnr.hci.PropertyReference> getPropertyReferences()
      Returns the list of the properties that are used in this component.
      Returns:
      the list of the properties that are used in this component
    • getPropertyNames

      @Deprecated public final List<String> getPropertyNames()
      Deprecated.
      Use getPropertyReferences() instead, in order to get detailed property descriptions.
      Returns the list of the property names that are used in the component.
      Returns:
      the list of the property names that are used in the component
    • setChild

      public void setChild(int index, RateComponentModel component) throws IndexOutOfBoundsException
      Sets a child. Child is added at the end if index is higher than child count.
      Parameters:
      index - the index where to place the child.
      component - the child component.
      Throws:
      IndexOutOfBoundsException
    • removeChild

      public void removeChild(int index) throws IndexOutOfBoundsException
      Removes a child.
      Parameters:
      index - the index of the child to remove.
      Throws:
      IndexOutOfBoundsException
    • remove

      public void remove()
      Clears the component to remove it.
    • isSetChildAllowed

      public boolean isSetChildAllowed(int index) throws IndexOutOfBoundsException
      Tests if setting a child at an index is allowed.
      Parameters:
      index - the index of the desired child.
      Returns:
      true if index correspond to a null child, false otherwise.
      Throws:
      IndexOutOfBoundsException
    • isRemoveChildAllowed

      public boolean isRemoveChildAllowed(int index) throws IndexOutOfBoundsException
      Test if removing a child at an index is allowed.
      Parameters:
      index - the index of the desired child.
      Returns:
      true if index corresponds to a valid child, false otherwise.
      Throws:
      IndexOutOfBoundsException
    • setChildren

      public void setChildren(Vector<RateComponentModel> children)
      Sets the children.
      Parameters:
      children - a Vector of RateComponentModel representing the children.
    • findRootRateModel

      public ContextualNode findRootRateModel()
      Find the parent RateComponentModel.
      Returns:
      the parent RateComponentModel
    • getChildren

      public Vector<RateComponentModel> getChildren()
      Gets the children.
      Returns:
      a Vector of RateComponentModel representing the children.
    • setParent

      public void setParent(ContextualNode node)
      Description copied from interface: ContextualNode
      Sets the parent node
      Specified by:
      setParent in interface ContextualNode
      Parameters:
      node - The parent node
    • getParent

      public ContextualNode getParent()
    • getContext

      public RatingContextDescription getContext(ContextualNode child)
      Description copied from interface: ContextualNode
      Gets the context description for the specified child; The context description contains all the context properties.
      Specified by:
      getContext in interface ContextualNode
      Parameters:
      child - The child node
      Returns:
      The context description
    • inheritedContext

      public RatingContextDescription inheritedContext()
      Description copied from interface: ContextualNode
      Gets the inherited context; The context description contains all the context properties.
      Specified by:
      inheritedContext in interface ContextualNode
      Returns:
      The inherited context
    • 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 name, 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:
      name - The name of tag for the child
      child - The child to be added
    • 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
    • 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