ExpressionTokenizer (Apache Tomcat 10.1.2 API Documentation)

Package org.apache.catalina.ssi

## Class ExpressionTokenizer

- java.lang.Object
- - org.apache.catalina.ssi.ExpressionTokenizer

-     public class ExpressionTokenizer
      extends Object

  Parses an expression string to return the individual tokens. This is patterned similar to the StreamTokenizer in the JDK but customized for SSI conditional expression parsing.
  Author:
    Paul Speed

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `TOKEN_AND` |
    `static int` | `TOKEN_END` |
    `static int` | `TOKEN_EQ` |
    `static int` | `TOKEN_GE` |
    `static int` | `TOKEN_GT` |
    `static int` | `TOKEN_LBRACE` |
    `static int` | `TOKEN_LE` |
    `static int` | `TOKEN_LT` |
    `static int` | `TOKEN_NOT` |
    `static int` | `TOKEN_NOT_EQ` |
    `static int` | `TOKEN_OR` |
    `static int` | `TOKEN_RBRACE` |
    `static int` | `TOKEN_STRING` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExpressionTokenizer​(String expr)` | Creates a new parser for the specified expression.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getIndex()` |
    `String` | `getTokenValue()` |
    `boolean` | `hasMoreTokens()` |
    `protected boolean` | `isMetaChar​(char c)` |
    `int` | `nextToken()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TOKEN_STRING

          public static final int TOKEN_STRING

      See Also:
        Constant Field Values

    - #### TOKEN_AND

          public static final int TOKEN_AND

      See Also:
        Constant Field Values

    - #### TOKEN_OR

          public static final int TOKEN_OR

      See Also:
        Constant Field Values

    - #### TOKEN_NOT

          public static final int TOKEN_NOT

      See Also:
        Constant Field Values

    - #### TOKEN_EQ

          public static final int TOKEN_EQ

      See Also:
        Constant Field Values

    - #### TOKEN_NOT_EQ

          public static final int TOKEN_NOT_EQ

      See Also:
        Constant Field Values

    - #### TOKEN_RBRACE

          public static final int TOKEN_RBRACE

      See Also:
        Constant Field Values

    - #### TOKEN_LBRACE

          public static final int TOKEN_LBRACE

      See Also:
        Constant Field Values

    - #### TOKEN_GE

          public static final int TOKEN_GE

      See Also:
        Constant Field Values

    - #### TOKEN_LE

          public static final int TOKEN_LE

      See Also:
        Constant Field Values

    - #### TOKEN_GT

          public static final int TOKEN_GT

      See Also:
        Constant Field Values

    - #### TOKEN_LT

          public static final int TOKEN_LT

      See Also:
        Constant Field Values

    - #### TOKEN_END

          public static final int TOKEN_END

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ExpressionTokenizer

          public ExpressionTokenizer​(String expr)

      Creates a new parser for the specified expression.
      Parameters:
        `expr` - The expression

  - ### Method Detail

    - #### hasMoreTokens

          public boolean hasMoreTokens()

      Returns:
        `true` if there are more tokens.

    - #### getIndex

          public int getIndex()

      Returns:
        the current index for error reporting purposes.

    - #### isMetaChar

          protected boolean isMetaChar​(char c)

    - #### nextToken

          public int nextToken()

      Returns:
        the next token type and initializes any state variables accordingly.

    - #### getTokenValue

          public String getTokenValue()

      Returns:
        the String value of the token if it was type TOKEN_STRING. Otherwise null is returned.