Class JexlEngine.Scope
java.lang.Object
org.apache.commons.jexl2.JexlEngine.Scope
- Enclosing class:
JexlEngine
A script scope, stores the declaration of parameters and local variables.
- Since:
- 2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFrame(Object... values) Creates a frame by copying values up to the number of parameters.declareVariable(String name) Declares a local variable.booleanbooleanequals(JexlEngine.Scope frame) Whether this frame is equal to another.intGets the (maximum) number of arguments this script expects.String[]Gets this script local variable, i.e.String[]Gets this script parameters, i.e.getRegister(String name) Checks whether an identifier is a local variable or argument, ie stored in a register.String[]Gets this script registers, i.e.inthashCode()
-
Constructor Details
-
Scope
-
-
Method Details
-
hashCode
-
equals
-
equals
Whether this frame is equal to another.- Parameters:
frame- the frame to compare to- Returns:
- true if equal, false otherwise
-
getRegister
Checks whether an identifier is a local variable or argument, ie stored in a register.- Parameters:
name- the register name- Returns:
- the register index
-
declareVariable
Declares a local variable.This method creates an new entry in the named register map.
- Parameters:
name- the variable name- Returns:
- the register index storing this variable
-
createFrame
Creates a frame by copying values up to the number of parameters.- Parameters:
values- the argument values- Returns:
- the arguments array
-
getArgCount
Gets the (maximum) number of arguments this script expects.- Returns:
- the number of parameters
-
getRegisters
Gets this script registers, i.e. parameters and local variables.- Returns:
- the register names
-
getParameters
Gets this script parameters, i.e. registers assigned before creating local variables.- Returns:
- the parameter names
-
getLocalVariables
Gets this script local variable, i.e. registers assigned to local variables.- Returns:
- the parameter names
-