com.mockrunner.util.common
Class MethodUtil

java.lang.Object
  extended bycom.mockrunner.util.common.MethodUtil

public class MethodUtil
extends java.lang.Object


Constructor Summary
MethodUtil()
           
 
Method Summary
static java.lang.Object invoke(java.lang.Object object, java.lang.String methodName)
          Invokes the method with the specified name on the specified object and throws a NestedApplicationException, if the invocation fails.
static java.lang.Object invoke(java.lang.Object object, java.lang.String methodName, java.lang.Object parameter)
          Invokes the method with the specified name on the specified object and throws a NestedApplicationException, if the invocation fails.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodUtil

public MethodUtil()
Method Detail

invoke

public static java.lang.Object invoke(java.lang.Object object,
                                      java.lang.String methodName)
Invokes the method with the specified name on the specified object and throws a NestedApplicationException, if the invocation fails. The method must be public and must not have any parameters.

Parameters:
object - the object the method is invoked from
methodName - the name of the method
Returns:
the result of the method invocation

invoke

public static java.lang.Object invoke(java.lang.Object object,
                                      java.lang.String methodName,
                                      java.lang.Object parameter)
Invokes the method with the specified name on the specified object and throws a NestedApplicationException, if the invocation fails. The method must be public and must have exactly one paremeter of the type specified by the given parameter.

Parameters:
object - the object the method is invoked from
methodName - the name of the method
parameter - the parameter, must not be null
Returns:
the result of the method invocation