public class LegacyCommandsHandler extends AbstractInvokeListener implements InvokeHandler
| Constructor and Description |
|---|
LegacyCommandsHandler() |
| Modifier and Type | Method and Description |
|---|---|
InvokeHandler |
createInvokeHandler()
Create a new invocation handler.
|
void |
postInvoke(List<? extends Annotation> annotations,
ArgumentParser parser,
Object[] args,
CommandArgs commandArgs)
Called after the command has been executed.
|
boolean |
preInvoke(List<? extends Annotation> annotations,
ArgumentParser parser,
Object[] args,
CommandArgs commandArgs)
Called after arguments have been parsed but the command has yet
to be executed.
|
boolean |
preProcess(List<? extends Annotation> annotations,
ArgumentParser parser,
CommandArgs commandArgs)
Called before arguments have been parsed.
|
void |
updateDescription(Set<Annotation> annotations,
ArgumentParser parser,
ImmutableDescription.Builder builder)
Called to update the description of a command.
|
public InvokeHandler createInvokeHandler()
InvokeListenerAn example use of an InvokeHandler would be to verify permissions
added by the Require annotation.
For simple InvokeHandler, an object can implement both this
interface and InvokeHandler.
createInvokeHandler in interface InvokeListenerpublic boolean preProcess(List<? extends Annotation> annotations, ArgumentParser parser, CommandArgs commandArgs) throws CommandException, ArgumentException
InvokeHandlerpreProcess in interface InvokeHandlerannotations - The list of annotations on the commandparser - The argument parser with parameter informationcommandArgs - The arguments provided by the userCommandException - Thrown if there is a general command problemArgumentException - Thrown is there is an error with the argumentspublic boolean preInvoke(List<? extends Annotation> annotations, ArgumentParser parser, Object[] args, CommandArgs commandArgs) throws CommandException, ArgumentException
InvokeHandlerpreInvoke in interface InvokeHandlerannotations - The list of annotations on the commandparser - The argument parser with parameter informationargs - The result of the parsed arguments: Java objects to be passed to the commandcommandArgs - The arguments provided by the userCommandException - Thrown if there is a general command problemArgumentException - Thrown is there is an error with the argumentspublic void postInvoke(List<? extends Annotation> annotations, ArgumentParser parser, Object[] args, CommandArgs commandArgs) throws CommandException, ArgumentException
InvokeHandlerpostInvoke in interface InvokeHandlerannotations - The list of annotations on the commandparser - The argument parser with parameter informationargs - The result of the parsed arguments: Java objects to be passed to the commandcommandArgs - The arguments provided by the userCommandException - Thrown if there is a general command problemArgumentException - Thrown is there is an error with the argumentspublic void updateDescription(Set<Annotation> annotations, ArgumentParser parser, ImmutableDescription.Builder builder)
InvokeListenerupdateDescription in interface InvokeListenerupdateDescription in class AbstractInvokeListenerannotations - Annotations on the commandparser - The parser containing parameter informationbuilder - The description builderCopyright © 2015. All Rights Reserved.