Package org.apache.xbean.recipe
Class ReflectionUtil
java.lang.Object
org.apache.xbean.recipe.ReflectionUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
static class
-
Method Summary
Modifier and TypeMethodDescriptionfindAllFieldsByType
(Class typeClass, Object propertyValue, Set<Option> options, PropertyEditorRegistry registry) findAllSetters
(Class typeClass, String propertyName, Object propertyValue, Set<Option> options, PropertyEditorRegistry registry) Finds all valid setters for the property.findAllSettersByType
(Class typeClass, Object propertyValue, Set<Option> options, PropertyEditorRegistry registry) 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, PropertyEditorRegistry registry) 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, PropertyEditorRegistry registry) 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) getParameterNames
(Constructor<?> constructor) getParameterNames
(Method method)
-
Method Details
-
findField
-
findGetter
-
findSetter
public static Method findSetter(Class typeClass, String propertyName, Object propertyValue, Set<Option> options, PropertyEditorRegistry registry) -
findAllSetters
public static List<Method> findAllSetters(Class typeClass, String propertyName, Object propertyValue, Set<Option> options, PropertyEditorRegistry registry) 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 setterspropertyName
- the name of the propertypropertyValue
- the value that must be settable either directly or after conversionoptions
- 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, PropertyEditorRegistry registry) -
findAllSettersByType
public static List<Method> findAllSettersByType(Class typeClass, Object propertyValue, Set<Option> options, PropertyEditorRegistry registry) -
findConstructor
public static ReflectionUtil.ConstructorFactory findConstructor(Class typeClass, List<? extends Class<?>> parameterTypes, Set<Option> options) -
findConstructor
-
findStaticFactory
public static ReflectionUtil.StaticFactory findStaticFactory(Class typeClass, String factoryMethod, List<? extends Class<?>> parameterTypes, Set<Option> options) -
findStaticFactory
-
findInstanceFactory
-
getParameterNames
-
getParameterNames
-