MCPcopy Index your code
hub / github.com/beanshell/beanshell / invokeObjectMethod

Method invokeObjectMethod

src/bsh/Reflect.java:80–97  ·  view source on GitHub ↗

Invoke method on arbitrary object instance. invocation may be static (through the object instance) or dynamic. Object may be a bsh scripted object (bsh.This type). @return the result of the method call

(Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo)

Source from the content-addressed store, hash-verified

78 * @return the result of the method call
79 */
80 public static Object invokeObjectMethod(Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo) throws ReflectError, EvalError, InvocationTargetException {
81 // Bsh scripted object
82 if (object instanceof This && !This.isExposedThisMethod(methodName)) {
83 return ((This) object).invokeMethod(methodName, args, interpreter, callstack, callerInfo, false/*delcaredOnly*/);
84 }
85
86 // Plain Java object, find the java method
87 try {
88 BshClassManager bcm = interpreter == null ? null : interpreter.getClassManager();
89 Class clas = object.getClass();
90
91 Method method = resolveExpectedJavaMethod(bcm, clas, object, methodName, args, false);
92
93 return invokeMethod(method, object, args);
94 } catch (UtilEvalError e) {
95 throw e.toEvalError(callerInfo, callstack);
96 }
97 }
98
99
100 /**

Callers 2

invokeMethodMethod · 0.95
doNameMethod · 0.95

Calls 6

isExposedThisMethodMethod · 0.95
invokeMethodMethod · 0.95
getClassMethod · 0.80
getClassManagerMethod · 0.45
toEvalErrorMethod · 0.45

Tested by

no test coverage detected