#233 Mapping costants

Dozer v5.3.2
open
nobody
5
2011-07-20
2011-07-20
Anonymous
No

You can't map a field with a constant value, I'd like to do as follows:

config file:

<mappings ...>

<mapping type="one-way">

<class-a>ClassA</class-a>
<class-b>ClassB</class-b>

<field>
<a>field</a>
<b>${value}</b>
</field>

...

</mapping>

...

</mappings>

where ${value} is a placeholder

and the code:

List<String> mappingFiles = new ArrayList<String>();
mappingFiles.add("dozerMapping.xml");

Map<String,Object> parameters = new HashMap<String,Object>();
parameters.put("value", "COSTANT");

Mapper map = new DozerBeanMapper(mappingFiles, parameters);

Discussion


  • Anonymous
    2011-07-20

    I wanted to congratulate you for the excellent work done with Dozer

     

  • Anonymous
    2011-07-20

    • milestone: 478636 --> Dozer v5.3.2