org.apache.catalina.ssi
Class ExpressionTokenizer
java.lang.Object
|
+--org.apache.catalina.ssi.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.
- Version:
- $Revision: 466595 $
- Author:
- Paul Speed
Constructor Summary |
ExpressionTokenizer(java.lang.String expr)
Creates a new parser for the specified expression. |
Method Summary |
int |
getIndex()
Returns the current index for error reporting purposes. |
java.lang.String |
getTokenValue()
Returns the String value of the token if it was type
TOKEN_STRING. |
boolean |
hasMoreTokens()
Returns true if there are more tokens. |
protected boolean |
isMetaChar(char c)
|
int |
nextToken()
Returns the next token type and initializes any
state variables accordingly. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TOKEN_STRING
public static final int TOKEN_STRING
TOKEN_AND
public static final int TOKEN_AND
TOKEN_OR
public static final int TOKEN_OR
TOKEN_NOT
public static final int TOKEN_NOT
TOKEN_EQ
public static final int TOKEN_EQ
TOKEN_NOT_EQ
public static final int TOKEN_NOT_EQ
TOKEN_RBRACE
public static final int TOKEN_RBRACE
TOKEN_LBRACE
public static final int TOKEN_LBRACE
TOKEN_GE
public static final int TOKEN_GE
TOKEN_LE
public static final int TOKEN_LE
TOKEN_GT
public static final int TOKEN_GT
TOKEN_LT
public static final int TOKEN_LT
TOKEN_END
public static final int TOKEN_END
ExpressionTokenizer
public ExpressionTokenizer(java.lang.String expr)
- Creates a new parser for the specified expression.
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.
Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.