Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static TokenRegex |
get(java.lang.String expr)
Create a token for the specified regular expression.
|
static TokenRegex |
get(java.lang.String expr,
java.util.Collection<ParserAttribute> attributes)
Create a token for the specified regular expression (with attributes)
|
static TokenRegex |
get(java.lang.String expr,
ParserAttribute attribute)
Create a token for the specified regular expression (with an attribute)
|
java.lang.String |
getValue()
Get the regular expression.
|
int |
hashCode() |
java.lang.String |
matches(java.lang.String input) |
boolean |
matches(Token input)
Does this token match the input token?
|
java.lang.String |
toString() |
addAttribute, addAttributes, getAttribute, getAttributes, getAttributesMap, getAttributeValue, hasAttribute
public static TokenRegex get(java.lang.String expr)
expr
- the expressionpublic static TokenRegex get(java.lang.String expr, ParserAttribute attribute)
expr
- the expressionattribute
- the attributejava.lang.NullPointerException
- if the attribute is nullpublic static TokenRegex get(java.lang.String expr, java.util.Collection<ParserAttribute> attributes)
expr
- the expressionattributes
- the attributespublic java.lang.String getValue()
public final boolean matches(Token input)
A regular expression token matches a TokenCharacter
or TokenString
if the regular expression matches the value. Returns fals for all other kinds of tokens.
public final java.lang.String matches(java.lang.String input)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object