java.lang.Object
io.github.projectunified.craftcommand.validation.processor.extension.MinHandler
All Implemented Interfaces:
ParameterAnnotationHandler<Min>

public class MinHandler extends Object implements ParameterAnnotationHandler<Min>
Built-in validation handler for @Min annotations.
  • Constructor Details

    • MinHandler

      public MinHandler()
  • Method Details

    • annotationType

      public Class<Min> annotationType()
      Description copied from interface: ParameterAnnotationHandler
      Gets the annotation type this handler targets.
      Specified by:
      annotationType in interface ParameterAnnotationHandler<Min>
      Returns:
      the annotation class
    • handle

      public void handle(Min annotation, ParameterModel parameter, String varName, String instanceExpr, String senderVar, com.palantir.javapoet.MethodSpec.Builder methodSpec)
      Description copied from interface: ParameterAnnotationHandler
      Injects custom code (e.g. validation) into the generated method execution code block. Called after the parameter value is resolved and assigned to the parameter variable.
      Specified by:
      handle in interface ParameterAnnotationHandler<Min>
      Parameters:
      annotation - the parameter annotation instance
      parameter - the parameter model
      varName - the name of the generated parameter variable (e.g. "param_1")
      instanceExpr - the expression of the target command instance (e.g. "instance" or "this.subInstance_xxx")
      senderVar - the variable name representing the command sender (e.g. "senderCast")
      methodSpec - the method spec builder for the execute/onCommand method