| java.lang.Object com.mockrunner.util.common.MethodUtil
MethodUtil | public class MethodUtil (Code) | | |
areMethodsEqual | public static boolean areMethodsEqual(Method method1, Method method2)(Code) | | Returns if the two specified methods are equal as
defined by Method.equals() except that
the methods can be defined by different classes.
Parameters: method1 - the first method to compare Parameters: method2 - the second method to compare true if the methods are equal, false otherwise throws: NullPointerException - if one of the methods is null |
getMatchingDeclaredMethods | public static Method[] getMatchingDeclaredMethods(Class theClass, String expr)(Code) | | Returns the declared methods of the specified class whose names are matching
the specified regular expression.
Parameters: theClass - the class whose methods are examined Parameters: expr - the regular expression the matching methods |
getMethodsSortedByInheritanceHierarchy | public static Method[][] getMethodsSortedByInheritanceHierarchy(Class theClass)(Code) | | Returns all non-static methods declared by the specified class and its
superclasses. The returned array contains the methods of all classes
in the inheritance hierarchy, starting with the methods of the
most general superclass, which is java.lang.Object .
Parameters: theClass - the class whose methods are examined the array of method arrays |
getOverriddenMethods | public static Set getOverriddenMethods(Class clazz, Method[] methods)(Code) | | Returns all methods in methods that are overridden in
the specified class hierarchy. The returned Set contains
all overridden methods and all overriding methods.
Parameters: clazz - the class hierarchy Parameters: methods - the Set of methods all overridden and overriding methods. |
invoke | public static Object invoke(Object object, String methodName)(Code) | | Invokes the method with the specified name on the specified object
and throws a
com.mockrunner.base.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 Parameters: methodName - the name of the method the result of the method invocation |
invoke | public static Object invoke(Object object, String methodName, Object parameter)(Code) | | Invokes the method with the specified name on the specified object
and throws a
com.mockrunner.base.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 Parameters: methodName - the name of the method Parameters: parameter - the parameter, must not be null the result of the method invocation |
overrides | public static boolean overrides(Method method1, Method method2)(Code) | | Returns if method2 overrides method1 .
Parameters: method1 - method to be overridden Parameters: method2 - overriding method true if method2 overrides method1 , false otherwise throws: NullPointerException - if one of the methods is null |
|
|