Lets assume I have following annotation types:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TypeA {
TypeB[] arrayOfTypeB();
}
public @interface TypeB {
String firstField();
String secondField();
}
And a class that uses these annotation types:
@TypeA(arrayOfTypeB = {
@TypeB(
firstField = "first field",
secondField = "second field"),
})
public class ClassUsingTheseTypes{
}
How to change secondFIeld value using reflection in Java?
Aucun commentaire:
Enregistrer un commentaire