public class RegexPropertyResolverTestCase {
@Test
public void testRegexResolution() {
MapperFactory factory =
new DefaultMapperFactory.Builder()
.propertyResolverStrategy(
new RegexPropertyResolver(
"readThe([\\w]+)ForThisBean",
"assignThe([\\w]+)",
true, true))
.build();
factory.registerClassMap(
factory.classMap(A.class, B.class)
.field("name.firstName", "givenName")
.field("name.lastName", "sirName")
.field("address.city", "city")
.field("address.street", "street")
.field("address.postalCode", "postalCode")
.field("address.country", "country")
);
MapperFacade mapper = factory.getMapperFacade();
A a = new A();
Name name = new Name();
name.setFirstName("Albert");
name.setLastName("Einstein");