Class Evaluator

    • Constructor Detail

      • Evaluator

        public Evaluator()
    • Method Detail

      • evaluate

        public abstract String evaluate​(String expression,
                                        Context context)
        Return a String after processing an expression and a VariableResolver
        Parameters:
        expression - string to be evaluated
        context - instance
        Returns:
        the value of the given expression evaluated using the resolver
        See Also:
        VariableResolver
      • parseParams

        protected List<Object> parseParams​(String expression,
                                           VariableResolver vr)
        Parses a string of expression into separate params. The values are separated by commas. each value will be translated into one of the following: <ol> <li>If it is in single quotes the value will be translated to a String</li> <li>If is is not in quotes and is a number a it will be translated into a Double</li> <li>else it is a variable which can be resolved and it will be put in as an instance of VariableWrapper</li> </ol>
        Parameters:
        expression - the expression to be parsed
        vr - the VariableResolver instance for resolving variables
        Returns:
        a List of objects which can either be a string, number or a variable wrapper