Package com.highdeal.pnr.hci
Class MacroComponentModel
java.lang.Object
com.highdeal.pnr.hci.RateComponentModel
com.highdeal.pnr.hci.MacroComponentModel
- All Implemented Interfaces:
XMLMarshallable,ContextualNode
- Direct Known Subclasses:
InMacroComponentModel,PreMacroComponentModel
This abstract class represents a rate component that
runs a pricing macro.
It defines the pricing macro name and input/output property mapping.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.booleanReturns true if the component is valid.Returns the name of the property in which the amount will be put.Returns an ordered mapping for the macro.getMacro()Returns the pricing macro for this macro component.Gets the code of the macro used in this component.Returns an ordered mapping for the macro.List<com.highdeal.pnr.hci.PropertyReference>Returns the list of the properties that are used in this component.voidsetAmountPropertyName(String name) Sets the amount property name for this component.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidSets the pricing macro for this component.voidSets the code of the macro used in this component.Methods inherited from class com.highdeal.pnr.hci.RateComponentModel
addCharacterData, findRootRateModel, getChildAt, getChildCount, getChildren, getContext, getDescription, getMaxChildCount, getName, getParent, getPropertyNames, inheritedContext, isRemoveChildAllowed, isSetChildAllowed, marshal, remove, removeChild, setChild, setChildren, setDescription, setName, setParent
-
Field Details
-
AMOUNT_PROPERTY_NAME
- See Also:
-
OUT_PROPERTY_MAPPING
- See Also:
-
IN_PROPERTY_MAPPING
- See Also:
-
-
Constructor Details
-
MacroComponentModel
public MacroComponentModel()Constructs a macro component model.
-
-
Method Details
-
getMacro
Returns the pricing macro for this macro component.- Returns:
- the pricing macro for this macro component.
-
setMacro
Sets the pricing macro for this component. When a new macro is set, the previously set mapping is cleared.- Parameters:
r- the pricing macro for this component.
-
getMacroCode
Gets the code of the macro used in this component.- Returns:
- the code of the macro used in this component.
-
setMacroCode
Sets the code of the macro used in this component.- Parameters:
c- the code of the macro used in this component.
-
getAmountPropertyName
Returns the name of the property in which the amount will be put. Note that this applies only when the component is a POST or IN type macro component.- Returns:
- the amount property name.
-
setAmountPropertyName
Sets the amount property name for this component.- Parameters:
name- the name of the amount property.
-
getInMapping
Returns an ordered mapping for the macro.- Returns:
- a vector of
Stringthat represent properties in the rating context.
-
getOutMapping
Returns an ordered mapping for the macro.- Returns:
- a vector of
Stringthat represent properties in the rating context.
-
checkValidity
public boolean checkValidity()Returns true if the component is valid. Component is valid if all the following conditions are met:- The name is not null or empty.
- The component has one and only one child.
- The component has one embedded pricing macro.
- All the in and out properties of the referenced pricing macro have a valid defined mapping.
- Specified by:
checkValidityin classRateComponentModel- Returns:
- true if the component is valid, false otherwise.
-
getPropertyReferences
Description copied from class:RateComponentModelReturns the list of the properties that are used in this component.- Specified by:
getPropertyReferencesin classRateComponentModel- Returns:
- the list of the properties that are used in this component
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Overrides:
setAttributesin classRateComponentModel- 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- Overrides:
addChildin classRateComponentModel- Parameters:
tagName- The name of tag for the childchild- The child to be added
-