Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 66500 invoked from network); 11 Mar 2009 05:51:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Mar 2009 05:51:09 -0000 Received: (qmail 76702 invoked by uid 500); 11 Mar 2009 05:51:09 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 76679 invoked by uid 500); 11 Mar 2009 05:51:09 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 76668 invoked by uid 500); 11 Mar 2009 05:51:09 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 76665 invoked by uid 99); 11 Mar 2009 05:51:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 22:51:09 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Mar 2009 05:51:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DB52D234C003 for ; Tue, 10 Mar 2009 22:50:39 -0700 (PDT) Message-ID: <401755577.1236750639883.JavaMail.jira@brutus> Date: Tue, 10 Mar 2009 22:50:39 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Updated: (CAMEL-1446) Bean Binding - Add annotation @TypeConverter so end users easily can get access to the type converter In-Reply-To: <1251655792.1236750520054.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen updated CAMEL-1446: ------------------------------- Description: See this article page 4, listening 6 http://architects.dzone.com/articles/fuse-esb-4-osgi-based?page=0,3 He wants to transform the body to a StringSource, and does it directly {code} private Object value; public Object transform(Object notUsed) { return new StringSource(body); } {code} We could add an @TypeConverter annotation, so you can let Camel handle it better {code} private Object value; public StringSource transform(Object notUsed, @TypeConverter TypeConverter converter) { return converter.convertTo(StringSource.class, value); } {code} This allows you to get easily access to Camels type converter feature, instead of dealing with it yourself and maybe need to import extra classes and deal with exception handling and such. And btw I think StringSource should be moved to org.apache.camel so it does not reside in the subpackage: org.apache.camel.converter.jaxp.StringSource was: See this article page 4, listening 6 http://architects.dzone.com/articles/fuse-esb-4-osgi-based?page=0,3 He wants to transform the body to a StringSource, and does it directly {code} public Object transform(Object body) { return new StringSource(body); } {code} We could add an @TypeConverter annotation, so you can let Camel handle it better {code} public StringSource transform(Object body, @TypeConverter TypeConverter converter) { return converter.convertTo(StringSource.class, body); } {code} This allows you to get easily access to Camels type converter feature, instead of dealing with it yourself and maybe need to import extra classes and deal with exception handling and such. And btw I think StringSource should be moved to org.apache.camel so it does not reside in the subpackage: org.apache.camel.converter.jaxp.StringSource > Bean Binding - Add annotation @TypeConverter so end users easily can get access to the type converter > ----------------------------------------------------------------------------------------------------- > > Key: CAMEL-1446 > URL: https://issues.apache.org/activemq/browse/CAMEL-1446 > Project: Apache Camel > Issue Type: New Feature > Components: camel-core > Reporter: Claus Ibsen > Fix For: 2.0.0 > > > See this article page 4, listening 6 > http://architects.dzone.com/articles/fuse-esb-4-osgi-based?page=0,3 > He wants to transform the body to a StringSource, and does it directly > {code} > private Object value; > public Object transform(Object notUsed) { > return new StringSource(body); > } > {code} > We could add an @TypeConverter annotation, so you can let Camel handle it better > {code} > private Object value; > > public StringSource transform(Object notUsed, @TypeConverter TypeConverter converter) { > return converter.convertTo(StringSource.class, value); > } > {code} > This allows you to get easily access to Camels type converter feature, instead of dealing with it yourself and maybe need to import extra classes and deal with exception handling and such. > And btw I think StringSource should be moved to org.apache.camel so it does not reside in the subpackage: org.apache.camel.converter.jaxp.StringSource -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.