Package com.schibsted.spt.data.jslt.impl
Class ExpressionImpl
java.lang.Object
com.schibsted.spt.data.jslt.impl.ExpressionImpl
- All Implemented Interfaces:
Expression
Wrapper class that translates an external Expression to an
ExpressionNode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ExpressionNode
private JstlFile[]
private LetExpression[]
private int
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionImpl
(LetExpression[] lets, Map<String, Function> functions, ExpressionNode actual) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNode
apply
(com.fasterxml.jackson.databind.JsonNode input) Evaluate the expression on the given JSON input.com.fasterxml.jackson.databind.JsonNode
com.fasterxml.jackson.databind.JsonNode
apply
(Map<String, com.fasterxml.jackson.databind.JsonNode> variables, com.fasterxml.jackson.databind.JsonNode input) Evaluate the expression on the given JSON input, with the given predefined variables set.void
dump()
void
evaluateLetsOnly
(Scope scope, com.fasterxml.jackson.databind.JsonNode input) This is used to initialize global variables when the ExpressionImpl is a module.getFunction
(String name) int
boolean
hasBody()
void
optimize()
void
void
setGlobalModules
(List<JstlFile> fileModules) toString()
-
Field Details
-
lets
-
functions
-
actual
-
stackFrameSize
private int stackFrameSize -
fileModules
-
parameterSlots
-
-
Constructor Details
-
ExpressionImpl
-
-
Method Details
-
getFunction
-
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 interfaceExpression
- 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 interfaceExpression
- 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
-
evaluateLetsOnly
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
-
toString
-
getStackFrameSize
public int getStackFrameSize() -
setGlobalModules
-