You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Ajmera, Hemang C" <he...@cgi.com> on 2020/02/11 03:55:09 UTC

Blank, Non - String variable in dozer

Hi
   In one of the dozer mapping I wanted to use hardcoded blank value, so I used the variable mapping feature as mentioned on https://camel.apache.org/components/latest/dozer-component.html#_variable_mappings
This feature does not work if the value is blank. Also in other situation , I wanted to use hardcoded "0" which was int and not string.

  <configuration>
    <variables>
      <variable name="NOVALUE"></variable>
    </variables>
    <variables>
      <variable name="ZERO">0</variable>
    </variables>
  </configuration>


Currently I am using Custom Mapping<https://camel.apache.org/components/latest/dozer-component.html#_custom_mappings> to return "" and 0 respectively to solve my problem, but I feel it not as elegant as part of the mapping goes in different java file which does not have any logic but to return hardcoded value.

Do you have any better suggestion?


Thanks and Regards,
Hemang Ajmera

Hemang C Ajmera | Technical Architect
Asia Pacific Communications, Media and Utilities Delivery Center | CGI
Block 5, DLF-SEZ, Manapakkam, Chennai - 600089, India
O: +91-44-6647-3828 | M: +91-89397-07557 | M: +91-98841-66619 | VOIP: 8083828
hemang.ajmera@cgi.com<ma...@cgi.com> | www.cgi.com<http://www.cgi.com/>
[Description: Description: Description: Description: Description: Description: Description: C:\Users\rahul.muthalali\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\Top_Employer_India_English_2016.gif]