The only way I could find is passing a String :
final JavaClassSource javaClass = Roaster.create(JavaClassSource.class);
javaClass.setName("MaxValidatorForString");
javaClass.addImport(ConstraintValidator.class);
javaClass.addInterface("ConstraintValidator<Max, Number>");
final JavaClassSource javaClass = Roaster.create(JavaClassSource.class);
javaClass.setName("MaxValidatorForString");
javaClass.addInterface(ConstraintValidator.class);
javaClass.addInterface(ConstraintValidator.class).addType(Max.class).addType(Number.class);
javaClass.addMethod().setPublic().setName("isValid").setReturnType("boolean").setParameters("Number value, ConstraintValidatorContext context").setBody("return false;").addAnnotation(Override.class);
javaClass.addMethod().setPublic().setName("isValid").setReturnType("boolean").addParameter(Number.class, "value").addParameter(ConstraintValidatorContext.class, "context").setBody("return false;").addAnnotation(Override.class);