To be honest I don't need it at the moment, but I think it's reasonable to return null on conversion.

Converter (line 167) does it:

   public Object convert(Object value, Class c)
   {
       // Null is always converted to null
       if (value == null)
       {
           return null;
       }
       ...
   }

Just my 2 cents

Sven

Johan Compagner wrote:

so you have a case where the value is something but the converter converts
it to null?

This is more or less a check if conversion did happen.
But i can remove it and let conversion exceptions be thrown inside the
converter

johan


On 3/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Is there a reason why a converter is not allowed to return null?

See PropertyResolver (line 821):

Object converted = converter.convert(value, getMethod.getReturnType());
if (converted == null && value != null)
{
throw new ConversionException("Can't convert value: " + value + " to
class: "
     + getMethod.getReturnType() + " for setting it on " + object);
}
???

Sven


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to