jeudi 1 octobre 2015

It is possible to read the field value with annotations at runtime in java?

I have a class like follow, with MyAnnotation:

public class MyClass {

    @MyAnnotation
    public boolean bool;

    public boolean getBool(){
        return bool;
    }

    public voud setBool(boolean b){
        bool = b;
    }
}

It is possible to get the value of bool at runtime through the annotation?





Aucun commentaire:

Enregistrer un commentaire