Class AbstractFormulaEvaluator

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractFormulaEvaluator​(java.lang.Object object, java.util.Map<java.lang.String,​java.lang.String> nameToExpressionMap)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object evaluate​(java.lang.String formularName, java.lang.Object... parameters)
      Evaluates a formula that was added through the builder
      protected abstract java.lang.Object evaluateInternal​(java.lang.String formularName, java.lang.Object... parameters)
      This method evaluates the formula with the given name and the specified parameters.
      java.util.Map<java.lang.String,​java.lang.String> getNameToExpressionMap()
      Returns a defensive copy of the map of expressions/formulas held by this evaluator.
      java.lang.Object getObject()
      Returns the product component generation or product component this is an evaluator for.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMPILED_EXPRESSION_XML_TAG

        public static final java.lang.String COMPILED_EXPRESSION_XML_TAG
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractFormulaEvaluator

        public AbstractFormulaEvaluator​(java.lang.Object object,
                                        java.util.Map<java.lang.String,​java.lang.String> nameToExpressionMap)
    • Method Detail

      • getObject

        public java.lang.Object getObject()
        Description copied from interface: IFormulaEvaluator
        Returns the product component generation or product component this is an evaluator for.
        Specified by:
        getObject in interface IFormulaEvaluator
      • evaluate

        public java.lang.Object evaluate​(java.lang.String formularName,
                                         java.lang.Object... parameters)
        Evaluates a formula that was added through the builder
        Specified by:
        evaluate in interface IFormulaEvaluator
        Parameters:
        formularName - The name of the formula to evaluate
        parameters - the parameters the formula requires when being evaluated
        Returns:
        the result of the evaluated formula
        Throws:
        java.lang.IllegalArgumentException - if the formula signature is unknown
      • evaluateInternal

        protected abstract java.lang.Object evaluateInternal​(java.lang.String formularName,
                                                             java.lang.Object... parameters)
                                                      throws java.lang.Exception
        This method evaluates the formula with the given name and the specified parameters. With the name and parameters you have the complete formula method signature. The order of the parameters is given by the formula signature.
        Parameters:
        formularName - name of the formula to evaluate
        parameters - the parameters to evaluate the formula
        Returns:
        the return value of the evaluated formula
        Throws:
        java.lang.Exception
      • getNameToExpressionMap

        public java.util.Map<java.lang.String,​java.lang.String> getNameToExpressionMap()
        Returns a defensive copy of the map of expressions/formulas held by this evaluator.
        Specified by:
        getNameToExpressionMap in interface IFormulaEvaluator
        Returns:
        a map containing the expressions (with their names as keys) held by this formula evaluator