commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: [Digester] Digester does not seem to me to make use of StringArrayConverter (Test case here)
Date Fri, 06 Jan 2006 08:33:31 GMT
On Thu, 2006-01-05 at 12:48 +0100, Alessio Pace wrote:
> Well, so here 2 tests, hope it is what you meant:
> 
> -the first uses ConvertUtils and passes
> -the second uses BeanUtils and fails

Yes, that is what I meant. I was a little surprised at your results, so
wrote an independent test myself, and came to the same conclusion:
ConvertUtils supports String->String[], but BeanUtils just doesn't call
the converter.

I would tend to regard that as a bug in BeanUtils, but that's no help to
you. Registering a converter to solve your original problem is obviously
not going to work. 

You might try using CallMethodRule rather than BeanPropertySetter; that
rule optionally takes an array of paramtypes, and converts all its
inputs to those types before invoking the target method. It's meant
really for cases where the target method takes some interface or
abstract type but may well cause the ConvertUtils.convert to be
executed.

Otherwise it looks like you'll have to use a custom Rule class after
all..

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message