Package com.highdeal.pnr.hci
Class PreMacroComponentModel
java.lang.Object
com.highdeal.pnr.hci.RateComponentModel
com.highdeal.pnr.hci.MacroComponentModel
com.highdeal.pnr.hci.PreMacroComponentModel
- All Implemented Interfaces:
XMLMarshallable,ContextualNode
This class represents a rate component which
runs a pricing macro as a pre-component.
-
Field Summary
Fields inherited from class com.highdeal.pnr.hci.MacroComponentModel
AMOUNT_PROPERTY_NAME, IN_PROPERTY_MAPPING, OUT_PROPERTY_MAPPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the component is valid.getContext(ContextualNode child) Returns the rating context description of this component.intReturns the maximum number of children for this component, that is 1.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.Methods inherited from class com.highdeal.pnr.hci.MacroComponentModel
addChild, getAmountPropertyName, getInMapping, getMacro, getMacroCode, getOutMapping, getPropertyReferences, setAmountPropertyName, setAttributes, setMacro, setMacroCodeMethods inherited from class com.highdeal.pnr.hci.RateComponentModel
addCharacterData, findRootRateModel, getChildAt, getChildCount, getChildren, getDescription, getName, getParent, getPropertyNames, inheritedContext, isRemoveChildAllowed, isSetChildAllowed, remove, removeChild, setChild, setChildren, setDescription, setName, setParent
-
Constructor Details
-
PreMacroComponentModel
public PreMacroComponentModel()
-
-
Method Details
-
getMaxChildCount
public int getMaxChildCount()Returns the maximum number of children for this component, that is 1.- Specified by:
getMaxChildCountin classRateComponentModel- Returns:
- 1
-
checkValidity
public boolean checkValidity()Description copied from class:MacroComponentModelReturns 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.
- Overrides:
checkValidityin classMacroComponentModel- Returns:
- true if the component is valid, false otherwise.
-
getContext
Returns the rating context description of this component. For a pre macro component, the rating context description includes the mapping of the out properties of the embedded pricing macro.- Specified by:
getContextin interfaceContextualNode- Overrides:
getContextin classRateComponentModel- Parameters:
child- The child node- Returns:
- the rating context description.
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Overrides:
marshalin classRateComponentModel- Parameters:
output- TheXML outputto marshal the object into
-