-
Notifications
You must be signed in to change notification settings - Fork 41
Regex Mapping
avurro edited this page Apr 14, 2016
·
8 revisions
under construction
class Source1{
List<String> customersIds;
// getter and setter...
}
class Source2{
Set<Integer> companyIds;
// getter and setter...
}
class Source3{
TreeSet<String> supplierIds;
// getter and setter...
}
As you can see the fields have different structures, JMapper handles all implicitly.
class Destination{
@JMap(".*ids$")
List<Integer> ids;
// getter and setter...
}
Xml configuration:
<jmapper>
<class name="package.Destination">
<attribute name="ids">
<value name=".*ids$"/>
</attribute>
</class>
</jmapper>
API configuration:
...
import static com.googlecode.jmapper.api.JMapperAPI.*;
...
JMapperAPI jmapperAPI = new JMapperAPI()
.add(mappedClass(Destination.class)
.add(attribute("ids")
.value(".*ids$")));
© 2016 Alessandro Vurro
- Home
- How to map
- Relations
- Conversions
- creation/enrichment
- XML
- Annotation
- API
- Configurations
- Utilities
- Examples
- Articles
- More information
- Performance tests
- Release Notes