How come PropertyUtils.setSimpleProperty (¡K) doesn¡¦t have a PropertyEditor
built in?

It would be nice to have something like this.


public static void setSimpleProperty(Object bean, String name, Object value)
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {

    ¡K..,,, codes ¡K..

    PropertyEditor editor =
PropertyEditorManager.findEditor(descriptor.getPropertyType());
    try {
        if (editor != null) {
            editor.setValue(values[0]);
            values[0] = editor.getValue();
        }
    }
    catch (Exception e) {
        e.printStackTrace(System.out);
    }

writeMethod.invoke(bean, values);
}




Reply via email to