Class ReflectionHelper
- java.lang.Object
- 
- org.optaplanner.core.impl.domain.common.ReflectionHelper
 
- 
 public final class ReflectionHelper extends Object Avoids the usage of Introspector to work on Android too.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertGetterMethod(Method getterMethod, Class<? extends Annotation> annotationClass)static voidassertReadMethod(Method readMethod, Class<? extends Annotation> annotationClass)static FieldgetField(Class<?> containingClass, String fieldName)static 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 booleanhasField(Class<?> containingClass, String fieldName)static 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 booleanisList(Type type)static booleanisMap(Type type)static booleanisMethodOverwritten(Method parentMethod, Class<?> childClass)static List<Object>transformArrayToList(Object arrayObject)
 
- 
- 
- 
Method Detail- 
getGetterPropertyNamepublic static String getGetterPropertyName(Member member) Returns 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
 
 - 
isGetterMethodpublic static boolean isGetterMethod(Method method) Checks 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
 
 - 
hasGetterMethodpublic static boolean hasGetterMethod(Class<?> containingClass, String propertyName) - Parameters:
- containingClass- never null
- propertyName- never null
- Returns:
- true if that getter exists
 
 - 
getGetterMethodpublic static Method getGetterMethod(Class<?> containingClass, String propertyName) - Parameters:
- containingClass- never null
- propertyName- never null
- Returns:
- sometimes null
 
 - 
hasFieldpublic static boolean hasField(Class<?> containingClass, String fieldName) - Parameters:
- containingClass- never null
- fieldName- never null
- Returns:
- true if that field exists
 
 - 
getFieldpublic static Field getField(Class<?> containingClass, String fieldName) - 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
 
 - 
getSetterMethodpublic static Method getSetterMethod(Class<?> containingClass, String propertyName) - Parameters:
- containingClass- never null
- propertyName- never null
- Returns:
- null if it doesn't exist
 
 - 
isMethodOverwrittenpublic static boolean isMethodOverwritten(Method parentMethod, Class<?> childClass) 
 - 
assertGetterMethodpublic static void assertGetterMethod(Method getterMethod, Class<? extends Annotation> annotationClass) 
 - 
assertReadMethodpublic static void assertReadMethod(Method readMethod, Class<? extends Annotation> annotationClass) 
 - 
isMappublic static boolean isMap(Type type) - Parameters:
- type- never null
- Returns:
- true if it is a Map
 
 - 
isListpublic static boolean isList(Type type) - Parameters:
- type- never null
- Returns:
- true if it is a List
 
 
- 
 
-