Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javap

 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
Can any body tell me that by using javap can i get the only Fields list in specified class.
or is there any other method.
except refelection API.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not exactly certain what you're asking, but according to javap - The Java Class File Disassembler on java.sun.com:
"javap prints out the ... fields and methods of the classes passed to it."
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx !
ya that i know that we can get the methods and fields list from javap for specific class.
but i need only fields it is just because i want to this for each and every class in java for creating Jtree.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're looking to not get the methods, then I don't believe that can be done with javap alone. You could use javap and then parse the output to just get the non-method data. For instance, if the line contained a "(", then ignore that line.
Good Luck.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic