info.javelot.functionalj.reflect.helper.impl
Class ReflectFinderImpl

java.lang.Object
  extended by info.javelot.functionalj.reflect.helper.impl.ReflectFinderImpl
All Implemented Interfaces:
ReflectFinder

public class ReflectFinderImpl
extends Object
implements ReflectFinder

Implementation of a way to find Methods and Constructors.

Finding methods by name

This implementation searches methods by name in the following manner, in order of priority. For example, searching for "name" will look for:

Author:
Copyright © 2006 Frederic Daoud

Constructor Summary
ReflectFinderImpl()
           
 
Method Summary
 Constructor findConstructor(Class p_class, Class[] p_types)
          Finds the constructor of the given class that accepts parameters of the specified types.
 Constructor[] findConstructors(Class p_class)
          Finds the constructors of the given class.
 Method findInstanceMethod(Class p_class, String p_name, Class[] p_types)
          Finds the named instance method of the given class that accepts parameters of the specified types.
 Method[] findInstanceMethods(Class p_class, String p_name)
          Finds the named instance methods of the given class.
 Method findStaticMethod(Class p_class, String p_name, Class[] p_types)
          Finds the named static method of the given class that accepts parameters of the specified types.
 Method[] findStaticMethods(Class p_class, String p_name)
          Finds the named static methods of the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectFinderImpl

public ReflectFinderImpl()
Method Detail

findConstructor

public Constructor findConstructor(Class p_class,
                                   Class[] p_types)
                            throws NoSuchMethodException
Description copied from interface: ReflectFinder
Finds the constructor of the given class that accepts parameters of the specified types.

Specified by:
findConstructor in interface ReflectFinder
Parameters:
p_class - the class from which to find the constructor.
p_types - the types of the parameters accepted by the constructor.
Returns:
the constructor that was found.
Throws:
NoSuchMethodException - thrown if no matching constructor was found.

findConstructors

public Constructor[] findConstructors(Class p_class)
Description copied from interface: ReflectFinder
Finds the constructors of the given class.

Specified by:
findConstructors in interface ReflectFinder
Parameters:
p_class - the class from which to find the constructors.
Returns:
the constructors that were found.

findInstanceMethod

public Method findInstanceMethod(Class p_class,
                                 String p_name,
                                 Class[] p_types)
                          throws NoSuchMethodException
Description copied from interface: ReflectFinder
Finds the named instance method of the given class that accepts parameters of the specified types.

Specified by:
findInstanceMethod in interface ReflectFinder
Parameters:
p_class - the class from which to find the method.
p_name - the name of the method.
p_types - the types of the parameters accepted by the method.
Returns:
the instance method that was found.
Throws:
NoSuchMethodException - thrown if no matching method was found.

findInstanceMethods

public Method[] findInstanceMethods(Class p_class,
                                    String p_name)
                             throws NoSuchMethodException
Description copied from interface: ReflectFinder
Finds the named instance methods of the given class.

Specified by:
findInstanceMethods in interface ReflectFinder
Parameters:
p_class - the class from which to find the methods.
p_name - the name of the method.
Returns:
the instance methods that were found.
Throws:
NoSuchMethodException - thrown if no matching methods were found.

findStaticMethod

public Method findStaticMethod(Class p_class,
                               String p_name,
                               Class[] p_types)
                        throws NoSuchMethodException
Description copied from interface: ReflectFinder
Finds the named static method of the given class that accepts parameters of the specified types.

Specified by:
findStaticMethod in interface ReflectFinder
Parameters:
p_class - the class from which to find the method.
p_name - the name of the method.
p_types - the types of the parameters accepted by the method.
Returns:
the static method that was found.
Throws:
NoSuchMethodException - thrown if no matching method was found.

findStaticMethods

public Method[] findStaticMethods(Class p_class,
                                  String p_name)
                           throws NoSuchMethodException
Description copied from interface: ReflectFinder
Finds the named static methods of the given class.

Specified by:
findStaticMethods in interface ReflectFinder
Parameters:
p_class - the class from which to find the methods.
p_name - the name of the method.
Returns:
the static methods that were found.
Throws:
NoSuchMethodException - thrown if no matching methods were found.