/** * Return the value of a simple property with the specified name. * * @param name Name of the property whose value is to be retrieved * @return The property's value * * @throws IllegalArgumentException if there is no property * of the specified name */ public Object get(final String name) { Object value = null; try { value = getPropertyUtils().getSimpleProperty(instance, name); } catch (final InvocationTargetException ite) { final Throwable cause = ite.getTargetException(); throw new IllegalArgumentException ("Error reading property '" + name + "' nested exception - " + cause); } catch (final Throwable t) { throw new IllegalArgumentException ("Error reading property '" + name + "', exception - " + t); } return (value); }
/** * <p>Return the value of the specified simple property of the specified * bean, with no type conversions.</p> * * <p>For more details see <code>PropertyUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @return The property value * * @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 the property name * is nested or indexed * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * propety cannot be found * @see PropertyUtilsBean#getSimpleProperty */ public static Object getSimpleProperty(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return PropertyUtilsBean.getInstance().getSimpleProperty(bean, name); }
/** * Return the value of a simple property with the specified name. * * @param name Name of the property whose value is to be retrieved * @return The property's value * * @throws IllegalArgumentException if there is no property * of the specified name */ public Object get(final String name) { Object value = null; try { value = getPropertyUtils().getSimpleProperty(instance, name); } catch (final InvocationTargetException ite) { final Throwable cause = ite.getTargetException(); throw new IllegalArgumentException ("Error reading property '" + name + "' nested exception - " + cause); } catch (final Throwable t) { throw new IllegalArgumentException ("Error reading property '" + name + "', exception - " + t); } return (value); }
/** * <p>Return the value of the specified simple property of the specified * bean, with no type conversions.</p> * * <p>For more details see <code>PropertyUtilsBean</code>.</p> * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @return The property value * * @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 the property name * is nested or indexed * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * propety cannot be found * @see PropertyUtilsBean#getSimpleProperty */ public static Object getSimpleProperty(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return PropertyUtilsBean.getInstance().getSimpleProperty(bean, name); }
/** * Return the value of the specified simple property of the specified * bean, converted to a String. * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @return The property's value, converted to a String * * @throws IllegalAccessException if the caller does not have * access to the property accessor method * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * property cannot be found */ public String getSimpleProperty(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Object value = getPropertyUtils().getSimpleProperty(bean, name); return (getConvertUtils().convert(value)); }
/** * Return the value of the specified simple property of the specified * bean, converted to a String. * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @return The property's value, converted to a String * * @throws IllegalAccessException if the caller does not have * access to the property accessor method * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * property cannot be found */ public String getSimpleProperty(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Object value = getPropertyUtils().getSimpleProperty(bean, name); return (getConvertUtils().convert(value)); }
/** * Return the value of the specified simple locale-sensitive property * of the specified bean, converted to a String using the specified * conversion pattern. * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @param pattern The conversion pattern * @return The property's value, converted to a String * * @throws IllegalAccessException if the caller does not have * access to the property accessor method * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * property cannot be found */ public String getSimpleProperty(final Object bean, final String name, final String pattern) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Object value = getPropertyUtils().getSimpleProperty(bean, name); return getLocaleConvertUtils().convert(value, pattern); }
/** * Return the value of the specified simple locale-sensitive property * of the specified bean, converted to a String using the specified * conversion pattern. * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @param pattern The conversion pattern * @return The property's value, converted to a String * * @throws IllegalAccessException if the caller does not have * access to the property accessor method * @throws InvocationTargetException if the property accessor method * throws an exception * @throws NoSuchMethodException if an accessor method for this * property cannot be found */ public String getSimpleProperty(final Object bean, final String name, final String pattern) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Object value = getPropertyUtils().getSimpleProperty(bean, name); return getLocaleConvertUtils().convert(value, pattern); }
if (isReadable(orig, name) && isWriteable(dest, name)) { try { final Object value = getSimpleProperty(orig, name); if (dest instanceof DynaBean) { ((DynaBean) dest).set(name, value);
if (isReadable(orig, name) && isWriteable(dest, name)) { try { final Object value = getSimpleProperty(orig, name); if (dest instanceof DynaBean) { ((DynaBean) dest).set(name, value);
nestedBean = getIndexedProperty(bean, next); } else { nestedBean = getSimpleProperty(bean, next); bean = getIndexedProperty(bean, name); } else { bean = getSimpleProperty(bean, name);
nestedBean = getIndexedProperty(bean, next); } else { nestedBean = getSimpleProperty(bean, next); bean = getIndexedProperty(bean, name); } else { bean = getSimpleProperty(bean, name);
try { final Object value = getPropertyUtils().getSimpleProperty(orig, name); copyProperty(dest, name, value); } catch (final NoSuchMethodException e) {
try { final Object value = getPropertyUtils().getSimpleProperty(orig, name); copyProperty(dest, name, value); } catch (final NoSuchMethodException e) {
nestedBean = getIndexedProperty(bean, next); } else { nestedBean = getSimpleProperty(bean, next);
nestedBean = getIndexedProperty(bean, next); } else { nestedBean = getSimpleProperty(bean, next);
@Override public Object getSimpleProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException{ Object object = super.getSimpleProperty(bean, name); if (object instanceof Enum) { object = object.toString(); } return object; } }
public Object getValue( String propertyName ) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { if ( logger.isTraceEnabled() ) { logger.trace( MessageFormat.format( "getting property \"{0}\" from bean \"{1}\"", propertyName, bean ) ); //$NON-NLS-1$ } return propUtil.getSimpleProperty( bean, propertyName ); }
/** * Return the value of the specified simple locale-sensitive property * of the specified bean, converted to a String using the specified * conversion pattern. * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @param pattern The conversion pattern * @return The property's value, converted to a String * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * propety cannot be found */ public String getSimpleProperty(Object bean, String name, String pattern) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { Object value = getPropertyUtils().getSimpleProperty(bean, name); return getLocaleConvertUtils().convert(value, pattern); }
/** * Return the value of the specified simple property of the specified * bean, converted to a String. * * @param bean Bean whose property is to be extracted * @param name Name of the property to be extracted * @return The property's value, converted to a String * * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception InvocationTargetException if the property accessor method * throws an exception * @exception NoSuchMethodException if an accessor method for this * property cannot be found */ public String getSimpleProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { Object value = getPropertyUtils().getSimpleProperty(bean, name); return (getConvertUtils().convert(value)); }