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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object's all attributes

Status
Not open for further replies.

pjani

Programmer
Apr 16, 2001
9
0
0
US
I want to access O object's attributes using java reflection.

O.getClass().getFields() returns only public attributes and all inherited.

O.getClass().getDeclaredFields() returns public and private attributes. But none of the inherited.

how can i get ALL Attributes in object O.

I would really appreciate your help and if any sample code.

thanks,
pjani
 
You may want to check out the Reflection tutorial at java.sun.com.
 
Java reflection doesn't break the normal access rules for an object's fields. If it's not visible to your class in the ordinary way, it won't be visible using reflection.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top