Class Engine.VarCollector

  • Enclosing class:
    Engine

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

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String name)
      Adds a 'segment' to the variable being collected.
      void collect​(JexlNode node)
      Starts/stops a variable collect.
      java.util.Set<java.util.List<java.lang.String>> collected()  
      boolean isCollecting()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • VarCollector

        protected VarCollector​(int constaa)
        Constructs a new instance.
        Parameters:
        constaa - whether constant array-access is considered equivalent to dot-access
    • 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