Package de.dytanic.cloudnet.command.sub
Class SubCommandHandler
- java.lang.Object
-
- de.dytanic.cloudnet.command.Command
-
- de.dytanic.cloudnet.command.sub.SubCommandHandler
-
- All Implemented Interfaces:
ICommandExecutor,ITabCompleter
- Direct Known Subclasses:
CommandCluster,CommandCreate,CommandPermissions,CommandScreen,CommandService,CommandServiceConfigurationBase,CommandTemplate
public class SubCommandHandler extends Command implements ITabCompleter
-
-
Field Summary
-
Fields inherited from class de.dytanic.cloudnet.command.Command
description, names, permission, prefix, usage
-
-
Constructor Summary
Constructors Constructor Description SubCommandHandler(java.lang.String... names)SubCommandHandler(java.lang.String[] names, java.lang.String permission, java.lang.String description, java.lang.String usage, java.lang.String prefix, java.util.Collection<SubCommand> subCommands)SubCommandHandler(java.lang.String[] names, java.lang.String permission, java.lang.String description, java.util.Collection<SubCommand> subCommands)SubCommandHandler(java.lang.String[] names, java.lang.String permission, java.util.Collection<SubCommand> subCommands)SubCommandHandler(java.util.Collection<SubCommand> subCommands, java.lang.String... names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.lang.String>complete(java.lang.String commandLine, java.lang.String[] args, de.dytanic.cloudnet.common.Properties properties)This method allows on a Command implementation to complete the tab requests from the console or a supported command sendervoidexecute(ICommandSender sender, java.lang.String command, java.lang.String[] args, java.lang.String commandLine, de.dytanic.cloudnet.common.Properties properties)Handles an incoming commandLine which are already split and fetched for all extra propertiesprotected voidexecuteCommand(ICommandSender sender, java.lang.String command, java.lang.String[] args, java.lang.String commandLine, SubCommand subCommand, SubCommandArgument<?>[] parsedArgs)java.lang.StringgetUsage()protected voidsendHelp(ICommandSender sender)protected voidsetSubCommands(java.util.Collection<SubCommand> subCommands)-
Methods inherited from class de.dytanic.cloudnet.command.Command
getDescription, getInfo, getNames, getPermission, getPrefix, isValid
-
-
-
-
Constructor Detail
-
SubCommandHandler
public SubCommandHandler(java.lang.String... names)
-
SubCommandHandler
public SubCommandHandler(java.util.Collection<SubCommand> subCommands, java.lang.String... names)
-
SubCommandHandler
public SubCommandHandler(java.lang.String[] names, java.lang.String permission, java.util.Collection<SubCommand> subCommands)
-
SubCommandHandler
public SubCommandHandler(java.lang.String[] names, java.lang.String permission, java.lang.String description, java.util.Collection<SubCommand> subCommands)
-
SubCommandHandler
public SubCommandHandler(java.lang.String[] names, java.lang.String permission, java.lang.String description, java.lang.String usage, java.lang.String prefix, java.util.Collection<SubCommand> subCommands)
-
-
Method Detail
-
execute
public void execute(ICommandSender sender, java.lang.String command, java.lang.String[] args, java.lang.String commandLine, de.dytanic.cloudnet.common.Properties properties)
Description copied from interface:ICommandExecutorHandles an incoming commandLine which are already split and fetched for all extra properties- Specified by:
executein interfaceICommandExecutor- Parameters:
sender- the sender, that execute the commandcommand- the command name, that is used forargs- all important argumentscommandLine- the full commandline from the senderproperties- all properties, that are parsed from the command line
-
executeCommand
protected void executeCommand(ICommandSender sender, java.lang.String command, java.lang.String[] args, java.lang.String commandLine, SubCommand subCommand, SubCommandArgument<?>[] parsedArgs)
-
sendHelp
protected void sendHelp(ICommandSender sender)
-
complete
public java.util.Collection<java.lang.String> complete(java.lang.String commandLine, java.lang.String[] args, de.dytanic.cloudnet.common.Properties properties)Description copied from interface:ITabCompleterThis method allows on a Command implementation to complete the tab requests from the console or a supported command sender- Specified by:
completein interfaceITabCompleter- Parameters:
commandLine- the commandLine, that is currently writtenargs- the command line split into argumentsproperties- the parsed properties from the command line- Returns:
- all available results. It does not necessarily depend on the actual input, which is already given
-
setSubCommands
protected void setSubCommands(java.util.Collection<SubCommand> subCommands)
-
-