Interface ExecutionSource
- All Known Implementing Classes:
ArrayExecutionSource,PaperExecutionSource
public interface ExecutionSource
Interface to generate platform-specific command execution steps.
-
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateExecutionSetup(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).voidgenerateParameterResolution(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.voidgenerateSenderResolution(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.
-
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 builderclassModel- the command class modelmethod- the command method modelrootModel- the root command modelsenderVarName- the variable name to assign the sender tosenderParam- the sender parameter modelsenderParamTypeName- 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 builderclassModel- the command class modelmethod- the command method modelrootModel- 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 builderclassModel- the command class modelmethod- the command method modelrootModel- the root command modelp- the parameter model to resolvevarName- the variable name to assign the resolved parameter tosenderVar- the variable name of the resolved senderparamIndex- the index of the parameter in the command method (excluding sender)
-