Class BeanReflectionHelper
java.lang.Object
org.glassfish.hk2.utilities.reflection.BeanReflectionHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertJavaBeanToBeanLikeMap
(ClassReflectionHelper helper, Object bean) Converts a Java bean to a bean-like Mapprivate static Method
findMethod
(Method m, Class<?> c) static String
getBeanPropertyNameFromGetter
(Method method) Returns the bean version of the property name if the method is a getter, or returns null if the method is not a getterstatic PropertyChangeEvent[]
getChangeEvents
(ClassReflectionHelper helper, Object oldBean, Object newBean) Gets the set of change events by comparing two different beans.private static PropertyChangeEvent[]
private static Object
private static String
Returns the property name if this is a getterprivate static String
isAGetter
(MethodWrapper method) Returns the property name if this is a getter
-
Field Details
-
GET
- See Also:
-
IS
- See Also:
-
-
Constructor Details
-
BeanReflectionHelper
public BeanReflectionHelper()
-
-
Method Details
-
getBeanPropertyNameFromGetter
Returns the bean version of the property name if the method is a getter, or returns null if the method is not a getter- Parameters:
method
- The method to get the property name from- Returns:
- The java-bean version of the property name or null if the method is not a java-bean getter
-
isAGetter
Returns the property name if this is a getter- Parameters:
method
- The method to investigate for being a property- Returns:
- The property name or null if not a getter
-
isAGetter
Returns the property name if this is a getter- Parameters:
method
- The method to investigate for being a property- Returns:
- The property name or null if not a getter
-
findMethod
-
getValue
-
getMapChangeEvents
-
getChangeEvents
public static PropertyChangeEvent[] getChangeEvents(ClassReflectionHelper helper, Object oldBean, Object newBean) Gets the set of change events by comparing two different beans. If the beans implement Map then they are considered to be bean-like maps- Parameters:
helper
- A ClassReflectionHelper to use for analyzing classesoldBean
- a non-null current beannewBean
- a non-null new bean- Returns:
- a possibly zero length but never null list of the change events between the two beans
-
convertJavaBeanToBeanLikeMap
public static Map<String,Object> convertJavaBeanToBeanLikeMap(ClassReflectionHelper helper, Object bean) Converts a Java bean to a bean-like Map- Parameters:
helper
- A ClassReflectionHelper to use for analyzing classesbean
- a non-null bean to convert- Returns:
- a possibly zero length but never null bean-like map. All properties of the bean are filled in, even if the value of the property is null
-