Simple code generator is a simple, but powerful tool for multiple text files generator. It can be useful for example to prepare CRUD operations on any web application. It uses Velocity templates and json file with parameters.
- Prepare template directory:
- it can contain subdirectories and your template files with
.vm
extension - it must contain
parameters.json
file with your parameters which will be used to fill your templates - you can use parameters also in directory names, e.g.
__myName__
, wheremyName
is a parameter name - parameters in template files must be prefixed by
p.
, e.g.${p.myName}
- Put your template direcotry in the same directory as your simlple-code-generator tool.
- Run simple-code-generator:
java -jar simple-code-generator.jar
- It generates code in directory named with
_result
suffix.
Check an example
template directory.
- Velocity templates user guide