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 Details

  • Constructor Details

    • ExpressionTokenizer

      public ExpressionTokenizer(String expr)
      Creates a new parser for the specified expression.
      Parameters:
      expr - The expression
  • Method Details

    • 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.