You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Gershaw, Geoffrey" <ge...@credit-suisse.com> on 2013/02/19 16:08:13 UTC
Simple languange FQN Enum 2.10.3
Hi all,
I am trying to use an enum in a simple expression in the Spring DSL . I
see that it will be possible to do this in 2.11. Is there a workaround
till then? Right now I'm using a String literal.
>From the doc
type:name.field
Object
Camel 2.11: To refer to a type or field by its FQN name. To refer to a
field you can append .FIELD_NAME. For example you can refer to the
constant field from Exchange as: org.apache.camel.Exchange.FILE_NAME
My attempt, which will fail because I'm not using 2.11. Is there another
scripting language that will allow the use of the enum literal?
<bean ref="CDSDao"
method="getOTRCdxProducts(${type:com.csfb.oddlots.model.SecTypeEnum.INDE
X_CDS})"/>
Thanks
===============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================
Re: Simple languange FQN Enum 2.10.3
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Feb 19, 2013 at 4:08 PM, Gershaw, Geoffrey
<ge...@credit-suisse.com> wrote:
> Hi all,
>
>
>
> I am trying to use an enum in a simple expression in the Spring DSL . I
> see that it will be possible to do this in 2.11. Is there a workaround
> till then? Right now I'm using a String literal.
>
>
>
> From the doc
>
> type:name.field
>
> Object
>
> Camel 2.11: To refer to a type or field by its FQN name. To refer to a
> field you can append .FIELD_NAME. For example you can refer to the
> constant field from Exchange as: org.apache.camel.Exchange.FILE_NAME
>
>
>
>
>
> My attempt, which will fail because I'm not using 2.11. Is there another
> scripting language that will allow the use of the enum literal?
>
> <bean ref="CDSDao"
> method="getOTRCdxProducts(${type:com.csfb.oddlots.model.SecTypeEnum.INDE
> X_CDS})"/>
>
I suggest to try any of SpEL, Groovy, Mvel, OGNL to see if they can
do it. I assume most if not all of them can.
But you cannot use them as part of the <bean> method call in the XML
DSL. The method attribute uses only the simple language.
>
>
> Thanks
>
>
> ===============================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===============================================================================
>
--
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