Interface ExecutionSource

All Known Implementing Classes:
ArrayExecutionSource, PaperExecutionSource

public interface ExecutionSource
Interface to generate platform-specific command execution steps.
  • Method Details

    • generateSenderResolution

      void generateSenderResolution(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, CommandModel rootModel, String senderVarName, ParameterModel senderParam, com.palantir.javapoet.TypeName senderParamTypeName)
      Generates code to resolve and cast the command sender.
      Parameters:
      methodSpec - the target method builder
      classModel - the command class model
      method - the command method model
      rootModel - the root command model
      senderVarName - the variable name to assign the sender to
      senderParam - the sender parameter model
      senderParamTypeName - the JavaPoet TypeName of the sender
    • generateExecutionSetup

      void generateExecutionSetup(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, CommandModel rootModel)
      Generates code for platform-specific execution setup or static checks (e.g. checking command length).
      Parameters:
      methodSpec - the target method builder
      classModel - the command class model
      method - the command method model
      rootModel - the root command model
    • generateParameterResolution

      void generateParameterResolution(com.palantir.javapoet.MethodSpec.Builder methodSpec, CommandModel classModel, MethodModel method, CommandModel rootModel, ParameterModel p, String varName, String senderVar, int paramIndex)
      Generates code to parse and resolve a specific command parameter.
      Parameters:
      methodSpec - the target method builder
      classModel - the command class model
      method - the command method model
      rootModel - the root command model
      p - the parameter model to resolve
      varName - the variable name to assign the resolved parameter to
      senderVar - the variable name of the resolved sender
      paramIndex - the index of the parameter in the command method (excluding sender)