info.javelot.functionalj.reflect.helper
Interface ReflectFinder

All Known Implementing Classes:
ReflectFinderImpl

public interface ReflectFinder

Interface to define a way to find Constructors and Methods using reflection.

Author:
Copyright © 2006 Frederic Daoud

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.
 

Method Detail

findConstructor

Constructor findConstructor(Class p_class,
                            Class[] p_types)
                            throws NoSuchMethodException
Finds the constructor of the given class that accepts parameters of the specified types.

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

Constructor[] findConstructors(Class p_class)
                               throws NoSuchMethodException
Finds the constructors of the given class.

Parameters:
p_class - the class from which to find the constructors.
Returns:
the constructors that were found.
Throws:
NoSuchMethodException - thrown if no constructors were found.

findInstanceMethod

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

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

Method[] findInstanceMethods(Class p_class,
                             String p_name)
                             throws NoSuchMethodException
Finds the named instance methods of the given class.

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

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

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

Method[] findStaticMethods(Class p_class,
                           String p_name)
                           throws NoSuchMethodException
Finds the named static methods of the given class.

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.