org.apache.xbean.recipe
Class ReflectionUtil

java.lang.Object
  extended by org.apache.xbean.recipe.ReflectionUtil

public final class ReflectionUtil
extends Object


Nested Class Summary
static class ReflectionUtil.ConstructorFactory
           
static interface ReflectionUtil.Factory
           
static class ReflectionUtil.StaticFactory
           
 
Method Summary
static List<Field> findAllFieldsByType(Class typeClass, Object propertyValue, Set<Option> options)
           
static List<Method> findAllSetters(Class typeClass, String propertyName, Object propertyValue, Set<Option> options)
          Finds all valid setters for the property.
static List<Method> findAllSettersByType(Class typeClass, Object propertyValue, Set<Option> options)
           
static ReflectionUtil.ConstructorFactory findConstructor(Class typeClass, List<? extends Class<?>> parameterTypes, Set<Option> options)
           
static ReflectionUtil.ConstructorFactory findConstructor(Class typeClass, List<String> parameterNames, List<? extends Class<?>> parameterTypes, Set<String> availableProperties, Set<Option> options)
           
static Field findField(Class typeClass, String propertyName, Object propertyValue, Set<Option> options)
           
static Method findGetter(Class typeClass, String propertyName, Set<Option> options)
           
static Method findInstanceFactory(Class typeClass, String factoryMethod, Set<Option> options)
           
static Method findSetter(Class typeClass, String propertyName, Object propertyValue, Set<Option> options)
           
static ReflectionUtil.StaticFactory findStaticFactory(Class typeClass, String factoryMethod, List<? extends Class<?>> parameterTypes, Set<Option> options)
           
static ReflectionUtil.StaticFactory findStaticFactory(Class typeClass, String factoryMethod, List<String> parameterNames, List<? extends Class<?>> parameterTypes, Set<String> allProperties, Set<Option> options)
           
static List<String> getParameterNames(Constructor<?> constructor)
           
static List<String> getParameterNames(Method method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findField

public static Field findField(Class typeClass,
                              String propertyName,
                              Object propertyValue,
                              Set<Option> options)

findGetter

public static Method findGetter(Class typeClass,
                                String propertyName,
                                Set<Option> options)

findSetter

public static Method findSetter(Class typeClass,
                                String propertyName,
                                Object propertyValue,
                                Set<Option> options)

findAllSetters

public static List<Method> findAllSetters(Class typeClass,
                                          String propertyName,
                                          Object propertyValue,
                                          Set<Option> options)
Finds all valid setters for the property. Due to automatic type conversion there may be more than one possible setter that could be used to set the property. The setters that do not require type converstion will be a the head of the returned list of setters.

Parameters:
typeClass - the class to search for setters
propertyName - the name of the property
propertyValue - the value that must be settable either directly or after conversion
options - controls which setters are considered valid
Returns:
the valid setters; never null or empty

findAllFieldsByType

public static List<Field> findAllFieldsByType(Class typeClass,
                                              Object propertyValue,
                                              Set<Option> options)

findAllSettersByType

public static List<Method> findAllSettersByType(Class typeClass,
                                                Object propertyValue,
                                                Set<Option> options)

findConstructor

public static ReflectionUtil.ConstructorFactory findConstructor(Class typeClass,
                                                                List<? extends Class<?>> parameterTypes,
                                                                Set<Option> options)

findConstructor

public static ReflectionUtil.ConstructorFactory findConstructor(Class typeClass,
                                                                List<String> parameterNames,
                                                                List<? extends Class<?>> parameterTypes,
                                                                Set<String> availableProperties,
                                                                Set<Option> options)

findStaticFactory

public static ReflectionUtil.StaticFactory findStaticFactory(Class typeClass,
                                                             String factoryMethod,
                                                             List<? extends Class<?>> parameterTypes,
                                                             Set<Option> options)

findStaticFactory

public static ReflectionUtil.StaticFactory findStaticFactory(Class typeClass,
                                                             String factoryMethod,
                                                             List<String> parameterNames,
                                                             List<? extends Class<?>> parameterTypes,
                                                             Set<String> allProperties,
                                                             Set<Option> options)

findInstanceFactory

public static Method findInstanceFactory(Class typeClass,
                                         String factoryMethod,
                                         Set<Option> options)

getParameterNames

public static List<String> getParameterNames(Constructor<?> constructor)

getParameterNames

public static List<String> getParameterNames(Method method)


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.