Class SimpleArgumentParserToken
java.lang.Object
net.apartium.cocoabeans.commands.lexer.CommandToken
net.apartium.cocoabeans.commands.lexer.ArgumentParserToken
net.apartium.cocoabeans.commands.lexer.SimpleArgumentParserToken
- All Implemented Interfaces:
Serializable
A simple argument parser token is a token that represents an argument parser
- See Also:
-
Field Summary
Fields inherited from class net.apartium.cocoabeans.commands.lexer.CommandToken
from, text, to -
Constructor Summary
ConstructorsConstructorDescriptionSimpleArgumentParserToken(int from, int to, String text) Create a new argument parser token -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the parameter name of the argument parser if it has onegetParser(Map<String, ArgumentParser<?>> parsers) Gets the argument parser from the given parsers mapGets the argument parser nameinthashCode()booleanGets if the argument parser is optionalbooleanGets if the argument parser is optional but does not matchtoString()Methods inherited from class net.apartium.cocoabeans.commands.lexer.ArgumentParserToken
getTypeMethods inherited from class net.apartium.cocoabeans.commands.lexer.CommandToken
from, to
-
Constructor Details
-
SimpleArgumentParserToken
Create a new argument parser token- Parameters:
from- starting indexto- ending indextext- the entire text of command
-
-
Method Details
-
getParameterName
Gets the parameter name of the argument parser if it has one- Specified by:
getParameterNamein classArgumentParserToken- Returns:
- the parameter name
-
isOptional
public boolean isOptional()Gets if the argument parser is optional- Specified by:
isOptionalin classArgumentParserToken- Returns:
- true if the argument parser is optional
-
optionalNotMatch
public boolean optionalNotMatch()Gets if the argument parser is optional but does not match- Specified by:
optionalNotMatchin classArgumentParserToken- Returns:
- true if the argument parser is optional but does not match
-
getParser
Gets the argument parser from the given parsers map- Specified by:
getParserin classArgumentParserToken- Parameters:
parsers- parser map that represents all argument parsers we have- Returns:
- the argument parser
-
getParserName
Gets the argument parser name- Specified by:
getParserNamein classArgumentParserToken- Returns:
- the argument parser name
-
toString
-
equals
-
hashCode
public int hashCode()
-