velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wgl...@apache.org
Subject svn commit: r582563 - /velocity/texen/trunk/src/java/org/apache/texen/ant/TexenTask.java
Date Sat, 06 Oct 2007 23:57:22 GMT
Author: wglass
Date: Sat Oct  6 16:57:22 2007
New Revision: 582563

URL: http://svn.apache.org/viewvc?rev=582563&view=rev
Log:
Allow caller to override generator.  Useful to pass in a subclass.  Addresses TEXEN-13.

Modified:
    velocity/texen/trunk/src/java/org/apache/texen/ant/TexenTask.java

Modified: velocity/texen/trunk/src/java/org/apache/texen/ant/TexenTask.java
URL: http://svn.apache.org/viewvc/velocity/texen/trunk/src/java/org/apache/texen/ant/TexenTask.java?rev=582563&r1=582562&r2=582563&view=diff
==============================================================================
--- velocity/texen/trunk/src/java/org/apache/texen/ant/TexenTask.java (original)
+++ velocity/texen/trunk/src/java/org/apache/texen/ant/TexenTask.java Sat Oct  6 16:57:22
2007
@@ -483,7 +483,7 @@
             ve.init();
 
             // Create the text generator.
-            Generator generator = Generator.getInstance();
+            Generator generator = createGenerator();
             generator.setVelocityEngine(ve);
             generator.setOutputPath(outputDirectory);
             generator.setInputEncoding(inputEncoding);
@@ -611,6 +611,15 @@
         {
             throw new BuildException("Generation failed" + ERR_MSG_FRAGMENT ,e);
         }
+    }
+
+    /** 
+     * Retrieve a new instance of the generator.  This may be overridden by a subclass.
+     * @return
+     */
+    protected Generator createGenerator() 
+    {
+        return Generator.getInstance();
     }
 
     /**



Mime
View raw message