/** * <p>Retrieve the property descriptor for the specified property of the * specified bean, or return <code>null</code> if there is no such * descriptor.</p> * * <p>For more details see <code>PropertyUtilsBean</code>.</p> * * @param bean Bean for which a property descriptor is requested * @param name Possibly indexed and/or nested name of the property for * which a property descriptor is requested * @return the property descriptor * * @throws IllegalAccessException if the caller does not have * access to the property accessor method * @throws IllegalArgumentException if <code>bean</code> or * <code>name</code> is null * @throws IllegalArgumentException if a nested reference to a * property returns null * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * propety cannot be found * @see PropertyUtilsBean#getPropertyDescriptor */ public static PropertyDescriptor getPropertyDescriptor(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return PropertyUtilsBean.getInstance().getPropertyDescriptor(bean, name); }
/** * <p>Retrieve the property descriptor for the specified property of the * specified bean, or return <code>null</code> if there is no such * descriptor.</p> * * <p>For more details see <code>PropertyUtilsBean</code>.</p> * * @param bean Bean for which a property descriptor is requested * @param name Possibly indexed and/or nested name of the property for * which a property descriptor is requested * @return the property descriptor * * @throws IllegalAccessException if the caller does not have * access to the property accessor method * @throws IllegalArgumentException if <code>bean</code> or * <code>name</code> is null * @throws IllegalArgumentException if a nested reference to a * property returns null * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * propety cannot be found * @see PropertyUtilsBean#getPropertyDescriptor */ public static PropertyDescriptor getPropertyDescriptor(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return PropertyUtilsBean.getInstance().getPropertyDescriptor(bean, name); }
protected void applyGlobalProperty(Map objects, String property, String value) { for (Object instance : objects.values()) { try { PropertyDescriptor pd = beanUtilsBean.getPropertyUtils().getPropertyDescriptor(instance, property); if (pd != null) { applyProperty(instance, property, value); } } catch (Exception e) { String msg = "Error retrieving property descriptor for instance " + "of type [" + instance.getClass().getName() + "] " + "while setting property [" + property + "]"; throw new ConfigurationException(msg, e); } } }
protected boolean isTypedProperty(Object object, String propertyName, Class clazz) { if (clazz == null) { throw new NullPointerException("type (class) argument cannot be null."); } try { PropertyDescriptor descriptor = beanUtilsBean.getPropertyUtils().getPropertyDescriptor(object, propertyName); if (descriptor == null) { String msg = "Property '" + propertyName + "' does not exist for object of " + "type " + object.getClass().getName() + "."; throw new ConfigurationException(msg); } Class propertyClazz = descriptor.getPropertyType(); return clazz.isAssignableFrom(propertyClazz); } catch (ConfigurationException ce) { //let it propagate: throw ce; } catch (Exception e) { String msg = "Unable to determine if property [" + propertyName + "] represents a " + clazz.getName(); throw new ConfigurationException(msg, e); } }
getPropertyDescriptor(bean, name); if (descriptor != null) { return (descriptor.getPropertyEditorClass());
getPropertyDescriptor(bean, name); if (descriptor != null) { return (descriptor.getPropertyEditorClass());
getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
final PropertyDescriptor descriptor = getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
final PropertyDescriptor descriptor = getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
getPropertyDescriptor(bean, name); if (descriptor == null) { throw new NoSuchMethodException("Unknown property '" +
getPropertyDescriptor(bean, name); if (descriptor == null) { return (null);
try { descriptor = getPropertyUtils().getPropertyDescriptor(target, name); if (descriptor == null) { return null; // Skip this property setter
try { descriptor = getPropertyUtils().getPropertyDescriptor(target, name); if (descriptor == null) { return null; // Skip this property setter
try { final PropertyDescriptor desc = getPropertyDescriptor(bean, name); if (desc != null) { Method writeMethod = getWriteMethod(bean.getClass(), desc);
try { final PropertyDescriptor desc = getPropertyDescriptor(bean, name); if (desc != null) { Method readMethod = getReadMethod(bean.getClass(), desc);
try { final PropertyDescriptor desc = getPropertyDescriptor(bean, name); if (desc != null) { Method readMethod = getReadMethod(bean.getClass(), desc);
try { final PropertyDescriptor desc = getPropertyDescriptor(bean, name); if (desc != null) { Method writeMethod = getWriteMethod(bean.getClass(), desc);