Class PreMacroComponentModel

All Implemented Interfaces:
XMLMarshallable, ContextualNode

public class PreMacroComponentModel extends MacroComponentModel
This class represents a rate component which runs a pricing macro as a pre-component.
  • 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:
      getMaxChildCount in class RateComponentModel
      Returns:
      1
    • checkValidity

      public boolean checkValidity()
      Description copied from class: MacroComponentModel
      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.
      Overrides:
      checkValidity in class MacroComponentModel
      Returns:
      true if the component is valid, false otherwise.
    • getContext

      public RatingContextDescription getContext(ContextualNode child)
      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:
      getContext in interface ContextualNode
      Overrides:
      getContext in class RateComponentModel
      Parameters:
      child - The child node
      Returns:
      the rating context description.
    • marshal

      public void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface XMLMarshallable
      Overrides:
      marshal in class RateComponentModel
      Parameters:
      output - The XML output to marshal the object into