You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Niall Pemberton <ni...@blueyonder.co.uk> on 2003/10/13 17:49:29 UTC
[beanutils] [PATCH] WrapDynaBean enhancement
I submitted a Bugzilla enhancement request (including a PATCH) for the WrapDynaBean and WrapDynaClass:
http://issues.apache.org/bugzilla/show_bug.cgi?id=23690
The changes I would like are:
1) Provide a "getter" for the wrapped JavaBean instance.
2) Imlement newInstance() method in WrapDynaClass (currently throws "unsupported" exception).
3) The get(name) and set(name, value) methods trap exceptions and output a (possibly) misleading IllegalArgumentException, also these methods can be made more efficient by using the PropertyDescriptor already stored in WrapDynaClass to execute the underlying method rather than using the PropertyUtils which generates a PropertyDescriptor each time these methods are called.
An example of the mis-leading exception was if you call the set(name, value) method for an java.lang.Integer property with a java.lang.String value then PropertyUtils.setSimpleProperty() throws an IllegalArgumentException with the message "argument type mismatch", however WrapDynaBean catches this and throws an IllegalArgumentException with the message "Property '[name]' has no write method".
Thanks
Niall