1 package ist.coach.coachEmfClientComponents; 2 3 public class InvokeSetData { 4 5 public java.lang.reflect.Method methodName; 6 public Object [] methodArguments; 7 public Class [] methodArgumentTypes; 8 public Class objectClass; 9 10 public InvokeSetData(Class objectClass, 11 java.lang.reflect.Method methodName, 12 Object [] methodArguments, 13 Class [] methodArgumentTypes) { 14 15 this.objectClass = objectClass; 16 this.methodName = methodName; 17 this.methodArguments = methodArguments; 18 this.methodArgumentTypes = methodArgumentTypes; 19 } 20 21 public InvokeSetData(String object_Class, 22 String method_Name, 23 Object [] method_Arguments) { 24 25 try { 26 27 objectClass = Class.forName(object_Class); 28 29 methodArgumentTypes = new Class [method_Arguments.length]; 30 methodArguments = method_Arguments; 31 32 for(int i = 0; i < methodArgumentTypes.length; i++) { 33 34 if (method_Arguments[i] instanceof Integer ) { 37 methodArgumentTypes[i] = Integer.TYPE; 38 System.err.println("HELLO1!"); 40 } 41 else 42 methodArgumentTypes[i] = method_Arguments[i].getClass(); 44 45 } 48 49 methodName = objectClass.getMethod(method_Name, methodArgumentTypes); 50 51 } 52 catch(java.lang.IllegalArgumentException e1) { 53 System.err.println("InvokeSetData> IllegalArgumentException "); 54 } 55 catch(java.lang.ClassNotFoundException e3) { 59 System.err.println("InvokeSetData> ClassNotFoundException " + 60 e3.getMessage()); 61 } 62 catch(java.lang.NoSuchMethodException e4) { 63 System.err.println("InvokeSetData> NoSuchMethodException " + 64 e4.getMessage()); 65 e4.printStackTrace(); 66 } 67 71 } 72 73 } 74 | Popular Tags |