camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet" <gno...@gmail.com>
Subject Re: Patch to convert from String to Boolean
Date Mon, 08 Oct 2007 06:53:18 GMT
Shouldn't the converter registry be able to do that ? If there is a
conversion from x to y available, it should use it whenever the object to be
converted inherits / implements x.

On 10/8/07, William Tam <email.wtam@gmail.com> wrote:
>
> I wasn't able to convert a String to a Boolean using a route such as
> from("direct:test").convertBodyTo(Boolean.class).  The problem is the
> annotated converter method ObjectConverter.toBoolean(Object value) is
> never reached.  The reason is that the converter is registered with
> the key [class java.lang.Object=>class java.lang.Boolean] as taken
> from the signature.  However, my route uses the key [class
> java.lang.String=>class java.lang.Boolean] to look up a converter (so
> none found)  since my in-message type is String (not Object).  I have
> attached a patch which includes a unit test.
>
> Regards,
> William
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message