public class MethodUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
findMethodIndex(List<Method> methods,
MethodScope methodScope,
String name,
Class<?> returnType,
Class<?>[] paramTypes)
Searches the supplied array of methods for specific method and returns
its index, otherwise returns -1.
|
static void |
findPrefixedInstanceMethods(Method[] methods,
String prefix,
List<Method> candidates)
From the supplied method array, finds but does not remove methods
that have the required prefix, and adds to the supplied candidates
vector.
|
static boolean |
inScope(Method extendee,
MethodScope methodScope) |
static void |
invoke(List<Method> methods,
Object object) |
static Method |
removeMethod(List<Method> methods,
MethodScope methodScope,
String name,
Class<?> returnType,
Class<?>[] paramTypes)
Searches the supplied array of methods for specific method and returns
it, also removing it from supplied array if found (by setting to
null).
|
static List<Method> |
removeMethods(List<Method> methods,
MethodScope forClass,
String prefix,
Class<?> returnType,
boolean canBeVoid,
int paramCount)
Searches the supplied array of methods for all specific methods and
returns them, also removing them from supplied array if found.
|
public static Method removeMethod(List<Method> methods, MethodScope methodScope, String name, Class<?> returnType, Class<?>[] paramTypes)
Any methods that do not meet the search criteria are left in the array of methods.
The search algorithm is as specified in
findMethodIndex(List, MethodScope, String, Class, Class[]).
public static int findMethodIndex(List<Method> methods, MethodScope methodScope, String name, Class<?> returnType, Class<?>[] paramTypes)
The search algorithm is:
public static boolean inScope(Method extendee, MethodScope methodScope)
public static List<Method> removeMethods(List<Method> methods, MethodScope forClass, String prefix, Class<?> returnType, boolean canBeVoid, int paramCount)
Any methods that do not meet the search criteria are left in the array of methods.
The search algorithm is:
forClass - name - returnType - paramTypes - the set of parameters the method should have, if null then is
ignoredpublic static void findPrefixedInstanceMethods(Method[] methods, String prefix, List<Method> candidates)
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.