public class FunctionDeclaration extends AbstractNode implements Function, ExpressionNode
location| Constructor and Description |
|---|
FunctionDeclaration(java.lang.String name,
java.lang.String[] parameters,
LetExpression[] lets,
ExpressionNode body) |
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
apply(Scope scope,
com.fasterxml.jackson.databind.JsonNode context) |
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 |
getMaxArguments()
The maximum number of arguments allowed.
|
int |
getMinArguments()
The minimum number of arguments allowed.
|
java.lang.String |
getName()
The name of the function.
|
ExpressionNode |
optimize() |
void |
prepare(PreparationContext ctx) |
dump, getChildren, getLocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdump, getChildrenpublic FunctionDeclaration(java.lang.String name,
java.lang.String[] parameters,
LetExpression[] lets,
ExpressionNode body)
public java.lang.String getName()
Functionpublic int getMinArguments()
FunctiongetMinArguments in interface CallablegetMinArguments in interface Functionpublic int getMaxArguments()
FunctiongetMaxArguments in interface CallablegetMaxArguments in interface Functionpublic com.fasterxml.jackson.databind.JsonNode call(com.fasterxml.jackson.databind.JsonNode input,
com.fasterxml.jackson.databind.JsonNode[] arguments)
Functionpublic com.fasterxml.jackson.databind.JsonNode call(Scope scope, com.fasterxml.jackson.databind.JsonNode input, com.fasterxml.jackson.databind.JsonNode[] arguments)
public ExpressionNode optimize()
optimize in interface ExpressionNodeoptimize in class AbstractNodepublic com.fasterxml.jackson.databind.JsonNode apply(Scope scope, com.fasterxml.jackson.databind.JsonNode context)
apply in interface ExpressionNodepublic void computeMatchContexts(DotExpression parent)
computeMatchContexts in interface ExpressionNodecomputeMatchContexts in class AbstractNodepublic void prepare(PreparationContext ctx)
prepare in interface ExpressionNodeprepare in class AbstractNode