Class MethodCommandExecutionHandler<C>
java.lang.Object
cloud.commandframework.annotations.MethodCommandExecutionHandler<C>
- Type Parameters:
C
- Command sender type.
- All Implemented Interfaces:
cloud.commandframework.execution.CommandExecutionHandler<C>
public class MethodCommandExecutionHandler<C>
extends Object
implements cloud.commandframework.execution.CommandExecutionHandler<C>
A command execution handler that invokes a method.
- Since:
- 1.6.0 (Was made public in 1.6.0)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Context for command methodsNested classes/interfaces inherited from interface cloud.commandframework.execution.CommandExecutionHandler
cloud.commandframework.execution.CommandExecutionHandler.FutureCommandExecutionHandler<C extends Object>, cloud.commandframework.execution.CommandExecutionHandler.NullCommandExecutionHandler<C extends Object>
-
Constructor Summary
ConstructorDescriptionMethodCommandExecutionHandler
(@NonNull MethodCommandExecutionHandler.CommandMethodContext<C> context) Constructs a new method command execution handler -
Method Summary
Modifier and TypeMethodDescriptionfinal cloud.commandframework.annotations.AnnotationAccessor
The annotation accessor for the command methodcontext()
Returns the command method contextcreateParameterValues
(cloud.commandframework.context.CommandContext<C> commandContext, cloud.commandframework.arguments.flags.FlagContext flagContext, Parameter[] parameters) Creates a list containing the values for the given method parameters.void
final @NonNull MethodHandle
Returns the compiled method handle for the command method.final @NonNull Parameter @NonNull []
Returns all parameters passed to the methodMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cloud.commandframework.execution.CommandExecutionHandler
executeFuture
-
Constructor Details
-
MethodCommandExecutionHandler
public MethodCommandExecutionHandler(@NonNull MethodCommandExecutionHandler.CommandMethodContext<C> context) throws Exception Constructs a new method command execution handler- Parameters:
context
- The context- Throws:
Exception
- Since:
- 1.6.0
-
-
Method Details
-
execute
- Specified by:
execute
in interfacecloud.commandframework.execution.CommandExecutionHandler<C>
-
createParameterValues
protected final List<Object> createParameterValues(cloud.commandframework.context.CommandContext<C> commandContext, cloud.commandframework.arguments.flags.FlagContext flagContext, Parameter[] parameters) Creates a list containing the values for the given method parameters.- Parameters:
commandContext
- The contextflagContext
- The flag contextparameters
- The parameters to create values for- Returns:
- A list containing all parameters, in order
- Since:
- 1.6.0
-
context
Returns the command method context- Returns:
- The context
- Since:
- 1.6.0
-
parameters
Returns all parameters passed to the method- Returns:
- The parameters
- Since:
- 1.6.0
-
methodHandle
Returns the compiled method handle for the command method.- Returns:
- The method handle
- Since:
- 1.6.0
-
annotationAccessor
public final cloud.commandframework.annotations.AnnotationAccessor annotationAccessor()The annotation accessor for the command method- Returns:
- Annotation accessor
- Since:
- 1.6.0
-