You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Umair Saleem (JIRA)" <ji...@apache.org> on 2015/05/04 12:57:06 UTC

[jira] [Updated] (CAMEL-8738) Referring to constants using type

     [ https://issues.apache.org/jira/browse/CAMEL-8738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Umair Saleem updated CAMEL-8738:
--------------------------------
    Description: 
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.


  was:
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"
	}
}

Let me know if you need any other clarification.



> 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)