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(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
java.lang.Object[] args,
CommandContext context)
Called after the parameter is invoked.
|
void |
preInvoke(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
java.lang.Object[] args,
CommandContext context)
Called before the parameter is invoked.
|
void |
preProcess(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
CommandContext context)
Called before parameters are processed.
|
void |
updateDescription(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
SimpleDescription description)
During creation of a
CommandCallable by a ParametricBuilder ,
this will be called in case the description needs to be updated. |
public InvokeHandler createInvokeHandler()
InvokeListener
An example use of an InvokeHandler
would be to verify permissions
added by the CommandPermissions
annotation.
For simple InvokeHandler
, an object can implement both this
interface and InvokeHandler
.
createInvokeHandler
in interface InvokeListener
public void preProcess(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, CommandContext context) throws CommandException, ParameterException
InvokeHandler
preProcess
in interface InvokeHandler
object
- the objectmethod
- the methodparameters
- the list of parameterscontext
- the contextCommandException
- can be thrown for an error, which will stop invocationParameterException
- on parameter errorpublic void preInvoke(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, java.lang.Object[] args, CommandContext context) throws ParameterException
InvokeHandler
preInvoke
in interface InvokeHandler
object
- the objectmethod
- the methodparameters
- the list of parametersargs
- the arguments to be given to the methodcontext
- the contextParameterException
- on parameter errorpublic void postInvoke(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, java.lang.Object[] args, CommandContext context)
InvokeHandler
postInvoke
in interface InvokeHandler
object
- the objectmethod
- the methodparameters
- the list of parametersargs
- the arguments to be given to the methodcontext
- the contextpublic void updateDescription(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, SimpleDescription description)
InvokeListener
CommandCallable
by a ParametricBuilder
,
this will be called in case the description needs to be updated.updateDescription
in interface InvokeListener
updateDescription
in class AbstractInvokeListener
object
- the objectmethod
- the methodparameters
- a list of parametersdescription
- the description to be updated