• 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

Simple Java Code Generating tools

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We need to generate many enum java files with constants, I was looking at simple code generating tools. Can somebody suggest me simple tools? I was thinking about Velocity templates.

Thanks,
Prashant
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FreeMarker is similar to Velocity.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually just rip out a Perl or Python script for this kind of stuff. I can put the data in a spreadsheet, save it as a CSV and run the script to generate code.

Back around Y2K I wrote an app called the EJBWizard that did something more complex: generated multiple files using a set of templates for each file type. But I myself haven't used it in about 4 years, and a planned enhancement never got done. One of my biggest supporters on that project worked at the top of the World Trade Center.

These days you can do pretty well using Eclipse templates, although, like the EJBWizard, it's best when you have fairly complex files with a few plugin values.
 
bacon. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic