aspose file tools*
The moose likes Java in General and the fly likes Data structure for reflection uses (pairs of String and String[]) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Data structure for reflection uses (pairs of String and String[])" Watch "Data structure for reflection uses (pairs of String and String[])" New topic
Author

Data structure for reflection uses (pairs of String and String[])

John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 227
Hi,
My business logic lies behind a web service. So the remote client calls the methods of the service. The client passes string from which the server extract name of the method and arguments. So I need a data structure to store the name (string) of the method and the arguments (String[]) pairs. So I need some thing like map but the keys shouldn't be unique (the keys would be the names of the methods).
Any ideas?

Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Not quite sure, but method calling via reflection is different from that; you get Method objects and invoke them with Object[] for their arguments. I presume you are familiar with the Java reflection API?
I don't think there is such a thing as a Map which permits duplicate Keys; you would have to encapsulate Method and arguments into a single class, then they might sit nicely in a Set.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data structure for reflection uses (pairs of String and String[])