<configuration>
<wildcard>true</wildcard>
<variables>
<variable name="type_name">com.github.dozermapper.core.sample.MyType</variable>
</variables>
</configuration>
<mapping>
<class-a>${type_name}</class-a>
<class-b>com.github.dozermapper.core.sample.OtherType</class-b>
</mapping>
Expression Language
Usage
Dozer provides optional support for standard java expression language (javax.el).
Current support for expressions is start-up time only. Expressions are not resolved during each mapping, but rather during mapping loading time. Each attribute or node value can contain a valid EL expression ${}.
Dozer supports any EL implementation written against javax.el standard API. Functionality is tested with 'glassfish' internally, but other EL providers should work as well.
You can define global variables for the mapper in variables configuration block.
Enabling
EL support is an optional feature. To enable it, you must add the below dependencies to your classpath:
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>
It is this enabled on the Mapper by the below fluent construct:
Mapper mapper = DozerBeanMapperBuilder.create()
.withMappingFiles(mappingFiles)
.withELEngine(new DefaultELEngine())
.build();