Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding out private fields

Status
Not open for further replies.

carpeliam

Programmer
Mar 17, 2000
990
US
I know you can discover public fields using the reflect package (the reflect package is really great! if you haven't looked at it, try it out- it's really neat) and you can access private fields using ReflectPermissions (haven't looked into this too much- it looks dangerous), but is there anyway you can find out the names of private fields (just the names, not their values)? If anybody knows anything about anything like this, please let me know- thanks :eek:) <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence."
 
the javap utility should be of help here<br>if you type <FONT FACE=monospace>javap -private &lt;filename&gt;</font>.&nbsp;&nbsp;It's not as good as the reflection package but if you just want a quick look its quite good <p>Chris Packham<br><a href=mailto:kriz@i4free.co.nz>kriz@i4free.co.nz</a><br><a href= > </a><br>A thousand mokeys at a thousand machines, it happened, it got called the internet.
 
That's not quite what I meant... I have to access them from inside a class, dynamically... but thank you. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top