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
public class FunctionDeclaration extends AbstractNode implements Function, ExpressionNode
-
-
Field Summary
Fields Modifier and Type Field Description private ExpressionNodebodyprivate LetExpression[]letsprivate java.lang.Stringnameprivate java.lang.String[]parametersprivate int[]parameterSlotsprivate intstackFrameSize-
Fields inherited from class com.schibsted.spt.data.jslt.impl.AbstractNode
location
-
-
Constructor Summary
Constructors Constructor Description FunctionDeclaration(java.lang.String name, java.lang.String[] parameters, LetExpression[] lets, ExpressionNode body)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodeapply(Scope scope, com.fasterxml.jackson.databind.JsonNode context)com.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)intgetMaxArguments()The maximum number of arguments allowed.intgetMinArguments()The minimum number of arguments allowed.java.lang.StringgetName()The name of the function.ExpressionNodeoptimize()voidprepare(PreparationContext ctx)-
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 Detail
-
name
private java.lang.String name
-
parameters
private java.lang.String[] parameters
-
parameterSlots
private int[] parameterSlots
-
lets
private LetExpression[] lets
-
body
private ExpressionNode body
-
stackFrameSize
private int stackFrameSize
-
-
Constructor Detail
-
FunctionDeclaration
public FunctionDeclaration(java.lang.String name, java.lang.String[] parameters, LetExpression[] lets, ExpressionNode body)
-
-
Method Detail
-
getName
public java.lang.String 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
public ExpressionNode 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
public void computeMatchContexts(DotExpression parent)
- Specified by:
computeMatchContextsin interfaceExpressionNode- Overrides:
computeMatchContextsin classAbstractNode
-
prepare
public void prepare(PreparationContext ctx)
- Specified by:
preparein interfaceExpressionNode- Overrides:
preparein classAbstractNode
-
-