E - The type of the executorpublic class CommandExecutor<E>
extends java.lang.Object
| Constructor and Description |
|---|
CommandExecutor() |
CommandExecutor(ArgumentComparator argumentComparator) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<Completion> |
completions(E executor,
java.lang.String command)
Get completions for the given command input.
|
java.util.Set<Completion> |
completions(E executor,
StringReader reader)
Get completions for the given command input.
|
<T> T |
execute(E executor,
java.lang.String command)
Execute the given command input.
|
<T> T |
execute(E executor,
StringReader reader)
Execute the given command input.
|
void |
register(ArgumentNode<E,?> argumentNode)
Register an argument node.
|
void |
register(StringNode<E> stringNode)
Register a string argument node.
|
public CommandExecutor()
public CommandExecutor(ArgumentComparator argumentComparator)
public void register(ArgumentNode<E,?> argumentNode)
StringNode.register(StringNode).argumentNode - The argument nodepublic void register(StringNode<E> stringNode)
stringNode - The string argument nodepublic java.util.Set<Completion> completions(@Nonnull E executor, @Nonnull java.lang.String command)
executor - The executorcommand - The command inputpublic java.util.Set<Completion> completions(@Nonnull E executor, @Nonnull StringReader reader)
executor - The executorreader - The string reader@Nullable
public <T> T execute(@Nonnull
E executor,
@Nonnull
java.lang.String command)
throws CommandExecutionException
T - The return type of the executed commandexecutor - The executorcommand - The command inputCommandExecutionException - If the command execution failed@Nullable
public <T> T execute(@Nonnull
E executor,
@Nonnull
StringReader reader)
throws CommandExecutionException
T - The return type of the executed commandexecutor - The executorreader - The string readerCommandExecutionException - If the command execution failed