@Getter
@Setter
class SomeObject {
@SerializedName("fullName")
public String someField;
public String someOtherField;
public SomeObject(String a, String b) {
this.someField = a;
this.someOtherField = b;
}
}
Field[] methods =SomeObject.class.getDeclaredFields();
for(Field method : methods){
SerializedName annotation = method.getAnnotation(SerializedName.class);
if(annotation == null)
continue;
InvocationHandler h = Proxy.getInvocationHandler(annotation);
Field hField = h.getClass().getDeclaredField("memberValues");
hField.setAccessible(true);
Map memberValues = (Map) hField.get(h);
memberValues.put("value", "ddd");
String value = annotation.value();
System.out.println(annotation.value());
}