I want to write a program which decides which methods to call on an object at runtime.
For example
<method>getXyz<operation>
<arg type="int"> 1 <arg>
<arg type="float"> 1/0 <arg>
Now I have something like above in XML files and I want to decide which method to call at runtime. There can be multiple methods.
I don't want to do something like the following in my code:
if (methodNam.equals("getXyz"))
//call obj.getXyz()
How can I do it using Java reflection?
Also I want to construct the parameter list at runtime. For example, one method can take
2 parameters and another can take n
arguments.