• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generate 1 dto to another dto convertor using freemaker. Stuck at the generating enum type1 to enum  RSS feed

 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!