camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6016) Simple language - Add type function which can refer to a constant or enum
Date Sat, 02 Feb 2013 10:24:13 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-6016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569492#comment-13569492
] 

Claus Ibsen commented on CAMEL-6016:
------------------------------------

There is a new type function now.

We should look into making it possible to add known packages, so you dont have to type the
FQN, eg so you can do
{code}
 <simple>${header.kind} == ${const:MyTypes.CUSTOMER}</simple>
{code}

And add "com.foo" as a known package.
                
> Simple language - Add type function which can refer to a constant or enum 
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-6016
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6016
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.11.0
>
>
> It would be nice if we added support so people can refer to a constant on a class / interface,
or to an enum, which we can referred to in the simple language.
> The syntax would need to be worked out a bit
> {code}
> <when>
>   <simple>${body} == ${T(com.foo.MyTypes.CUSTOMER)}</simple>
> </when>
> {code}
> Not sure about the function name, here we use T to refer to a type. We could also use,
"const", "type", or have "enum" as well
> {code}
> <when>
>   <simple>${body} == ${const(com.foo.MyTypes.CUSTOMER)}</simple>
> </when>
> {code}
> And we can use colon instead of ( ) which is shorter
> {code}
> <when>
>   <simple>${body} == ${enum:com.foo.MyTypes.CUSTOMER}</simple>
> </when>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message