Class Engine.VarCollector

java.lang.Object
org.apache.commons.jexl3.internal.Engine.VarCollector
Enclosing class:
Engine

protected static class Engine.VarCollector extends Object
Utility class to collect variables.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final int
    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.
    private List<String>
    The current variable being collected.
    private final Set<List<String>>
    The collected variables represented as a set of list of strings.
    private JexlNode
    The node that started the collect.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    VarCollector(int constaa)
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String name)
    Adds a 'segment' to the variable being collected.
    void
    Starts/stops a variable collect.
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • refs

      private final Set<List<String>> refs
      The collected variables represented as a set of list of strings.
    • ref

      private List<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.
  • Constructor Details

    • VarCollector

      protected VarCollector(int constaa)
      Constructs a new instance.
      Parameters:
      constaa - whether constant array-access is considered equivalent to dot-access
  • Method Details

    • add

      public void add(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 Set<List<String>> collected()
      Returns:
      the collected variables
    • isCollecting

      public boolean isCollecting()
      Returns:
      true if currently collecting a variable, false otherwise