@Test public void testGetPropertyDescriptor() { Map<String, PropertyDescriptor> pds = ObjectPropertyUtils.getPropertyDescriptors(TestBean.class); assertNotNull(pds.get("rwProp")); assertNotNull(pds.get("roProp")); assertNotNull(pds.get("woProp")); assertNull(pds.get("foobar")); }
public static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName) { if (propertyName == null) { throw new IllegalArgumentException("Null property name"); } PropertyDescriptor propertyDescriptor = getPropertyDescriptors(beanClass).get(propertyName); if (propertyDescriptor != null) { return propertyDescriptor; } else { throw new IllegalArgumentException("Property " + propertyName + " not found for bean " + beanClass); } }
ObjectPropertyUtils { public static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName) { if (propertyName == null) { throw new IllegalArgumentException("Null property name"); } PropertyDescriptor propertyDescriptor = getPropertyDescriptors(beanClass).get(propertyName); if (propertyDescriptor != null) { return propertyDescriptor; } else { throw new IllegalArgumentException("Property " + propertyName + " not found for bean " + beanClass); } } }
ObjectPropertyUtils { public static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName) { if (propertyName == null) { throw new IllegalArgumentException("Null property name"); } PropertyDescriptor propertyDescriptor = getPropertyDescriptors(beanClass).get(propertyName); if (propertyDescriptor != null) { return propertyDescriptor; } else { throw new IllegalArgumentException("Property " + propertyName + " not found for bean " + beanClass); } } private  ObjectPropertyUtils(); }
ObjectPropertyUtils { public static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName) { if (propertyName == null) { throw new IllegalArgumentException("Null property name"); } PropertyDescriptor propertyDescriptor = getPropertyDescriptors(beanClass).get(propertyName); if (propertyDescriptor != null) { return propertyDescriptor; } else { throw new IllegalArgumentException("Property " + propertyName + " not found for bean " + beanClass); } } private  ObjectPropertyUtils(); static Map<String, PropertyDescriptor> getPropertyDescriptors(Class<?> beanClass); static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName); static void registerPropertyEditors(PropertyEditorRegistry registry); static Set<String> getReadablePropertyNames(Class<?> beanClass); static Method getReadMethod(Class<?> beanClass, String propertyName); static Method getWriteMethod(Class<?> beanClass, String propertyName); static void copyPropertiesToObject(Map<String, String> properties, Object object); static Class<?> getPropertyType(Class<?> beanClass, String propertyPath); static Class<?> getPropertyType(Object object, String propertyPath); static Set<String> getReadablePropertyNamesByType(Object bean, Class<?> propertyType); static Set<String> getReadablePropertyNamesByType(Class<?> beanClass, Class<?> propertyType); static Set<String> getReadablePropertyNamesByAnnotationType(Object bean,
            Class<? extends Annotation> annotationType); static Set<String> getReadablePropertyNamesByAnnotationType(
            Class<?> beanClass, Class<? extends Annotation> annotationType); static Set<String> getReadablePropertyNamesByCollectionType(Object bean, Class<?> collectionType); static Set<String> getWritablePropertyNames(Object bean); static Set<String> getReadablePropertyNamesByCollectionType(Class<?> beanClass, Class<?> collectionType); @SuppressWarnings("unchecked") static T getPropertyValue(Object object, String propertyPath); static String getPropertyValueAsText(Object bean, String path); static PropertyEditorRegistry getPropertyEditorRegistry(); static Class<?> getPrimitiveType(Class<?> type); static PropertyEditor getPropertyEditor(Object bean, String path); static PropertyEditor getPropertyEditor(Class<?> propertyType); static void initializeProperty(Object object, String propertyPath); static void setPropertyValue(Object object, String propertyPath, Object propertyValue); static void setPropertyValue(Object object, String propertyPath, Object propertyValue, boolean ignoreUnknown); static boolean isReadableProperty(Object object, String propertyPath); static boolean isWritableProperty(Object object, String propertyPath); static List<Field> getAllFields(List<Field> fields, Class<?> type, Class<?> stopAt); static Type getComponentType(Type type); static Class<?> getUpperBound(Type valueType); static Type findGenericType(Class<?> sourceClass, Class<?> targetClass); static String[] splitPropertyPath(String path); static String getPathTail(String path); static String removePathTail(String path); static String getCanonicalPath(String path); }
ObjectPropertyUtils { public static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName) { if (propertyName == null) { throw new IllegalArgumentException("Null property name"); } PropertyDescriptor propertyDescriptor = getPropertyDescriptors(beanClass).get(propertyName); if (propertyDescriptor != null) { return propertyDescriptor; } else { throw new IllegalArgumentException("Property " + propertyName + " not found for bean " + beanClass); } } private  ObjectPropertyUtils(); static Map<String, PropertyDescriptor> getPropertyDescriptors(Class<?> beanClass); static PropertyDescriptor getPropertyDescriptor(Class<?> beanClass, String propertyName); static void registerPropertyEditors(PropertyEditorRegistry registry); static Set<String> getReadablePropertyNames(Class<?> beanClass); static Method getReadMethod(Class<?> beanClass, String propertyName); static Method getWriteMethod(Class<?> beanClass, String propertyName); static void copyPropertiesToObject(Map<String, String> properties, Object object); static Class<?> getPropertyType(Class<?> beanClass, String propertyPath); static Class<?> getPropertyType(Object object, String propertyPath); static Set<String> getReadablePropertyNamesByType(Object bean, Class<?> propertyType); static Set<String> getReadablePropertyNamesByType(Class<?> beanClass, Class<?> propertyType); static Set<String> getReadablePropertyNamesByAnnotationType(Object bean,
            Class<? extends Annotation> annotationType); static Set<String> getReadablePropertyNamesByAnnotationType(
            Class<?> beanClass, Class<? extends Annotation> annotationType); static Set<String> getReadablePropertyNamesByCollectionType(Object bean, Class<?> collectionType); static Set<String> getWritablePropertyNames(Object bean); static Set<String> getReadablePropertyNamesByCollectionType(Class<?> beanClass, Class<?> collectionType); @SuppressWarnings("unchecked") static T getPropertyValue(Object object, String propertyPath); static String getPropertyValueAsText(Object bean, String path); static PropertyEditorRegistry getPropertyEditorRegistry(); static Class<?> getPrimitiveType(Class<?> type); static PropertyEditor getPropertyEditor(Object bean, String path); static PropertyEditor getPropertyEditor(Class<?> propertyType); static void initializeProperty(Object object, String propertyPath); static void setPropertyValue(Object object, String propertyPath, Object propertyValue); static void setPropertyValue(Object object, String propertyPath, Object propertyValue, boolean ignoreUnknown); static boolean isReadableProperty(Object object, String propertyPath); static boolean isWritableProperty(Object object, String propertyPath); static List<Field> getAllFields(List<Field> fields, Class<?> type, Class<?> stopAt); static Type getComponentType(Type type); static Class<?> getUpperBound(Type valueType); static Type findGenericType(Class<?> sourceClass, Class<?> targetClass); static String[] splitPropertyPath(String path); static String getPathTail(String path); static String removePathTail(String path); static String getCanonicalPath(String path);  }