Class MinHandler
java.lang.Object
io.github.projectunified.craftcommand.validation.processor.extension.MinHandler
- All Implemented Interfaces:
ParameterAnnotationHandler<Min>
Built-in validation handler for
@Min annotations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the annotation type this handler targets.voidhandle(Min annotation, ParameterModel parameter, String varName, String instanceExpr, String senderVar, com.palantir.javapoet.MethodSpec.Builder methodSpec) Injects custom code (e.g. validation) into the generated method execution code block.
-
Constructor Details
-
MinHandler
public MinHandler()
-
-
Method Details
-
annotationType
Description copied from interface:ParameterAnnotationHandlerGets the annotation type this handler targets.- Specified by:
annotationTypein interfaceParameterAnnotationHandler<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:ParameterAnnotationHandlerInjects 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:
handlein interfaceParameterAnnotationHandler<Min>- Parameters:
annotation- the parameter annotation instanceparameter- the parameter modelvarName- 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
-