• Post Reply Bookmark Topic Watch Topic
  • New Topic

Obtaining method parameter names from compiled class files  RSS feed

 
Junaid Bhatra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For java source compiled with the debug option (-g), the class files contain the method paramter names. However these are not available via Reflection. Does anyone know of a way to get these? Does JavaAssist or BCEL provide such a facility? I had a quick look at JavaAssist API and could not find a way.

I need the paramter names for a custom WSDL creation from Java Source files for Web Services development. I would like the WSDL parameters to be something meaningful rather than generic param1, param2, etc. I know that Web Service engines like Axis do the exact same thing, probably via class file parsing, which I would hate to do on my own.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you have the Java source files, it might be easier to extract the information from that.

Decompilers like Jode (on SourceForge) obviously can do this. It tmight be worth a look if that capability is accessible through an API.
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, with -g the method parameter names are available. I'm going to bet that this information is available through BCEL - I'd be surprised if not.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!