Package org.apache.commons.jexl3.parser
Class ASTJexlScript
java.lang.Object
org.apache.commons.jexl3.parser.SimpleNode
org.apache.commons.jexl3.parser.JexlNode
org.apache.commons.jexl3.parser.JexlLexicalNode
org.apache.commons.jexl3.parser.ASTJexlScript
- All Implemented Interfaces:
JexlParser.LexicalUnit
,Node
- Direct Known Subclasses:
ASTJexlLambda
Enhanced script to allow parameters declaration.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jexl3.parser.JexlNode
JexlNode.Constant<T>, JexlNode.Funcall, JexlNode.Info
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JexlFeatures
Features.The pragmas.private Scope
The script scope.private static final long
Serial uid.Fields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFrame
(Object... values) Creates an array of arguments by copying values up to the number of parameters.createFrame
(Frame caller, Object... values) Creates an array of arguments by copying values up to the number of parameters.int
Gets the (maximum) number of arguments this script expects.String[]
Gets this script captured variable, i.e.String[]
Gets this script local variable, i.e.String[]
Gets this script parameters, i.e.getScope()
String[]
Gets this script symbols, i.e.boolean
isCapturedSymbol
(int symbol) Checks whether a given symbol is captured.jjtAccept
(ParserVisitor visitor, Object data) Accepts the visitor.script()
Consider script with no parameters that return lambda as parametric-scripts.void
setFeatures
(JexlFeatures theFeatures) Sets this script features.void
setPragmas
(Map<String, Object> thePragmas) Sets this script pragmas.void
Sets this script scope.Methods inherited from class org.apache.commons.jexl3.parser.JexlLexicalNode
declareSymbol, getLexicalScope, getSymbolCount, hasSymbol, isConstant, jjtClose, setConstant
Methods inherited from class org.apache.commons.jexl3.parser.JexlNode
clearCache, getColumn, getLine, isConstant, isConstant, isGlobalVar, isLeftValue, isSafeLhs, isStrictOperator, jexlInfo, jjtSetFirstToken, jjtSetLastToken
Methods inherited from class org.apache.commons.jexl3.parser.SimpleNode
childrenAccept, dump, dumpOut, getId, jjtAddChild, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetChildren, jjtSetParent, jjtSetValue, toString, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial uid.- See Also:
-
pragmas
The pragmas. -
features
Features. -
scope
The script scope.
-
-
Constructor Details
-
ASTJexlScript
public ASTJexlScript(int id) -
ASTJexlScript
-
-
Method Details
-
createFrame
Creates an array of arguments by copying values up to the number of parameters.- Parameters:
caller
- the calling framevalues
- the argument values- Returns:
- the arguments array
-
createFrame
Creates an array of arguments by copying values up to the number of parameters.- Parameters:
values
- the argument values- Returns:
- the arguments array
-
getArgCount
public int getArgCount()Gets the (maximum) number of arguments this script expects.- Returns:
- the number of parameters
-
getCapturedVariables
Gets this script captured variable, i.e. symbols captured from outer scopes.- Returns:
- the captured variable names
-
getFeatures
- Returns:
- this script scope
-
getLocalVariables
Gets this script local variable, i.e. symbols assigned to local variables.- Returns:
- the local variable names
-
getParameters
Gets this script parameters, i.e. symbols assigned before creating local variables.- Returns:
- the parameter names
-
getPragmas
- Returns:
- this script pragmas.
-
getScope
- Returns:
- this script scope
-
getSymbols
Gets this script symbols, i.e. parameters and local variables.- Returns:
- the symbol names
-
isCapturedSymbol
public boolean isCapturedSymbol(int symbol) Checks whether a given symbol is captured.- Parameters:
symbol
- the symbol number- Returns:
- true if captured, false otherwise
-
jjtAccept
Description copied from class:SimpleNode
Accepts the visitor.- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classSimpleNode
- Parameters:
visitor
- the visitordata
- contextual data- Returns:
- result of visit
-
script
Consider script with no parameters that return lambda as parametric-scripts.- Returns:
- the script
-
setFeatures
Sets this script features.- Parameters:
theFeatures
- the features
-
setPragmas
Sets this script pragmas.- Parameters:
thePragmas
- the pragmas
-
setScope
Sets this script scope.- Parameters:
theScope
- the scope
-