• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Obtaining method parameter names from compiled class files

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 touch me. And dont' touch this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic