Java: How do you access a sub-object of an object with no "getXXX" method to that sub-object
Posted
by Daxon
on Stack Overflow
See other posts from Stack Overflow
or by Daxon
Published on 2009-10-04T21:59:45Z
Indexed on
2010/04/02
0:03 UTC
Read the original article
Hit count: 296
I'll explain with pictures from Eclipse Debugger
I have an Class called "FieldContext", (I can't edit it, it's compiled in the Java OVal API)
Within "FieldContext" on the eclipse variable tab are "CompileTimeType" and "field"
Q1 Is there a legend for the icons in the variables tab? like what the red box with the "F" means + yellow diamond boxes?
Now I want to access the fields inside the "field" object (RedBox) .. preferably "name"
But the "FieldContext" does not have a "getField()" method, yet it has a "getCompileTimeType()" method.
Q2 So is there anyway to get that field object being a "SerializableField" Class from the "FieldContext"?
If eclipse debugger can see/get/edit them then I hope I can do the same in Java.
© Stack Overflow or respective owner