springboot,提取注解参数问题

class basinfo{
 @Notnull(message="年龄必须设置")
 private int age;

 @Size(min=3,max=12,message="这里必须设置一个值")
 private String remark;
 }

写一个方法,传入类名后,怎么获取注解中的参数呢?比如获取message,min等。

public String demo(String className){
Class c=Class.forName(className);

Notnull notnull=( Notnull) c.getAnnotation( Notnull.class);

String message=notnull.value();

return message;
}

    public String demo(String className){
                    Class c=Class.forName(className);  
                    Notnull notnull=(   Notnull) c.getAnnotation(   Notnull.class);  
                    String message=notnull.value();  
                    return message;
    }

public String demo(String className){
Class c=Class.forName(className);

Notnull notnull=( Notnull) c.getAnnotation( Notnull.class);

String message=notnull.value();

return message;
}