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 ExpressionNodeprivate JstlFile[]private LetExpression[]private int -
Constructor Summary
ConstructorsConstructorDescriptionExpressionImpl(LetExpression[] lets, Map<String, Function> functions, ExpressionNode actual) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeapply(com.fasterxml.jackson.databind.JsonNode input) Evaluate the expression on the given JSON input.com.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodeapply(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.voiddump()voidevaluateLetsOnly(Scope scope, com.fasterxml.jackson.databind.JsonNode input) This is used to initialize global variables when the ExpressionImpl is a module.getFunction(String name) intbooleanhasBody()voidoptimize()voidvoidsetGlobalModules(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:ExpressionEvaluate the expression on the given JSON input, with the given predefined variables set.- Specified by:
applyin 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:ExpressionEvaluate the expression on the given JSON input.- Specified by:
applyin 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
-