Class Engine.VarCollector
- java.lang.Object
-
- org.apache.commons.jexl3.internal.Engine.VarCollector
-
- Enclosing class:
- Engine
protected static class Engine.VarCollector extends java.lang.ObjectUtility class to collect variables.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intmodeWhether constant array-access is considered equivalent to dot-access; if so, > 1 means collect any constant (set,map,...) instead of just strings and numbers.private java.util.List<java.lang.String>refThe current variable being collected.private java.util.Set<java.util.List<java.lang.String>>refsThe collected variables represented as a set of list of strings.private JexlNoderootThe node that started the collect.
-
Constructor Summary
Constructors Modifier Constructor Description protectedVarCollector(int constaa)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String name)Adds a 'segment' to the variable being collected.voidcollect(JexlNode node)Starts/stops a variable collect.java.util.Set<java.util.List<java.lang.String>>collected()booleanisCollecting()
-
-
-
Field Detail
-
refs
private final java.util.Set<java.util.List<java.lang.String>> refs
The collected variables represented as a set of list of strings.
-
ref
private java.util.List<java.lang.String> ref
The current variable being collected.
-
root
private JexlNode root
The node that started the collect.
-
mode
final int mode
Whether constant array-access is considered equivalent to dot-access; if so, > 1 means collect any constant (set,map,...) instead of just strings and numbers.
-
-
Method Detail
-
add
public void add(java.lang.String name)
Adds a 'segment' to the variable being collected.- Parameters:
name- the name
-
collect
public void collect(JexlNode node)
Starts/stops a variable collect.- Parameters:
node- starts if not null, stop if null
-
collected
public java.util.Set<java.util.List<java.lang.String>> collected()
- Returns:
- the collected variables
-
isCollecting
public boolean isCollecting()
- Returns:
- true if currently collecting a variable, false otherwise
-
-