Getting parameter names through reflection

Discussion in 'Java' started by cyberco, Apr 20, 2006.

  1. cyberco

    cyberco Guest

    Is it possible to get parameter names through reflection? From a class
    file reflection enables me to get methods and their types of
    parameters:

    public void foo(int);

    But I would like to now the name for the int parameter.

    It seems like Eclipse is able to pull this off for its debugging mode,
    I wonder how.
     
    cyberco, Apr 20, 2006
    #1
    1. Advertising

  2. cyberco

    Chris Uppal Guest

    cyberco wrote:

    > Is it possible to get parameter names through reflection?


    No.

    /If/ you have access to the .class files, and /if/ they were compiled with
    variable name tables included (part of the debugging info), and /if/ you are
    willing to parse the classfile to find and interpret the tables (there are
    several helper libraries available), then you can get the information that way.

    -- chris
     
    Chris Uppal, Apr 20, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Hagen
    Replies:
    3
    Views:
    743
    Oscar kind
    Jul 31, 2004
  2. Alex
    Replies:
    0
    Views:
    527
  3. Tom Counsell
    Replies:
    1
    Views:
    108
    Florian Gross
    Sep 17, 2004
  4. Charlie Squires

    Parameter names from reflection?

    Charlie Squires, Nov 14, 2005, in forum: Ruby
    Replies:
    7
    Views:
    145
    Francis Hwang
    Nov 17, 2005
  5. Oliver Saunders

    Parameter name reflection

    Oliver Saunders, Jul 3, 2008, in forum: Ruby
    Replies:
    4
    Views:
    120
    ara.t.howard
    Jul 6, 2008
Loading...

Share This Page