commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohan Kishore <mohankish...@yahoo.com>
Subject Re: [Digester] problem calling methods with a primitive parameter
Date Sun, 13 Apr 2003 19:41:08 GMT
--- robert burrell donkin <robertburrelldonkin@blueyonder.co.uk> wrote:
> > I would find the following algo more initutive - any comments:
> > String p = (String) parameters[i];
> > if (paramTypes[i].equals(String.class)) {
> >     paramValues[i] = p;
> > } else if (paramTypes[i].isPrimitive()) {
> >     paramValues[i] = ConvertUtils.convert(p, paramTypes[i]);
> > } else if (parameters[i] != null) {
> >     paramValues[i] = ConvertUtils.convert(p, paramTypes[i]);
> > } else {
> >     paramValues[i] = null;
> > }
> i'm now thinking along the lines that maybe all nulls and any objects 
> which are not compatible with the given parameter type should be converted.

how about the case when the user wants the missing parameters to be passed in
as nulls? We need to ensure that missing primitives are converted to their
default values. I guess what I am saying is that the wrapper converters should
have a default value, and all other converters should return null when null is
being converted...

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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


Mime
View raw message