For each target you can have several files which are generated. There is a ini file which contains the list of files which need to be generated.
This ini file is called "target-name.ini" and is searched on the classpath.
The file has the following format (excerpt from the ejb3.ini)
[config]
path=ejb3
[global]
output1=${outputDir}${packageDir}client/LazyEJBList.java
template1=LazyEJBList.java.vm
output2=${outputDir}${packageDir}client/LazyProxyList.java
template2=LazyProxyList.java.vm
[root-table]
// build entity bean
output1=${outputDir}${packageDir}server/pm/DM${table}Bean.java
template1=DMObjectBean.java.vm
// build session facade bean
output2=${outputDir}${packageDir}server/${table}Bean.java
template2=ObjectBean.java.vm
// build session facade root mediator
output3=${outputDir}${packageDir}server/${table}MediatorRoot.java
template3=MediatorRoot.java.vm
// build SelectorHelper classes
output4=${outputDir}${packageDir}server/${table}SelectorHelper.java
template4=ObjectSelectorHelper.java.vm
skip-if4=${altOutputDir}${packageDir}server/${table}SelectorHelper.java
[table]
// build mediator base class (generated)
output1=${outputDir}${packageDir}server/${table}MediatorBase.java
template1=MediatorBase.java.vm
// build mediator class (for manual modification)
output2=${outputDir}${packageDir}server/${table}Mediator.java
template2=Mediator.java.vm
skip-if2=${altOutputDir}${packageDir}server/${table}Mediator.java
[multiple-field]
// build entity bean
output1=${outputDir}${packageDir}server/pm/DM${table}_${field}Bean.java
template1=DMFieldBean.java.vm
The "config" section indicates the path which is prepended to each template file. The templates are all retrieved from the classpath, but the prefix allows you to avoid name collisions (like java packages).
All the other sections indicate the possible groupings in the domain model for which files can be generated.
The can contain outputX, templateX and skip-ifX where X is a number from 1 up to the amount needed (needs to be consecutive). In the parameters, you can use variable replacement using the ant/velocity syntax "${var-name}
".
The sections which can be used (including variables for output names and templates) are
For variable replacement in the filenames, the following are available in all cases.
The following variables are always available in te Velocity templates.