geirm 01/03/18 16:57:56
Modified: src/java/org/apache/velocity/app Velocity.java
Log:
Added simple getTemplate() method - keep people out of Runtime.
Revision Changes Path
1.8 +19 -1 jakarta-velocity/src/java/org/apache/velocity/app/Velocity.java
Index: Velocity.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/app/Velocity.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Velocity.java 2001/03/16 05:04:37 1.7
+++ Velocity.java 2001/03/19 00:57:56 1.8
@@ -96,7 +96,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
* @author <a href="[EMAIL PROTECTED]">Christoph Reck</a>
* @author <a href="[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Velocity.java,v 1.7 2001/03/16 05:04:37 geirm Exp $
+ * @version $Id: Velocity.java,v 1.8 2001/03/19 00:57:56 geirm Exp $
*/
public class Velocity implements RuntimeConstants
@@ -392,6 +392,24 @@
}
return false;
+ }
+
+ /**
+ * Returns a <code>Template</code> from the Velocity
+ * resource management system.
+ *
+ * @param name The file name of the desired template.
+ * @return The template.
+ * @throws ResourceNotFoundException if template not found
+ * from any available source.
+ * @throws ParseErrorException if template cannot be parsed due
+ * to syntax (or other) error.
+ * @throws Exception if an error occurs in template initialization
+ */
+ public static Template getTemplate(String name)
+ throws ResourceNotFoundException, ParseErrorException, Exception
+ {
+ return Runtime.getTemplate( name );
}