I have an object that has been wrapped so whenever i do the following;
Field[] fields = builder.getClass().getDeclaredFields();
String s = "";
for(Field f : fields)
{
s+= " " + f.getName();
}
I get fields that aren’t in my class. If i want to modify a field that ahs been wrapped, is it possible to do so via reflection?
Thanks
edit: yes i called it on the unwrapped object. Sorry – its been a long day :/
I assume
builder.getClass()returns the wrong class. You might have to look up the wrapped object and callgetClass()on it or – if you can change the builder – provide a method to get the class of the wrapped object.