de.unkrig.commons.reflect
Class ReflectUtil

java.lang.Object
  extended by de.unkrig.commons.reflect.ReflectUtil

public final class ReflectUtil
extends java.lang.Object

Various java.lang.reflect-related utility methods.


Method Summary
static java.lang.reflect.Constructor<?> getMostSpecificConstructor(java.lang.Class<?> type, java.lang.Class<?>[] argumentTypes)
           
static java.lang.reflect.Method getMostSpecificMethod(java.lang.Class<?> targetType, java.lang.String methodName, java.lang.Class<?>[] argumentTypes)
           
static java.lang.Class<?>[] getTypes(java.util.List<java.lang.Object> values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTypes

public static java.lang.Class<?>[] getTypes(java.util.List<java.lang.Object> values)
Returns:
The types of the values

getMostSpecificMethod

public static java.lang.reflect.Method getMostSpecificMethod(java.lang.Class<?> targetType,
                                                             java.lang.String methodName,
                                                             java.lang.Class<?>[] argumentTypes)
                                                      throws java.lang.NoSuchMethodException
Returns:
The most specific applicable public method of the targetType
Throws:
java.lang.NoSuchMethodException - No applicable method exists
java.lang.NoSuchMethodException - Two or more applicable methods exist, and none is more specific than all others

getMostSpecificConstructor

public static java.lang.reflect.Constructor<?> getMostSpecificConstructor(java.lang.Class<?> type,
                                                                          java.lang.Class<?>[] argumentTypes)
                                                                   throws java.lang.NoSuchMethodException
Returns:
The most specific applicable constructor of the type
Throws:
java.lang.NoSuchMethodException - No applicable constructor exists
java.lang.NoSuchMethodException - Two or more applicable constructors exist, and none is more specific than all others