MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / invoke

Method invoke

Skay_Exp/src/tools/ClassLoaderUtils.java:104–123  ·  view source on GitHub ↗
(Object obj, String methodName, Object... parameters)

Source from the content-addressed store, hash-verified

102
103
104 public static Object invoke(Object obj, String methodName, Object... parameters) {
105 try {
106 ArrayList classes = new ArrayList();
107 if (parameters != null) {
108 for(int i = 0; i < parameters.length; ++i) {
109 Object o1 = parameters[i];
110 if (o1 != null) {
111 classes.add(o1.getClass());
112 } else {
113 classes.add((Object)null);
114 }
115 }
116 }
117
118 Method method = ClassLoaderUtils.getMethodByClass(obj.getClass(), methodName, (Class[])classes.toArray(new Class[0]));
119 return method.invoke(obj, parameters);
120 } catch (Exception var7) {
121 return null;
122 }
123 }
124
125 public static Method getMethodByClass(Class cs, String methodName, Class... parameters) {
126 Method method = null;

Callers 2

addJarMethod · 0.80
scanClassXMethod · 0.80

Calls 1

getMethodByClassMethod · 0.95

Tested by

no test coverage detected