com.highdeal.pnr.hci
Class MacroComponentModel

java.lang.Object
  extended by com.highdeal.pnr.hci.RateComponentModel
      extended by com.highdeal.pnr.hci.MacroComponentModel
All Implemented Interfaces:
XMLMarshallable, ContextualNode
Direct Known Subclasses:
InMacroComponentModel, PreMacroComponentModel

public abstract class MacroComponentModel
extends RateComponentModel

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
protected  java.lang.String amountPropertyName
           
protected  java.util.Vector<java.lang.String> inMapping
           
protected  PricingMacroModel macro
           
protected  java.lang.String macroCode
           
protected  java.util.Vector<java.lang.String> outMapping
           
 
Fields inherited from class com.highdeal.pnr.hci.RateComponentModel
children, description, name, parent
 
Constructor Summary
MacroComponentModel()
          Constructs a macro component model.
 
Method Summary
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 boolean checkValidity()
          Returns true if the component is valid.
 java.lang.String getAmountPropertyName()
          Returns the name of the property in which the amount will be put.
 java.util.Vector<java.lang.String> getInMapping()
          Returns an ordered mapping for the macro.
 PricingMacroModel getMacro()
          Returns the pricing macro for this macro component.
 java.lang.String getMacroCode()
          Gets the code of the macro used in this component.
 java.util.Vector<java.lang.String> getOutMapping()
          Returns an ordered mapping for the macro.
protected  void marshallElements(XMLOutputter output)
           
 void setAmountPropertyName(java.lang.String name)
          Sets the amount property name for this component.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setMacro(PricingMacroModel r)
          Sets the pricing macro for this component.
 void setMacroCode(java.lang.String c)
          Sets the code of the macro used in this component.
 
Methods inherited from class com.highdeal.pnr.hci.RateComponentModel
addCharacterData, getChildAt, getChildCount, getChildren, getContext, getDescription, getMaxChildCount, getName, getParent, inheritedContext, isRemoveChildAllowed, isSetChildAllowed, marshal, marshallChildren, remove, removeChild, setChild, setChild, setChildren, setDescription, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amountPropertyName

protected java.lang.String amountPropertyName

macroCode

protected java.lang.String macroCode

macro

protected PricingMacroModel macro

inMapping

protected java.util.Vector<java.lang.String> inMapping

outMapping

protected java.util.Vector<java.lang.String> outMapping
Constructor Detail

MacroComponentModel

public MacroComponentModel()
Constructs a macro component model.

Method Detail

getMacro

public PricingMacroModel getMacro()
Returns the pricing macro for this macro component.

Returns:
the pricing macro for this macro component.

setMacro

public void setMacro(PricingMacroModel r)
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

public java.lang.String getMacroCode()
Gets the code of the macro used in this component.

Returns:
the code of the macro used in this component.

setMacroCode

public void setMacroCode(java.lang.String c)
Sets the code of the macro used in this component.

Parameters:
c - the code of the macro used in this component.

getAmountPropertyName

public java.lang.String 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

public void setAmountPropertyName(java.lang.String name)
Sets the amount property name for this component.

Parameters:
name - the name of the amount property.

getInMapping

public java.util.Vector<java.lang.String> getInMapping()
Returns an ordered mapping for the macro.

Returns:
a vector of String that represent properties in the rating context.

getOutMapping

public java.util.Vector<java.lang.String> getOutMapping()
Returns an ordered mapping for the macro.

Returns:
a vector of String that 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:

Specified by:
checkValidity in class RateComponentModel
Returns:
true if the component is valid, false otherwise.

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
Overrides:
setAttributes in class RateComponentModel
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String tagName,
                     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
Overrides:
addChild in class RateComponentModel
Parameters:
tagName - The name of tag for the child
child - The child to be added

marshallElements

protected void marshallElements(XMLOutputter output)

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)