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 ExpressionNode
private LetExpression[]
private String
private String[]
private int[]
private int
Fields 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.JsonNode
com.fasterxml.jackson.databind.JsonNode
call
(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.JsonNode
call
(Scope scope, com.fasterxml.jackson.databind.JsonNode input, com.fasterxml.jackson.databind.JsonNode[] arguments) void
computeMatchContexts
(DotExpression parent) int
The maximum number of arguments allowed.int
The minimum number of arguments allowed.getName()
The name of the function.optimize()
void
Methods inherited from class com.schibsted.spt.data.jslt.impl.AbstractNode
dump, getChildren, getLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Function
The name of the function. -
getMinArguments
public int getMinArguments()Description copied from interface:Function
The minimum number of arguments allowed.- Specified by:
getMinArguments
in interfaceCallable
- Specified by:
getMinArguments
in interfaceFunction
-
getMaxArguments
public int getMaxArguments()Description copied from interface:Function
The maximum number of arguments allowed.- Specified by:
getMaxArguments
in interfaceCallable
- Specified by:
getMaxArguments
in 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:Function
Perform 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:
optimize
in interfaceExpressionNode
- Overrides:
optimize
in classAbstractNode
-
apply
public com.fasterxml.jackson.databind.JsonNode apply(Scope scope, com.fasterxml.jackson.databind.JsonNode context) - Specified by:
apply
in interfaceExpressionNode
-
computeMatchContexts
- Specified by:
computeMatchContexts
in interfaceExpressionNode
- Overrides:
computeMatchContexts
in classAbstractNode
-
prepare
- Specified by:
prepare
in interfaceExpressionNode
- Overrides:
prepare
in classAbstractNode
-