Class ExpressionTokenizer


  • public class ExpressionTokenizer
    extends java.lang.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
    • Constructor Detail

      • ExpressionTokenizer

        public ExpressionTokenizer​(java.lang.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 java.lang.String getTokenValue()
        Returns:
        the String value of the token if it was type TOKEN_STRING. Otherwise null is returned.