public class TokenPattern
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
REGEXP_TYPE
The regular expression pattern type.
|
static int |
STRING_TYPE
The string pattern type.
|
| Constructor and Description |
|---|
TokenPattern(int id,
java.lang.String name,
int type,
java.lang.String pattern)
Creates a new token pattern.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDebugInfo()
Returns the token debug info message.
|
java.lang.String |
getErrorMessage()
Returns the token error message if the pattern corresponds to
an error token.
|
int |
getId()
Returns the unique token pattern identity value.
|
java.lang.String |
getIgnoreMessage()
Returns the token ignore message if the pattern corresponds to
an ignored token.
|
java.lang.String |
getName()
Returns the token pattern name.
|
java.lang.String |
getPattern()
Returns te token pattern.
|
int |
getType()
Returns the token pattern type.
|
boolean |
isError()
Checks if the pattern corresponds to an error token.
|
boolean |
isIgnore()
Checks if the pattern corresponds to an ignored token.
|
void |
setDebugInfo(java.lang.String info)
Sets the token debug info message.
|
void |
setError()
Sets the token error flag and assigns a default error message.
|
void |
setError(java.lang.String message)
Sets the token error flag and assigns the specified error
message.
|
void |
setIgnore()
Sets the token ignore flag and clears the ignore message.
|
void |
setIgnore(java.lang.String message)
Sets the token ignore flag and assigns the specified ignore
message.
|
java.lang.String |
toShortString()
Returns a short string representation of this object.
|
java.lang.String |
toString()
Returns a detailed string representation of this object.
|
public static final int STRING_TYPE
public static final int REGEXP_TYPE
public TokenPattern(int id,
java.lang.String name,
int type,
java.lang.String pattern)
id - the token pattern idname - the token pattern nametype - the token pattern typepattern - the token patternpublic boolean isError()
public boolean isIgnore()
public int getId()
public java.lang.String getName()
public int getType()
STRING_TYPE,
REGEXP_TYPEpublic java.lang.String getPattern()
public java.lang.String getErrorMessage()
public java.lang.String getIgnoreMessage()
public java.lang.String getDebugInfo()
public void setError()
public void setError(java.lang.String message)
message - the error message to displaypublic void setIgnore()
public void setIgnore(java.lang.String message)
message - the ignore message to displaypublic void setDebugInfo(java.lang.String info)
info - the token debug info messagepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toShortString()