Skip to content

Commit ac70946

Browse files
committed
add generatedBy context variable
1 parent f9ce870 commit ac70946

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

modello-plugins/modello-plugin-velocity/src/main/java/org/codehaus/modello/plugin/velocity/VelocityGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void generate( Model model, Properties parameters ) throws ModelloExcepti
7777
for ( String templatePath : templates.split( "," ) )
7878
{
7979
Template template = velocity.getTemplate( templatePath );
80+
context.put( "generatedBy", "Generated by Modello Velocity from " + templatePath + " template." );
8081

8182
try ( Writer w = new RedirectingWriter( Paths.get( output ) ) )
8283
{

modello-plugins/modello-plugin-velocity/src/site/xdoc/index.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<tr><td><code>Helper</code></td><td><a href="apidocs/org/codehaus/modello/plugin/velocity/Helper.html"><code>Helper</code></a></td>
3535
<td>A helper tool with classical functions useful to generate content from a Modello model API.</td>
3636
</tr>
37+
<tr><td><code>generatedBy</code></td><td><code>String</code></td>
38+
<td>"Generated by Modello Velocity from " + templatePath + " template."</td>
39+
</tr>
3740
</table>
3841
</p>
3942
</section>

0 commit comments

Comments
 (0)