Class VariableContext


  • public class VariableContext
    extends java.lang.Object
    A helper to parse the context of a variable name, which is the base variable, followed by the sequence of array (integer or string indexed) and member accesses.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  VariableContext.Type
      Represents what a piece of a variable does.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int integer
      The integer value for this piece of the variable.
      java.lang.String text
      The text of this piece of the variable.
      VariableContext.Type type
      The type of this piece of a variable.
    • Constructor Detail

    • Method Detail

      • parse

        public static final VariableContext[] parse​(java.lang.String variable)
        Parses a normalized javascript variable. All strings in the variable should be single quoted, and no spaces (except possibly within strings).
      • addMember

        private static int addMember​(char[] text,
                                     int i,
                                     java.util.List<VariableContext> contexts)
      • addStringIndex

        private static int addStringIndex​(char[] text,
                                          int i,
                                          java.util.List<VariableContext> contexts)
      • addIntIndex

        private static int addIntIndex​(char[] text,
                                       int i,
                                       java.util.List<VariableContext> contexts)