I sent off a mail to the CGLib alias to see if there is any workaround.
I am still a bit perplexed about the differences between
BeanUtilBean.copyProperties and PropertyUtilBean.copyProperties, why are
they different? Why are there two? I noticed that the copyProperties
in BeanUtilBean is more complicated (in that it can deal with
expressions) but copyProperties will never actually send it expressions
any more complicated than property name. The only other difference I
see is that BeanUtilBean.copyProperty will try to convert a property in
the case you have same name different types rather then just exploding.
Is there a reason PropertyUtilBean.copyProperties does not want to convert?
--Will
Wendy Smoak wrote:
From: "Will Pugh" <[EMAIL PROTECTED]>
I ran into a problem when using CGLib and Beanutils. The gist seems to
be CGLib adds a number of getters and setters, but in particularly, it
adds
Callback[] getCallbacks()
void setCallbacks(Callback[])
Callback getCallback(int)
void setCallback(Callback)
It seems a little troubling that they dropped the "s" in the singular
case (since they end up working with the same properties anyways).
More than troubling. A class with these methods is not compliant with the
JavaBeans specification, so BeanUtils can't be expected to work right.
This will be seen as two separate properties. The Callback[] pair is fine.
The other pair of methods, taken by themselves, aren't valid due to the
'int' parameter in the 'get' method.
Do you have any control over this code? IMO it needs to be changed to
four methods with the same property name and the proper signatures for an
indexed property:
From Section 7.2 of the JavaBeans 1.01 Specification:
For indexed properties the accessor type signatures are:
void setter(int index, PropertyType value); // indexed setter
PropertyType getter(int index); // indexed getter
void setter(PropertyType values[]); // array setter
PropertyType[] getter(); // array getter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]