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)
  • Constructor Details

  • Method Details

    • execute

      public void execute(@NonNull cloud.commandframework.context.CommandContext<C> commandContext)
      Specified by:
      execute in interface cloud.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 context
      flagContext - The flag context
      parameters - 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

      public final @NonNull Parameter @NonNull [] parameters()
      Returns all parameters passed to the method
      Returns:
      The parameters
      Since:
      1.6.0
    • methodHandle

      public final @NonNull MethodHandle 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