U
u.Shanker
Hello !
I have to call ExternalClass.myMethod(InputClass[]) and want to change
InputClass and myMethods at runtime
see the code :
ExternalClass external = ...
InputClass rr = .....
InputClass[] array = new InputClass[] { rr };
Object o = anotherclass.getObjectInstance("InputClass");
Class cls = Class.forName("InputClass");
Object arr = Array.newInstance(cls, 1);
Array.set(arr, 0, o);
Class c = external.getClass();
Class[] parameterTypes = new Class[] {array}; // <-- this works
Method concatMethod;
Object[] arguments = new Object[] { };
Method[] mm = c.getMethods();
concatMethod = c.getMethod("myMethod", parameterTypes);
--
but I want arr instead of array.
Class[] parameterTypes = new Class[] {arr};
any comments
uma
I have to call ExternalClass.myMethod(InputClass[]) and want to change
InputClass and myMethods at runtime
see the code :
ExternalClass external = ...
InputClass rr = .....
InputClass[] array = new InputClass[] { rr };
Object o = anotherclass.getObjectInstance("InputClass");
Class cls = Class.forName("InputClass");
Object arr = Array.newInstance(cls, 1);
Array.set(arr, 0, o);
Class c = external.getClass();
Class[] parameterTypes = new Class[] {array}; // <-- this works
Method concatMethod;
Object[] arguments = new Object[] { };
Method[] mm = c.getMethods();
concatMethod = c.getMethod("myMethod", parameterTypes);
--
but I want arr instead of array.
Class[] parameterTypes = new Class[] {arr};
any comments
uma