Package com.highdeal.pnr.hci
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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String name, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.abstract booleanReturns true if the component is valid.Find the parentRateComponentModel.getChildAt(int index) Gets a child.intGets the child count.Gets the children.getContext(ContextualNode child) Gets the context description for the specified child; The context description contains all the context properties.Gets the description.abstract intGets the maximum child count.getName()Gets the name.Deprecated.abstract List<com.highdeal.pnr.hci.PropertyReference>Returns the list of the properties that are used in this component.Gets the inherited context; The context description contains all the context properties.booleanisRemoveChildAllowed(int index) Test if removing a child at an index is allowed.booleanisSetChildAllowed(int index) Tests if setting a child at an index is allowed.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidremove()Clears the component to remove it.voidremoveChild(int index) Removes a child.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetChild(int index, RateComponentModel component) Sets a child.voidsetChildren(Vector<RateComponentModel> children) Sets the children.voidsetDescription(String description) Sets the description.voidSets the name.voidsetParent(ContextualNode node) Sets the parent node
-
Constructor Details
-
RateComponentModel
public RateComponentModel()Builds an empty RateComponentModel.
-
-
Method Details
-
setName
Sets the name.- Parameters:
name- the name.
-
getName
Gets the name.- Returns:
- the name.
-
setDescription
Sets the description.- Parameters:
description- the description.
-
getDescription
Gets the description.- Returns:
- the description.
-
getChildCount
public int getChildCount()Gets the child count.- Returns:
- the child count.
-
getChildAt
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
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.UsegetPropertyReferences()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
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
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
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
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
Sets the children.- Parameters:
children- a Vector ofRateComponentModelrepresenting the children.
-
findRootRateModel
Find the parentRateComponentModel.- Returns:
- the parent
RateComponentModel
-
getChildren
Gets the children.- Returns:
- a Vector of
RateComponentModelrepresenting the children.
-
setParent
Description copied from interface:ContextualNodeSets the parent node- Specified by:
setParentin interfaceContextualNode- Parameters:
node- The parent node
-
getParent
-
getContext
Description copied from interface:ContextualNodeGets the context description for the specified child; The context description contains all the context properties.- Specified by:
getContextin interfaceContextualNode- Parameters:
child- The child node- Returns:
- The context description
-
inheritedContext
Description copied from interface:ContextualNodeGets the inherited context; The context description contains all the context properties.- Specified by:
inheritedContextin interfaceContextualNode- Returns:
- The inherited context
-
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:
name- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data 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
-
getPropertyReferences()instead, in order to get detailed property descriptions.