Package com.highdeal.pnr.hci
Class UsageRateModel
java.lang.Object
com.highdeal.pnr.hci.RateModel
com.highdeal.pnr.hci.UsageRateModel
- All Implemented Interfaces:
IXMLMarshallable,XMLMarshallable,ContextualNode
This class represents an usage rate.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="usage">
<xs:complexType>
<xs:sequence>
<xs:element ref="component" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="ciName" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
</xs:complexType>
</xs:element>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets available chargeable item names.booleanReturns true if the Usage Rate is valid.Gets the chargeable item name.getContext(ContextualNode child) Gets the context for the specified child.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.voidsetChargeableItemName(String name) Sets the chargeable item name.Methods inherited from class com.highdeal.pnr.hci.RateModel
addCharacterData, addChild, getDescription, getName, getParent, getRateComponent, inheritedContext, marshalAttributes, marshalChildren, remove, setDescription, setName, setParent, setRateComponent
-
Field Details
-
TAG_NAME
The value of that constant is the XML tag name of the usage rate.- See Also:
-
ANY_CI_NAME
Constant for any chargeable item.- See Also:
-
-
Constructor Details
-
UsageRateModel
public UsageRateModel()
-
-
Method Details
-
setChargeableItemName
Sets the chargeable item name.- Parameters:
name- the chargeable item name.
-
getChargeableItemName
Gets the chargeable item name.- Returns:
- the chargeable item name.
-
checkValidity
public boolean checkValidity()Returns true if the Usage Rate is valid. Usage rate is valid if all the following conditions are met:- The RateModel.checkValidity() returned true.
- The Chargeable item is not null or empty
- The Chargeable item is valid in the context.
- Overrides:
checkValidityin classRateModel- Returns:
- true if the usage rate is valid, false otherwise.
-
getContext
Gets the context for the specified child.- Parameters:
child- the child node- Returns:
- the context.
-
availableCINames
Gets available chargeable item names.- Returns:
- a list of
QualifiedChargeableItemDescriptioncontaining all chargeable item names.
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Overrides:
setAttributesin classRateModel- Parameters:
atts- TheXML attributesof the current element
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceIXMLMarshallable- Specified by:
marshalin interfaceXMLMarshallable- Overrides:
marshalin classRateModel- Parameters:
output- TheXML outputto marshal the object into
-