public class DispatcherNode
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
DispatcherNode |
describeAs(java.lang.String description)
Set the description.
|
Dispatcher |
getDispatcher()
Get the underlying dispatcher of this object.
|
CommandGraph |
graph()
Get the root command graph.
|
DispatcherNode |
group(java.lang.String... alias)
Create a new command that will contain sub-commands.
|
DispatcherNode |
parent()
Return the parent node.
|
void |
register(CommandCallable callable,
java.lang.String... alias)
Register a command with this dispatcher.
|
DispatcherNode |
registerMethods(java.lang.Object object)
Build and register a command with this dispatcher using the
ParametricBuilder assigned on the root CommandGraph . |
public DispatcherNode describeAs(java.lang.String description)
This can only be used on DispatcherNode
s returned by
group(String...)
.
description
- the descriptionpublic void register(CommandCallable callable, java.lang.String... alias)
callable
- the executoralias
- the list of aliases, where the first alias is the primary onepublic DispatcherNode registerMethods(java.lang.Object object)
ParametricBuilder
assigned on the root CommandGraph
.object
- the object provided to the ParametricBuilder
ParametricBuilder.registerMethodsAsCommands(com.sk89q.worldedit.util.command.Dispatcher, Object)
public DispatcherNode group(java.lang.String... alias)
The object returned by this method can be used to add sub-commands. To
return to this "parent" context, use graph()
.
alias
- the list of aliases, where the first alias is the primary onepublic DispatcherNode parent()
java.lang.RuntimeException
- if there is no parent node.public CommandGraph graph()
public Dispatcher getDispatcher()