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
private static final class
static class
-
Constructor Summary
Constructors -
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) private static boolean
isClassAvailable
(String className) private static void
setAccessible
(AccessibleObject accessibleObject) private static String
toParameterList
(Class<?>[] parameterTypes) private static String
toParameterList
(List<? extends Class<?>> parameterTypes)
-
Constructor Details
-
ReflectionUtil
private ReflectionUtil()
-
-
Method Details
-
isClassAvailable
-
findField
-
findGetter
-
findSetter
-
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
-
findAllSettersByType
-
findConstructor
-
findConstructor
-
findStaticFactory
-
findStaticFactory
-
findInstanceFactory
-
getParameterNames
-
getParameterNames
-
setAccessible
-
toParameterList
-
toParameterList
-