net.sf.gilead.util
Class IntrospectionHelper

java.lang.Object
  extended by net.sf.gilead.util.IntrospectionHelper

public class IntrospectionHelper
extends java.lang.Object

Singleton for instrospection search

Author:
bruno.marchesson

Constructor Summary
IntrospectionHelper()
           
 
Method Summary
static java.lang.reflect.Field[] getRecursiveDeclaredFields(java.lang.Class<?> clazz)
          Recursively get declared fields
static java.lang.reflect.Method getRecursiveDeclaredMethod(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>... parameterTypes)
          Recursively find declared method with the argument name Important notice : does not check parameters types since it is used for searching getter and setter !
static java.lang.Object searchMember(java.lang.Class<?> clazz, java.lang.Object root)
          Search nested class from the attributes of the argument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntrospectionHelper

public IntrospectionHelper()
Method Detail

getRecursiveDeclaredFields

public static java.lang.reflect.Field[] getRecursiveDeclaredFields(java.lang.Class<?> clazz)
Recursively get declared fields


getRecursiveDeclaredMethod

public static java.lang.reflect.Method getRecursiveDeclaredMethod(java.lang.Class<?> clazz,
                                                                  java.lang.String methodName,
                                                                  java.lang.Class<?>... parameterTypes)
                                                           throws java.lang.NoSuchMethodException
Recursively find declared method with the argument name Important notice : does not check parameters types since it is used for searching getter and setter !

Throws:
java.lang.NoSuchMethodException

searchMember

public static java.lang.Object searchMember(java.lang.Class<?> clazz,
                                            java.lang.Object root)
Search nested class from the attributes of the argument

Parameters:
clazz - the searched class
root - the root object
Returns:
the object if found, null otherwise