Class ExpressionImpl

java.lang.Object
com.schibsted.spt.data.jslt.impl.ExpressionImpl
All Implemented Interfaces:
Expression

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

  • Constructor Details

  • Method Details

    • getFunction

      public Function getFunction(String name)
    • hasBody

      public boolean hasBody()
    • apply

      public com.fasterxml.jackson.databind.JsonNode apply(Map<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()
    • prepare

      public void prepare(PreparationContext ctx)
    • 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()
    • getChildren

      public List<ExpressionNode> getChildren()
    • toString

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

      public int getStackFrameSize()
    • setGlobalModules

      public void setGlobalModules(List<JstlFile> fileModules)