• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic