![]() |
![]() |
Class based code generator for Eclipse
2014.12.29:1.4.15 released (resolved velocity jar version conflict in Eclipse Luna)
2012.01.31:1.4.12 released (generic type parsing bugfix, Attribute.getTypesInGenericsList() is removed, use Attribute.getFirstLevelGenericTypes() instead!
2011.10.18:1.4.9 released (Exception types for methods, nested generic types bugfix)
2011.07.21:1.4.4 released (Annotation parameters, nested annotations, code formatting)
2011.05.25:1.3.4 released (ability to get parent package for more than one level)
2011.05.20:1.3.3 released (JavaBeans Properties detection)
2010.10.21:1.3.2 released (small improvements: projectname next to template name, ignore or disable handwritten code possibility)
2010.09.29:1.3.1 released (generate files based on attributes (one file for each attribute))
2010.09.19:1.3.0 released (support for methods, fixed bug with handwritten code)
2010.08.18:1.2.17 released (annotation attributes can any type, value will be provided as string, new method for reaching annotataion paramter's value introduced)
2010.08.16:1.2.16 released (handled problem with non-string annotation attributes)
2010.07.22:1.2.15 released (attribute visibility bugfix )
2010.06.25:1.2.14 released (added Enum support)
1. Create a template file in your workspace with .vm extension. For example:
hello world ${class.name} #foreach( $attr in $attrs ) ${attr.name} - ${attr.type} #end #foreach( $method in $class.methods ) ${method.name} - ${method.returnType} #endIt is a Velocity template. The attr variable contains the attributes. The ${attr.name} variable holds the name of the attribute while ${attr.type} is the type of the attribute.
2. Select a java class in Package Explorer, hit right mouse button and choose "classtemplater/Generate..."
3. In the classtemplater window select your template
4. The generated code shows up in the bottom window and gets to the clipboard.