Class ExpressionImpl

  • All Implemented Interfaces:
    Expression

    public class ExpressionImpl
    extends java.lang.Object
    implements Expression
    Wrapper class that translates an external Expression to an ExpressionNode.
    • Field Detail

      • functions

        private java.util.Map<java.lang.String,​Function> functions
      • stackFrameSize

        private int stackFrameSize
      • fileModules

        private JstlFile[] fileModules
      • parameterSlots

        private java.util.Map<java.lang.String,​java.lang.Integer> parameterSlots
    • Method Detail

      • getFunction

        public Function getFunction​(java.lang.String name)
      • hasBody

        public boolean hasBody()
      • apply

        public com.fasterxml.jackson.databind.JsonNode apply​(java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.JsonNode> variables,
                                                             com.fasterxml.jackson.databind.JsonNode input)
        Description copied from interface: Expression
        Evaluate the expression on the given JSON input, with the given predefined variables set.
        Specified by:
        apply in interface Expression
        Parameters:
        variables - Variable bindings visible inside the expression.
        input - The JSON input to evaluate the expression on.
      • apply

        public com.fasterxml.jackson.databind.JsonNode apply​(com.fasterxml.jackson.databind.JsonNode input)
        Description copied from interface: Expression
        Evaluate the expression on the given JSON input.
        Specified by:
        apply in interface Expression
        Parameters:
        input - The JSON input to evaluate the expression on.
      • apply

        public com.fasterxml.jackson.databind.JsonNode apply​(Scope scope,
                                                             com.fasterxml.jackson.databind.JsonNode input)
      • dump

        public void dump()
      • evaluateLetsOnly

        public void evaluateLetsOnly​(Scope scope,
                                     com.fasterxml.jackson.databind.JsonNode input)
        This is used to initialize global variables when the ExpressionImpl is a module. Called once during compilation. The values are then remembered forever.
      • optimize

        public void optimize()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getStackFrameSize

        public int getStackFrameSize()
      • setGlobalModules

        public void setGlobalModules​(java.util.List<JstlFile> fileModules)