org.nakedobjects.metamodel.specloader.internal.introspector
Class MethodFinderUtils

java.lang.Object
  extended by org.nakedobjects.metamodel.specloader.internal.introspector.MethodFinderUtils

public final class MethodFinderUtils
extends java.lang.Object

TODO: duplication with WrapperUtils and PrimitiveUtils.


Method Summary
static void findPrefixedInstanceMethods(java.lang.reflect.Method[] methods, java.lang.String prefix, java.util.List<java.lang.reflect.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(MethodScope methodScope, java.lang.reflect.Method method)
           
static java.lang.reflect.Method removeMethod(java.lang.reflect.Method[] methods, MethodScope methodScope, java.lang.String name, java.lang.Class<?> returnType, java.lang.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 java.util.List<java.lang.reflect.Method> removeMethods(java.lang.reflect.Method[] methods, MethodScope forClass, java.lang.String prefix, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

removeMethod

public static java.lang.reflect.Method removeMethod(java.lang.reflect.Method[] methods,
                                                    MethodScope methodScope,
                                                    java.lang.String name,
                                                    java.lang.Class<?> returnType,
                                                    java.lang.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).

Any methods that do not meet the search criteria are left in the array of methods.

The search algorithm is:

If the returnType is specified as null then the return type is ignored.

Parameters:
forClass -
name -
returnType -
paramTypes - the set of parameters the method should have, if null then is ignored
Returns:
Method

inScope

public static boolean inScope(MethodScope methodScope,
                              java.lang.reflect.Method method)

removeMethods

public static java.util.List<java.lang.reflect.Method> removeMethods(java.lang.reflect.Method[] methods,
                                                                     MethodScope forClass,
                                                                     java.lang.String prefix,
                                                                     java.lang.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.

Any methods that do not meet the search criteria are left in the array of methods.

The search algorithm is:

If the returnType is specified as null then the return type is ignored.

Parameters:
forClass -
name -
returnType -
paramTypes - the set of parameters the method should have, if null then is ignored
Returns:
Method

findPrefixedInstanceMethods

public static void findPrefixedInstanceMethods(java.lang.reflect.Method[] methods,
                                               java.lang.String prefix,
                                               java.util.List<java.lang.reflect.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.



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.