Package com.schibsted.spt.data.jslt.impl
Class FunctionDeclaration
java.lang.Object
com.schibsted.spt.data.jslt.impl.AbstractNode
com.schibsted.spt.data.jslt.impl.FunctionDeclaration
- All Implemented Interfaces:
Callable,Function,ExpressionNode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ExpressionNodeprivate LetExpression[]private Stringprivate String[]private int[]private intFields inherited from class com.schibsted.spt.data.jslt.impl.AbstractNode
location -
Constructor Summary
ConstructorsConstructorDescriptionFunctionDeclaration(String name, String[] parameters, LetExpression[] lets, ExpressionNode body) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodecall(com.fasterxml.jackson.databind.JsonNode input, com.fasterxml.jackson.databind.JsonNode[] arguments) Perform the function on the given JSON input with the given arguments.com.fasterxml.jackson.databind.JsonNodecall(Scope scope, com.fasterxml.jackson.databind.JsonNode input, com.fasterxml.jackson.databind.JsonNode[] arguments) voidcomputeMatchContexts(DotExpression parent) intThe maximum number of arguments allowed.intThe minimum number of arguments allowed.getName()The name of the function.optimize()voidMethods inherited from class com.schibsted.spt.data.jslt.impl.AbstractNode
dump, getChildren, getLocationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.schibsted.spt.data.jslt.impl.ExpressionNode
dump, getChildren
-
Field Details
-
name
-
parameters
-
parameterSlots
private int[] parameterSlots -
lets
-
body
-
stackFrameSize
private int stackFrameSize
-
-
Constructor Details
-
FunctionDeclaration
public FunctionDeclaration(String name, String[] parameters, LetExpression[] lets, ExpressionNode body)
-
-
Method Details
-
getName
Description copied from interface:FunctionThe name of the function. -
getMinArguments
public int getMinArguments()Description copied from interface:FunctionThe minimum number of arguments allowed.- Specified by:
getMinArgumentsin interfaceCallable- Specified by:
getMinArgumentsin interfaceFunction
-
getMaxArguments
public int getMaxArguments()Description copied from interface:FunctionThe maximum number of arguments allowed.- Specified by:
getMaxArgumentsin interfaceCallable- Specified by:
getMaxArgumentsin interfaceFunction
-
call
public com.fasterxml.jackson.databind.JsonNode call(com.fasterxml.jackson.databind.JsonNode input, com.fasterxml.jackson.databind.JsonNode[] arguments) Description copied from interface:FunctionPerform the function on the given JSON input with the given arguments. -
call
public com.fasterxml.jackson.databind.JsonNode call(Scope scope, com.fasterxml.jackson.databind.JsonNode input, com.fasterxml.jackson.databind.JsonNode[] arguments) -
optimize
- Specified by:
optimizein interfaceExpressionNode- Overrides:
optimizein classAbstractNode
-
apply
public com.fasterxml.jackson.databind.JsonNode apply(Scope scope, com.fasterxml.jackson.databind.JsonNode context) - Specified by:
applyin interfaceExpressionNode
-
computeMatchContexts
- Specified by:
computeMatchContextsin interfaceExpressionNode- Overrides:
computeMatchContextsin classAbstractNode
-
prepare
- Specified by:
preparein interfaceExpressionNode- Overrides:
preparein classAbstractNode
-