camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Umair Saleem (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-8738) Referring to constants using type
Date Mon, 04 May 2015 11:27:06 GMT

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

Umair Saleem commented on CAMEL-8738:
-------------------------------------

Ok my bad, missed the public identifier while typing. The class is public. I can access ${type:Constants.test}
which is the field and not in inner class.

> Referring to constants using type
> ---------------------------------
>
>                 Key: CAMEL-8738
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8738
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-language
>    Affects Versions: 2.15.0
>         Environment: Windows 7
>            Reporter: Umair Saleem
>            Priority: Minor
>             Fix For: 2.15.0
>
>
> Hi,
> In documentation link http://camel.apache.org/simple.html following is written
> 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
> When I tried it it works. 
> But for example I have class Constants which contain inner class InnerConstants which
have a field. I cannot access it from following way.
> ${type:Constants.InnerConstants.fieldName}. 
> Exception Found: Cannot find class Constants.InnerConstants.fieldName
> Following is the structure of my Constant class
> class Constants  {
> 	public static String test ="Test1234";
> 	public static class InnerConstants {
> 		public static String fieldName = "fieldName"
> 	}
> }
> My route was:
> <route>
>              <camel:from uri="stream:in" />
>              <camel:setBody><simple>${type:Constants.InnerConstants.fieldName}</simple></camel:setBody>
>              <log loggingLevel="INFO" message="${body}" />
> </route>
> Let me know if you need any other clarification.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message