dev@javaserverfaces.java.net

Re: [API] Converter(s).getAsString()

From: Matthias Wessendorf <matzew_at_apache.org>
Date: Thu, 17 May 2007 20:26:55 -0700

> The above looks wrong.

:-)
Yes, I used the code of Float.

> The RI, in the case of the DoubleConverter does:
>
> return (Double.toString(((Double) value).doubleValue()));
>
>
> It seems reasonable to me to expect the Object to be Double as that
> is what this converter deals with.

Well, the minimal contract is Number and the doubleValue() (and
floatValue(),...) are defined in that. So using Number wouldn't heart.

I use the attached Converter in the Renderer to *convert* some other
"numbers", based on the underlying Converter (and it's rules). The
type of these numbers is java.lang.Number to support Double, Long, ...


>
> > MyFaces does:
> > try
> > {
> > return Double.toString(((Number)value).doubleValue());
> > }
> >
> > Shouldn't the RI use Number as well ?
> >
> > -Matthias
> >
> > http://fisheye5.cenqua.com/browse/~raw,r=1.21/javaserverfaces-sources/jsf-api/src/javax/faces/convert/DoubleConverter.java
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com