Class DummyParser
java.lang.Object
net.apartium.cocoabeans.commands.parsers.ArgumentParser<Object>
net.apartium.cocoabeans.commands.parsers.DummyParser
- All Implemented Interfaces:
Comparable<ArgumentParser<?>>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser
ArgumentParser.ParseResult<T>, ArgumentParser.TabCompletionResult -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a dummy parserDummyParser(int priority) Creates a dummy parserDummyParser(String keyword, int priority) Creates a dummy parser -
Method Summary
Modifier and TypeMethodDescriptionparse(CommandProcessingContext processingContext) Tries to parse next argument in the contexttabCompletion(CommandProcessingContext processingContext) Retrieves available options for tab completion of this argumenttryParse(CommandProcessingContext processingContext) Tries to lazily parse next argument in the contextMethods inherited from class net.apartium.cocoabeans.commands.parsers.ArgumentParser
compareTo, getArgumentType, getKeyword, getPriority
-
Field Details
-
DEFAULT_KEYWORD
- See Also:
-
-
Constructor Details
-
DummyParser
public DummyParser()Creates a dummy parser -
DummyParser
public DummyParser(int priority) Creates a dummy parser- Parameters:
priority- parser priority of which should be higher than others or lower
-
DummyParser
Creates a dummy parser- Parameters:
keyword- parser keywordpriority- parser priority of which should be higher than others or lower
-
-
Method Details
-
parse
public Optional<ArgumentParser.ParseResult<Object>> parse(CommandProcessingContext processingContext) Description copied from class:ArgumentParserTries to parse next argument in the context- Specified by:
parsein classArgumentParser<Object>- Parameters:
processingContext- cmd processing context- Returns:
- empty if failed, otherwise result
-
tryParse
Description copied from class:ArgumentParserTries to lazily parse next argument in the context- Specified by:
tryParsein classArgumentParser<Object>- Parameters:
processingContext- cmd processing context- Returns:
- new index int if success, empty if not
-
tabCompletion
public Optional<ArgumentParser.TabCompletionResult> tabCompletion(CommandProcessingContext processingContext) Description copied from class:ArgumentParserRetrieves available options for tab completion of this argument- Specified by:
tabCompletionin classArgumentParser<Object>- Parameters:
processingContext- cmd processing context- Returns:
- tab completion result if success, otherwise empty option
-