[Method.invoke] wrapper - accessing arguments passed to user method.

S

Storm

Dear Colleagues,

Given the following hypothetical method,

protected Object ExampleMethod(String OStr, int oInt, String oStr_bis ...)
{
// .. code ..
}

I can retrieve (i.e.: being in method's body and using specific code) the
current method name, Class[] array for passed arguments. Nevertheless,
I would like to access values of these argument in a such abstract way;
that the following custom call would be grammatically correct:

// String method -> ExampleMethod, Class[] objects -> java.lang.string, int ..
// (and finally) Object[] argVal -> ????)
this.myprocessor(method, object, argVal);

ISSUE [!] : What should be done to create this 'argVal' variable programmatically?

Thank you for helping...
 
C

Chris Uppal

Storm said:
I can retrieve (i.e.: being in method's body and using specific code) the
current method name, Class[] array for passed arguments. Nevertheless,
I would like to access values of these argument [...]

Unfortunately, you can't. Ideally they should be recorded in the stack trace
of an exception (or at least of some exceptions), but they aren't.

Which is a /real/ shame because otherwise one could do some /very/ interesting
things with NoSuchMethodException...

-- chris
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top