Currently to map from a class into a class you use the following annotations
@Mappable
public class Bean2 {
/** The name. */
@Source(type = org.omapper.test.Bean1.class, property = "name")
private String name;
}
But what if you wanted to support a conversion from Bean3 you might write
something like:
@Mappable
public class Bean2 {
/** The name. */
@Source(type = org.omapper.test.Bean2.class, property = "bean2Name")
@Source(type = org.omapper.test.Bean1.class, property = "name")
private String name;
}
however that is not allowed in Java. One possible solution is to add an
annotation that takes annotations as arguments:
@Mappable
public class Bean2 {
/** The name. */
@Sources({
@Source(type = org.omapper.test.Bean2.class, property = "bean2Name"),
@Source(type = org.omapper.test.Bean1.class, property = "name")})
private String name;
}
Original issue reported on code.google.com by
michael....@gmail.comon 22 Aug 2014 at 9:05