org.apache.commons.jexl3.parser
Class ASTJexlScript

java.lang.Object
  extended by org.apache.commons.jexl3.parser.SimpleNode
      extended by org.apache.commons.jexl3.parser.JexlNode
          extended by org.apache.commons.jexl3.parser.ASTJexlScript
All Implemented Interfaces:
Node
Direct Known Subclasses:
ASTJexlLambda

public class ASTJexlScript
extends JexlNode

Enhanced script to allow parameters declaration.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.jexl3.parser.JexlNode
JexlNode.Constant<T>
 
Field Summary
 
Fields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id
 
Constructor Summary
ASTJexlScript(int id)
           
ASTJexlScript(Parser p, int id)
           
 
Method Summary
 Scope.Frame createFrame(Object... values)
          Creates an array of arguments by copying values up to the number of parameters.
 int getArgCount()
          Gets the (maximum) number of arguments this script expects.
 String[] getLocalVariables()
          Gets this script local variable, i.e.
 String[] getParameters()
          Gets this script parameters, i.e.
 Map<String,Object> getPragmas()
           
 Scope getScope()
           
 String[] getSymbols()
          Gets this script symbols, i.e.
 boolean isHoistedSymbol(int symbol)
          Checks whether a given symbol is hoisted.
 Object jjtAccept(ParserVisitor visitor, Object data)
          Accept the visitor.
 ASTJexlScript script()
          Consider script with no parameters that return lambda as parametric-scripts.
 void setScope(Scope theScope)
          Sets this script scope.
 boolean toExpression()
          Coerce this script as an expression (ie only one child) if necessary.
 
Methods inherited from class org.apache.commons.jexl3.parser.JexlNode
clearCache, isConstant, isConstant, isLeftValue, jexlInfo, jjtSetFirstToken, jjtSetLastToken
 
Methods inherited from class org.apache.commons.jexl3.parser.SimpleNode
childrenAccept, dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetParent, jjtSetValue, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASTJexlScript

public ASTJexlScript(int id)

ASTJexlScript

public ASTJexlScript(Parser p,
                     int id)
Method Detail

script

public ASTJexlScript script()
Consider script with no parameters that return lambda as parametric-scripts.

Returns:
the script

jjtAccept

public Object jjtAccept(ParserVisitor visitor,
                        Object data)
Description copied from class: SimpleNode
Accept the visitor.

Specified by:
jjtAccept in interface Node
Overrides:
jjtAccept in class SimpleNode
Parameters:
visitor - the visitor
data - contextual data
Returns:
result of visit

toExpression

public boolean toExpression()
Coerce this script as an expression (ie only one child) if necessary.

Returns:
true if the script was coerced, false otherwise

setScope

public void setScope(Scope theScope)
Sets this script scope.

Parameters:
theScope - the scope

getScope

public Scope getScope()
Returns:
this script scope

getPragmas

public Map<String,Object> getPragmas()
Returns:
this script pragmas

createFrame

public Scope.Frame createFrame(Object... values)
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

getSymbols

public String[] getSymbols()
Gets this script symbols, i.e. parameters and local variables.

Returns:
the symbol names

getParameters

public String[] getParameters()
Gets this script parameters, i.e. symbols assigned before creating local variables.

Returns:
the parameter names

getLocalVariables

public String[] getLocalVariables()
Gets this script local variable, i.e. symbols assigned to local variables.

Returns:
the local variable names

isHoistedSymbol

public boolean isHoistedSymbol(int symbol)
Checks whether a given symbol is hoisted.

Parameters:
symbol - the symbol number
Returns:
true if hoisted, false otherwise


Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.