You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cs63...@googlegroups.com
Is there a way to get clean parameter types from the reflection API?
Of the methods available for getting parameter types, one lacks information about <Generics> while the other prefixes class names by the word class. And neither appear to handle array syntax well (prefixing by [L instead of suffixing with []). I've gotten the output that I want through string manipulation, but I was wondering if there might be a cleaner way to do this.
Betty O'Neil
unread,
Feb 15, 2012, 12:40:36 PM2/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mark Tyrrell, cs63...@googlegroups.com
I'm afraid there is some non-pretty string manipulation needed to get everything you need. --Betty O.
Max Ward
unread,
Feb 15, 2012, 12:52:03 PM2/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cs63...@googlegroups.com, cs63...@googlegroups.com
Use Method.getParameterTypes() to get the array of Class<?> and then I think Class<?>.getName() will give you the parameter type without the prefix "class".
mohamed
unread,
Feb 16, 2012, 11:56:33 AM2/16/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cs639_s12
Using the above still results with the contrived stuff. For example
for main it results with [Ljava.lang.String;. We still need more
String manipulation to get to String[] unless some one else found an
alternative.