Package pro.gravit.utils.command
Class Command
java.lang.Object
pro.gravit.utils.command.Command
- Direct Known Subclasses:
ClearCommand,DebugCommand,GCCommand,HelpCommand,SubCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of available subcommands -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jline.reader.CandidatebuildCandidate(CommandHandler.Category category, String commandName) Creates a JLine candidate that appears in the list of available options when you press TABList<org.jline.reader.Candidate> Returns a list of available options for the next word for the current command.abstract Stringabstract Stringabstract voidRun current commandvoidinvokeSubcommands(String... args) Transfer control to subcommandsprotected static StringparseUsername(String username) protected static UUIDprotected final voidverifyArgs(String[] args, int min)
-
Field Details
-
childCommands
List of available subcommands
-
-
Constructor Details
-
Command
public Command() -
Command
-
-
Method Details
-
parseUsername
- Throws:
CommandException
-
parseUUID
- Throws:
CommandException
-
getArgsDescription
-
getUsageDescription
-
buildCandidate
public org.jline.reader.Candidate buildCandidate(CommandHandler.Category category, String commandName) Creates a JLine candidate that appears in the list of available options when you press TAB- Parameters:
category- this command categorycommandName- this command name- Returns:
- JLine Candidate
-
complete
Returns a list of available options for the next word for the current command.- Parameters:
words- list all user wordswordIndex- current word indexword- current word- Returns:
- list of available Candidate
-
invokeSubcommands
Transfer control to subcommands- Parameters:
args- command arguments(includes subcommand name)- Throws:
Exception- Error executing command
-
invoke
Run current command- Parameters:
args- command arguments- Throws:
Exception- Error executing command
-
verifyArgs
- Throws:
CommandException
-