You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by GLIMMERVEEN Arnoud <ar...@nl.thalesgroup.com> on 2012/12/18 08:05:58 UTC

Configuring (Fallback)TypeConverters

Hi,

I noticed that the FallbackTypeConverter from the org.apache.camel.converter.jaxb package has a property to control the pretty print behaviour of the JAXB marshaller it uses, but I am wondering how I could modify that property from its default value true to false. Does anyone know how I can set a property of a (Fallback)TypeConverter?

Regards,

Arnoud Glimmerveen.

P.S. I use Camel 2.10.2


------------------------------------------------------------------------------------------------------------
Disclaimer:

If you are not the intended recipient of this email, please notify the sender and delete it. 
Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden. 
Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s). 
Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------



RE: Configuring (Fallback)TypeConverters

Posted by GLIMMERVEEN Arnoud <ar...@nl.thalesgroup.com>.
Oke, thanks for looking in to it!

Arnoud

> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Tuesday, 18 December, 2012 15:49
> To: users@camel.apache.org
> Subject: Re: Configuring (Fallback)TypeConverters
> 
> On Tue, Dec 18, 2012 at 3:06 PM, Willem jiang <wi...@gmail.com>
> wrote:
> > Yeah, it could work, but we still need to deal with the injecter which is not
> using the Spring.
> > So I think using the Camel Property could be one stop shop solution.
> >
> 
> Yes lets leave it as is.
> 
> There is a JIRA ticket for in the future to allow to define type
> converter(s) as <bean> in Spring XML file.
> 
> Like we can do with
> http://camel.apache.org/advanced-configuration-of-camelcontext-using-
> spring.html
> 
> 
> 
> >
> > --
> > Willem Jiang
> >
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Web: http://www.fusesource.com | http://www.redhat.com
> > Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
> >           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> >
> > On Tuesday, December 18, 2012 at 4:44 PM, GLIMMERVEEN Arnoud wrote:
> >
> >> I noticed that Injector.newInstance() is used to instantiate (among
> others) TypeConverters. I was wondering if it is possible to enhance the
> Injector implementations? The SpringInjector for example could try to find a
> bean in the application context based on the type argument supplied to
> Injecter.newInstance(Class) and if one is present return that one rather then
> creating a new object. This would allow the developer to configure the
> FallbackTypeConverter as Spring bean, set the property and the
> SpringInjector could discover the configured type converter.
> >>
> >> Regards,
> >>
> >> Arnoud.
> >>
> >> > -----Original Message-----
> >> > From: Willem jiang [mailto:willem.jiang@gmail.com]
> >> > Sent: Tuesday, 18 December, 2012 09:29
> >> > To: users@camel.apache.org (mailto:users@camel.apache.org)
> >> > Subject: Re: Configuring (Fallback)TypeConverters
> >> >
> >> > As the FallbackTypeConverter is load by camel
> >> > AnnotationTypeConverterLoader, so it is hard for you to set the
> >> > property value for you.
> >> >
> >> > But I think I can do some thing on the camel property which you can
> >> > define the customer property on it to disable the pretty print behavior.
> >> >
> >> > So I just Fill a JIRA[1] for it.
> >> >
> >> > [1]https://issues.apache.org/jira/browse/CAMEL-5893
> >> >
> >> > --
> >> > Willem Jiang
> >> >
> >> > Red Hat, Inc.
> >> > FuseSource is now part of Red Hat
> >> > Web: http://www.fusesource.com | http://www.redhat.com
> >> > Blog: http://willemjiang.blogspot.com
> >> > (http://willemjiang.blogspot.com/)
> >> > (English)
> >> > http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> >> > Twitter: willemjiang
> >> > Weibo: 姜宁willem
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Tuesday, December 18, 2012 at 3:05 PM, GLIMMERVEEN Arnoud
> wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > I noticed that the FallbackTypeConverter from the
> >> > org.apache.camel.converter.jaxb package has a property to control
> >> > the pretty print behaviour of the JAXB marshaller it uses, but I am
> >> > wondering how I could modify that property from its default value
> >> > true to false. Does anyone know how I can set a property of a
> (Fallback)TypeConverter?
> >> > >
> >> > > Regards,
> >> > >
> >> > > Arnoud Glimmerveen.
> >> > >
> >> > > P.S. I use Camel 2.10.2
> >> > >
> >> > >
> >> > > -----------------------------------------------------------------
> >> > > --------------------------
> >> > -----------------
> >> > > Disclaimer:
> >> > >
> >> > > If you are not the intended recipient of this email, please
> >> > > notify the sender
> >> > and delete it.
> >> > > Any unauthorized copying, disclosure or distribution of this
> >> > > email or its
> >> >
> >> >
> >> > attachment(s) is forbidden.
> >> > > Thales Nederland BV will not accept liability for any damage
> >> > > caused by this
> >> >
> >> >
> >> > email or its attachment(s).
> >> > > Thales Nederland BV is seated in Hengelo and is registered at the
> >> > > Chamber
> >> >
> >> >
> >> > of Commerce under number 06061578.
> >> > > -----------------------------------------------------------------
> >> > > --------------------------
> >> >
> >> >
> >> > -----------------
> >
> >
> 
> 
> 
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen

Re: Configuring (Fallback)TypeConverters

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Dec 18, 2012 at 3:06 PM, Willem jiang <wi...@gmail.com> wrote:
> Yeah, it could work, but we still need to deal with the injecter which is not using the Spring.
> So I think using the Camel Property could be one stop shop solution.
>

Yes lets leave it as is.

There is a JIRA ticket for in the future to allow to define type
converter(s) as <bean> in Spring XML file.

Like we can do with
http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html



>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
> On Tuesday, December 18, 2012 at 4:44 PM, GLIMMERVEEN Arnoud wrote:
>
>> I noticed that Injector.newInstance() is used to instantiate (among others) TypeConverters. I was wondering if it is possible to enhance the Injector implementations? The SpringInjector for example could try to find a bean in the application context based on the type argument supplied to Injecter.newInstance(Class) and if one is present return that one rather then creating a new object. This would allow the developer to configure the FallbackTypeConverter as Spring bean, set the property and the SpringInjector could discover the configured type converter.
>>
>> Regards,
>>
>> Arnoud.
>>
>> > -----Original Message-----
>> > From: Willem jiang [mailto:willem.jiang@gmail.com]
>> > Sent: Tuesday, 18 December, 2012 09:29
>> > To: users@camel.apache.org (mailto:users@camel.apache.org)
>> > Subject: Re: Configuring (Fallback)TypeConverters
>> >
>> > As the FallbackTypeConverter is load by camel
>> > AnnotationTypeConverterLoader, so it is hard for you to set the property
>> > value for you.
>> >
>> > But I think I can do some thing on the camel property which you can define
>> > the customer property on it to disable the pretty print behavior.
>> >
>> > So I just Fill a JIRA[1] for it.
>> >
>> > [1]https://issues.apache.org/jira/browse/CAMEL-5893
>> >
>> > --
>> > Willem Jiang
>> >
>> > Red Hat, Inc.
>> > FuseSource is now part of Red Hat
>> > Web: http://www.fusesource.com | http://www.redhat.com
>> > Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
>> > (English)
>> > http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>> > Twitter: willemjiang
>> > Weibo: 姜宁willem
>> >
>> >
>> >
>> >
>> >
>> > On Tuesday, December 18, 2012 at 3:05 PM, GLIMMERVEEN Arnoud wrote:
>> >
>> > > Hi,
>> > >
>> > > I noticed that the FallbackTypeConverter from the
>> > org.apache.camel.converter.jaxb package has a property to control the
>> > pretty print behaviour of the JAXB marshaller it uses, but I am wondering
>> > how I could modify that property from its default value true to false. Does
>> > anyone know how I can set a property of a (Fallback)TypeConverter?
>> > >
>> > > Regards,
>> > >
>> > > Arnoud Glimmerveen.
>> > >
>> > > P.S. I use Camel 2.10.2
>> > >
>> > >
>> > > -------------------------------------------------------------------------------------------
>> > -----------------
>> > > Disclaimer:
>> > >
>> > > If you are not the intended recipient of this email, please notify the sender
>> > and delete it.
>> > > Any unauthorized copying, disclosure or distribution of this email or its
>> >
>> >
>> > attachment(s) is forbidden.
>> > > Thales Nederland BV will not accept liability for any damage caused by this
>> >
>> >
>> > email or its attachment(s).
>> > > Thales Nederland BV is seated in Hengelo and is registered at the Chamber
>> >
>> >
>> > of Commerce under number 06061578.
>> > > -------------------------------------------------------------------------------------------
>> >
>> >
>> > -----------------
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Configuring (Fallback)TypeConverters

Posted by Willem jiang <wi...@gmail.com>.
Yeah, it could work, but we still need to deal with the injecter which is not using the Spring.
So I think using the Camel Property could be one stop shop solution.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Tuesday, December 18, 2012 at 4:44 PM, GLIMMERVEEN Arnoud wrote:

> I noticed that Injector.newInstance() is used to instantiate (among others) TypeConverters. I was wondering if it is possible to enhance the Injector implementations? The SpringInjector for example could try to find a bean in the application context based on the type argument supplied to Injecter.newInstance(Class) and if one is present return that one rather then creating a new object. This would allow the developer to configure the FallbackTypeConverter as Spring bean, set the property and the SpringInjector could discover the configured type converter.
>  
> Regards,
>  
> Arnoud.
>  
> > -----Original Message-----
> > From: Willem jiang [mailto:willem.jiang@gmail.com]
> > Sent: Tuesday, 18 December, 2012 09:29
> > To: users@camel.apache.org (mailto:users@camel.apache.org)
> > Subject: Re: Configuring (Fallback)TypeConverters
> >  
> > As the FallbackTypeConverter is load by camel
> > AnnotationTypeConverterLoader, so it is hard for you to set the property
> > value for you.
> >  
> > But I think I can do some thing on the camel property which you can define
> > the customer property on it to disable the pretty print behavior.
> >  
> > So I just Fill a JIRA[1] for it.
> >  
> > [1]https://issues.apache.org/jira/browse/CAMEL-5893
> >  
> > --
> > Willem Jiang
> >  
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Web: http://www.fusesource.com | http://www.redhat.com
> > Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> > (English)
> > http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >  
> >  
> >  
> >  
> >  
> > On Tuesday, December 18, 2012 at 3:05 PM, GLIMMERVEEN Arnoud wrote:
> >  
> > > Hi,
> > >  
> > > I noticed that the FallbackTypeConverter from the
> > org.apache.camel.converter.jaxb package has a property to control the
> > pretty print behaviour of the JAXB marshaller it uses, but I am wondering
> > how I could modify that property from its default value true to false. Does
> > anyone know how I can set a property of a (Fallback)TypeConverter?
> > >  
> > > Regards,
> > >  
> > > Arnoud Glimmerveen.
> > >  
> > > P.S. I use Camel 2.10.2
> > >  
> > >  
> > > -------------------------------------------------------------------------------------------
> > -----------------
> > > Disclaimer:
> > >  
> > > If you are not the intended recipient of this email, please notify the sender
> > and delete it.
> > > Any unauthorized copying, disclosure or distribution of this email or its
> >  
> >  
> > attachment(s) is forbidden.
> > > Thales Nederland BV will not accept liability for any damage caused by this
> >  
> >  
> > email or its attachment(s).
> > > Thales Nederland BV is seated in Hengelo and is registered at the Chamber
> >  
> >  
> > of Commerce under number 06061578.
> > > -------------------------------------------------------------------------------------------
> >  
> >  
> > -----------------  



RE: Configuring (Fallback)TypeConverters

Posted by GLIMMERVEEN Arnoud <ar...@nl.thalesgroup.com>.
I noticed that Injector.newInstance() is used to instantiate (among others) TypeConverters. I was wondering if it is possible to enhance the Injector implementations? The SpringInjector for example could try to find a bean in the application context based on the type argument supplied to Injecter.newInstance(Class) and if one is present return that one rather then creating a new object. This would allow the developer to configure the FallbackTypeConverter as Spring bean, set the property and the SpringInjector could discover the configured type converter.

Regards,

Arnoud.

> -----Original Message-----
> From: Willem jiang [mailto:willem.jiang@gmail.com]
> Sent: Tuesday, 18 December, 2012 09:29
> To: users@camel.apache.org
> Subject: Re: Configuring (Fallback)TypeConverters
> 
> As the FallbackTypeConverter is load by camel
> AnnotationTypeConverterLoader, so it is hard for you to set the property
> value for you.
> 
> But I think I can do some thing on the camel property which you can define
> the customer property on it to disable the pretty print behavior.
> 
> So I just Fill a JIRA[1] for it.
> 
> [1]https://issues.apache.org/jira/browse/CAMEL-5893
> 
> --
> Willem Jiang
> 
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
> 
> 
> 
> 
> 
> On Tuesday, December 18, 2012 at 3:05 PM, GLIMMERVEEN Arnoud wrote:
> 
> > Hi,
> >
> > I noticed that the FallbackTypeConverter from the
> org.apache.camel.converter.jaxb package has a property to control the
> pretty print behaviour of the JAXB marshaller it uses, but I am wondering
> how I could modify that property from its default value true to false. Does
> anyone know how I can set a property of a (Fallback)TypeConverter?
> >
> > Regards,
> >
> > Arnoud Glimmerveen.
> >
> > P.S. I use Camel 2.10.2
> >
> >
> > -------------------------------------------------------------------------------------------
> -----------------
> > Disclaimer:
> >
> > If you are not the intended recipient of this email, please notify the sender
> and delete it.
> > Any unauthorized copying, disclosure or distribution of this email or its
> attachment(s) is forbidden.
> > Thales Nederland BV will not accept liability for any damage caused by this
> email or its attachment(s).
> > Thales Nederland BV is seated in Hengelo and is registered at the Chamber
> of Commerce under number 06061578.
> > -------------------------------------------------------------------------------------------
> -----------------
> 
> 


Re: Configuring (Fallback)TypeConverters

Posted by Willem jiang <wi...@gmail.com>.
As the FallbackTypeConverter is load by camel AnnotationTypeConverterLoader, so it is hard for you to set the property value for you.

But I think I can do some thing on the camel property which you can define the customer property on it to disable the pretty print behavior.  

So I just Fill a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-5893  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, December 18, 2012 at 3:05 PM, GLIMMERVEEN Arnoud wrote:

> Hi,
>  
> I noticed that the FallbackTypeConverter from the org.apache.camel.converter.jaxb package has a property to control the pretty print behaviour of the JAXB marshaller it uses, but I am wondering how I could modify that property from its default value true to false. Does anyone know how I can set a property of a (Fallback)TypeConverter?
>  
> Regards,
>  
> Arnoud Glimmerveen.
>  
> P.S. I use Camel 2.10.2
>  
>  
> ------------------------------------------------------------------------------------------------------------
> Disclaimer:
>  
> If you are not the intended recipient of this email, please notify the sender and delete it.  
> Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden.  
> Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s).  
> Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
> ------------------------------------------------------------------------------------------------------------