dlr 2003/08/31 14:18:00
Modified: src/java/org/apache/velocity/runtime RuntimeSingleton.java
Log:
* src/java/org/apache/velocity/runtime/RuntimeSingleton.java
Corrected header JavaDoc.
init(): Corrected comment format to be of JavaDoc style.
getRuntimeServices(): Added JavaDoc and removed unnecessary cast of
RuntimeInstance.
getUberspect(): Added new method which delegates to
RuntimeInstance's getUberspect() impl.
getRuntimeInstance(): Deprecated in favor of getRuntimeServices().
Revision Changes Path
1.7 +31 -14
jakarta-velocity/src/java/org/apache/velocity/runtime/RuntimeSingleton.java
Index: RuntimeSingleton.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/RuntimeSingleton.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -u -r1.6 -r1.7
--- RuntimeSingleton.java 4 May 2003 17:14:36 -0000 1.6
+++ RuntimeSingleton.java 31 Aug 2003 21:18:00 -0000 1.7
@@ -75,6 +75,7 @@
import org.apache.commons.collections.ExtendedProperties;
import org.apache.velocity.util.introspection.Introspector;
+import org.apache.velocity.util.introspection.Uberspect;
/**
* This is the Runtime system for Velocity. It is the
@@ -95,21 +96,21 @@
* the code might look something like the following:
*
* <pre>
- * Runtime.setProperty(Runtime.FILE_RESOURCE_LOADER_PATH, templatePath);
- * Runtime.setProperty(Runtime.RUNTIME_LOG, pathToVelocityLog);
- * Runtime.init();
+ * RuntimeSingleton.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH,
templatePath);
+ * RuntimeSingleton.setProperty(RuntimeConstants.RUNTIME_LOG, pathToVelocityLog);
+ * RuntimeSingleton.init();
* </pre>
*
* <pre>
* -----------------------------------------------------------------------
* N O T E S O N R U N T I M E I N I T I A L I Z A T I O N
* -----------------------------------------------------------------------
- * Runtime.init()
+ * RuntimeSingleton.init()
*
* If Runtime.init() is called by itself the Runtime will
* initialize with a set of default values.
* -----------------------------------------------------------------------
- * Runtime.init(String/Properties)
+ * RuntimeSingleton.init(String/Properties)
*
* In this case the default velocity properties are layed down
* first to provide a solid base, then any properties provided
@@ -121,6 +122,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jeff Bowden</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magusson Jr.</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
*
* @see org.apache.velocity.runtime.RuntimeInstance
*
@@ -130,7 +132,7 @@
{
private static RuntimeInstance ri = new RuntimeInstance();
- /*
+ /**
* This is the primary initialization method in the Velocity
* Runtime. The systems that are setup/initialized here are
* as follows:
@@ -150,9 +152,12 @@
ri.init();
}
+ /**
+ * @return The RuntimeInstance used by this wrapper.
+ */
public static RuntimeServices getRuntimeServices()
{
- return (RuntimeServices) ri;
+ return ri;
}
@@ -567,12 +572,24 @@
}
/**
- * returns the RuntimeInstance object for this singleton
- * For internal use only :)
- *
- * @return RuntimeInstance the RuntimeInstance used by this Singleton
- * instance
- */
+ * @see
org.apache.velocity.runtime.RuntimeServices#getApplicationAttribute(Object)
+ */
+ public static Object getApplicationAttribute(Object key)
+ {
+ return ri.getApplicationAttribute(key);
+ }
+
+ /**
+ * @see org.apache.velocity.runtime.RuntimeServices#getUberspect()
+ */
+ public static Uberspect getUberspect()
+ {
+ return ri.getUberspect();
+ }
+
+ /**
+ * @deprecated Use getRuntimeServices() instead.
+ */
public static RuntimeInstance getRuntimeInstance()
{
return ri;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]