Class ReflectionHelper
java.lang.Object
org.optaplanner.core.impl.domain.common.ReflectionHelper
Avoids the usage of Introspector to work on Android too.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidassertGetterMethod(Method getterMethod, Class<? extends Annotation> annotationClass) static voidassertReadMethod(Method readMethod, Class<? extends Annotation> annotationClass) static Fieldstatic MethodgetGetterMethod(Class<?> containingClass, String propertyName) static StringgetGetterPropertyName(Member member) Returns the JavaBeans property name of the given member.static MethodgetSetterMethod(Class<?> containingClass, Class<?> propertyType, String propertyName) static MethodgetSetterMethod(Class<?> containingClass, String propertyName) static booleanstatic booleanhasGetterMethod(Class<?> containingClass, String propertyName) static booleanisGetterMethod(Method method) Checks whether the given method is a valid getter method according to the JavaBeans standard.static booleanstatic booleanstatic booleanisMethodOverwritten(Method parentMethod, Class<?> childClass) transformArrayToList(Object arrayObject) 
- 
Method Details- 
getGetterPropertyNameReturns the JavaBeans property name of the given member.- Parameters:
- member- never null
- Returns:
- null if the member is neither a field nor a getter method according to the JavaBeans standard
 
- 
isGetterMethodChecks whether the given method is a valid getter method according to the JavaBeans standard.- Parameters:
- method- never null
- Returns:
- true if the given method is a getter method
 
- 
hasGetterMethod- Parameters:
- containingClass- never null
- propertyName- never null
- Returns:
- true if that getter exists
 
- 
getGetterMethod- Parameters:
- containingClass- never null
- propertyName- never null
- Returns:
- sometimes null
 
- 
hasField- Parameters:
- containingClass- never null
- fieldName- never null
- Returns:
- true if that field exists
 
- 
getField- Parameters:
- containingClass- never null
- fieldName- never null
- Returns:
- sometimes null
 
- 
getSetterMethodpublic static Method getSetterMethod(Class<?> containingClass, Class<?> propertyType, String propertyName) - Parameters:
- containingClass- never null
- propertyType- never null
- propertyName- never null
- Returns:
- null if it doesn't exist
 
- 
getSetterMethod- Parameters:
- containingClass- never null
- propertyName- never null
- Returns:
- null if it doesn't exist
 
- 
isMethodOverwritten
- 
assertGetterMethodpublic static void assertGetterMethod(Method getterMethod, Class<? extends Annotation> annotationClass) 
- 
assertReadMethod
- 
isMap- Parameters:
- type- never null
- Returns:
- true if it is a Map
 
- 
isList- Parameters:
- type- never null
- Returns:
- true if it is a List
 
- 
transformArrayToList
 
-