MCPcopy Index your code
hub / github.com/apache/groovy / invokeMethod

Method invokeMethod

src/main/java/groovy/lang/MetaClassImpl.java:862–874  ·  view source on GitHub ↗

Invoke a method on the given object with the given arguments. @param object The object the method should be invoked on. @param methodName The name of the method to invoke. @param arguments The arguments to the invoked method as null, a Tuple, an array or a single argument of any type. @return

(final Object object, final String methodName, final Object arguments)

Source from the content-addressed store, hash-verified

860 * @return The result of the method invocation.
861 */
862 @Override
863 public Object invokeMethod(final Object object, final String methodName, final Object arguments) {
864 if (arguments == null) {
865 return invokeMethod(object, methodName, EMPTY_ARGUMENTS);
866 }
867 if (arguments instanceof Tuple) {
868 return invokeMethod(object, methodName, ((Tuple<?>) arguments).toArray());
869 }
870 if (arguments instanceof Object[]) {
871 return invokeMethod(object, methodName, (Object[]) arguments);
872 }
873 return invokeMethod(object, methodName, new Object[]{arguments});
874 }
875
876 /**
877 * Invoke a missing method on the given object with the given arguments.

Callers 1

invokeStaticMethodMethod · 0.95

Calls 15

checkInitalisedMethod · 0.95
getMetaMethodMethod · 0.95
invokeMethodClosureMethod · 0.95
invokeMethodMethod · 0.95
invokeMissingMethodMethod · 0.95
convertToTypeArrayMethod · 0.95
pickMethodMethod · 0.95
invokeMethod · 0.95
lookupObjectMetaClassMethod · 0.95
getDeclaringClassMethod · 0.95

Tested by

no test coverage detected