|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.naturalcli.Token
public class Token
The Token class implements a token for the
command grammar.
| Constructor Summary | |
|---|---|
Token(java.lang.String text)
Constructor for the token |
|
| Method Summary | |
|---|---|
java.lang.String |
getParameterName()
Gets the parameter name for the token |
java.lang.String |
getParameterTypeName()
Gets the parameter type name for the token |
java.lang.String |
getText()
Get the token text |
java.lang.String |
getWord()
Obtains the word that represents the token, it means the token text without optional or parameter chars |
boolean |
isIdentifier()
Determines if it's an identifier |
boolean |
isMandatoryParameter()
Checks if it's a mandatory parameter token |
boolean |
isOptional()
Checks if it's an optional token |
boolean |
isOptionalParameter()
Checks if it's an optional parameter token |
boolean |
isParameter()
Checks if it's a parameter token |
boolean |
isVarArgs()
Determines if it's a variable arguments token |
boolean |
matches(java.lang.String t,
ParameterValidator pv)
Checks the text given to see if it's like the token |
void |
setText(java.lang.String text)
Set the token text and validate it |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Token(java.lang.String text)
throws InvalidTokenException
text - the token text
InvalidTokenException
InvalidTokenException| Method Detail |
|---|
public java.lang.String getText()
public void setText(java.lang.String text)
throws InvalidTokenException
text - the token text to set
InvalidTokenException
InvalidTokenExceptionpublic boolean isOptional()
true if its optional, false otherwisepublic boolean isParameter()
true if it's a parameter, false otherwisepublic boolean isOptionalParameter()
true if its optional parameter, false otherwisepublic boolean isMandatoryParameter()
true if it's mandatory parameter, false otherwisepublic java.lang.String getParameterName()
null if it's not a parameter.public java.lang.String getParameterTypeName()
null if it's not a parameter.public boolean isIdentifier()
true if it's an identifier, false otherwisepublic boolean isVarArgs()
true if it's a variable arguments token, false otherwisepublic java.lang.String getWord()
public boolean matches(java.lang.String t,
ParameterValidator pv)
throws UnknownParameterType
text - the text to matchpv - the parameter validator
true if matches, false if not
UnknownParameterType
UnknownParameterType
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||