I am using freemaker to generate dto convertor from one type to another. Defining things through custom annotations E.g:
@CustomAnnotationTargetDTO(type=DTO2) Class DTO1 {
@CustomAnnotationTargetProperty(propertyName="gender") private
String sex;
}
like this i have invented different annotations that i use to map a class and its properties to other type.
I now have a Enumeration in a DTO. Any idea on the similar lines that how i map 1 type to another.
I was thinking on the lines
@CustomAnnotationTargetEnum(xmlEnum="Type2Enum") public enum Type1Enum {
@CustomAnnotationTargetEnumValue(enumValue="GIRL")
FEMALE(Byte.valueOf("1")),
@CustomAnnotationTargetEnumValue(enumValue="BOY")
MALE(Byte.valueOf("2"));
//other stuff below
}