Class Introspection
- java.lang.Object
-
- org.assertj.core.util.introspection.Introspection
-
public final class Introspection extends Object
Utility methods related to JavaBeans Introspection.- Author:
- Alex Ruiz
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanbareNamePropertyMethods
-
Constructor Summary
Constructors Modifier Constructor Description privateIntrospection()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanIntrospectExtractBareNamePropertyMethods()private static MethodfindGetter(String propertyName, Object target)private static MethodfindMethod(String name, Object target)static MethodgetPropertyGetter(String propertyName, Object target)Returns the getterMethodfor a property matching the given name in the given object.private static booleanisValidGetter(Method method)private static StringpropertyNotFoundErrorMessage(String propertyName, Object target)static voidsetExtractBareNamePropertyMethods(boolean barenamePropertyMethods)
-
-
-
Method Detail
-
getPropertyGetter
public static Method getPropertyGetter(String propertyName, Object target)
Returns the getterMethodfor a property matching the given name in the given object.- Parameters:
propertyName- the given property name.target- the given object.- Returns:
- the getter
Methodfor a property matching the given name in the given object. - Throws:
NullPointerException- if the given property name isnull.IllegalArgumentException- if the given property name is empty.NullPointerException- if the given object isnull.IntrospectionError- if the getter for the matching property cannot be found or accessed.
-
setExtractBareNamePropertyMethods
public static void setExtractBareNamePropertyMethods(boolean barenamePropertyMethods)
-
canIntrospectExtractBareNamePropertyMethods
public static boolean canIntrospectExtractBareNamePropertyMethods()
-
propertyNotFoundErrorMessage
private static String propertyNotFoundErrorMessage(String propertyName, Object target)
-
isValidGetter
private static boolean isValidGetter(Method method)
-
-