Class ExpressionTokenizer
java.lang.Object
org.apache.catalina.ssi.ExpressionTokenizer
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
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionExpressionTokenizer
(String expr) Creates a new parser for the specified expression. -
Method Summary
Modifier and TypeMethodDescriptionint
getIndex()
boolean
protected boolean
isMetaChar
(char c) int
-
Field Details
-
TOKEN_STRING
public static final int TOKEN_STRING- See Also:
-
TOKEN_AND
public static final int TOKEN_AND- See Also:
-
TOKEN_OR
public static final int TOKEN_OR- See Also:
-
TOKEN_NOT
public static final int TOKEN_NOT- See Also:
-
TOKEN_EQ
public static final int TOKEN_EQ- See Also:
-
TOKEN_NOT_EQ
public static final int TOKEN_NOT_EQ- See Also:
-
TOKEN_RBRACE
public static final int TOKEN_RBRACE- See Also:
-
TOKEN_LBRACE
public static final int TOKEN_LBRACE- See Also:
-
TOKEN_GE
public static final int TOKEN_GE- See Also:
-
TOKEN_LE
public static final int TOKEN_LE- See Also:
-
TOKEN_GT
public static final int TOKEN_GT- See Also:
-
TOKEN_LT
public static final int TOKEN_LT- See Also:
-
TOKEN_END
public static final int TOKEN_END- See Also:
-
-
Constructor Details
-
ExpressionTokenizer
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
- Returns:
- the String value of the token if it was type TOKEN_STRING. Otherwise null is returned.
-