You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by dl...@apache.org on 2002/03/28 02:43:36 UTC
cvs commit: jakarta-velocity/src/java/org/apache/velocity/app Velocity.java
dlr 02/03/27 17:43:36
Modified: xdocs changes.xml
src/java/org/apache/velocity/app Velocity.java
Log:
Deprecated templateExists(String) in favor of the more appropriately
named resourceExists(String).
Revision Changes Path
1.78 +5 -0 jakarta-velocity/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-velocity/xdocs/changes.xml,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -u -r1.77 -r1.78
--- changes.xml 26 Mar 2002 15:15:21 -0000 1.77
+++ changes.xml 28 Mar 2002 01:43:35 -0000 1.78
@@ -48,6 +48,11 @@
<li>
Fix problem where VM in stringlit as arg to VM NPE'd. Whoops. (gmj)
</li>
+<li>
+Deprecated <code>Velocity.templateExists(String)</code> in favor of
+the more appropriately named
+<code>Velocity.resourceExists(String)</code>. (dlr)
+</li>
</ul>
1.28 +23 -15 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.27
retrieving revision 1.28
diff -u -u -r1.27 -r1.28
--- Velocity.java 3 Jan 2002 12:41:19 -0000 1.27
+++ Velocity.java 28 Mar 2002 01:43:35 -0000 1.28
@@ -108,7 +108,7 @@
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
* @author <a href="Christoph.Reck@dlr.de">Christoph Reck</a>
* @author <a href="jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: Velocity.java,v 1.27 2002/01/03 12:41:19 geirm Exp $
+ * @version $Id: Velocity.java,v 1.28 2002/03/28 01:43:35 dlr Exp $
*/
public class Velocity implements RuntimeConstants
@@ -534,23 +534,22 @@
}
/**
- * Determines if a template is accessable via the currently
- * configured resource loaders.
- * <br><br>
- * Note that the current implementation will <b>not</b>
- * change the state of the system in any real way - so this
- * cannot be used to pre-load the resource cache, as the
- * previous implementation did as a side-effect.
- * <br><br>
- * The previous implementation exhibited extreme lazyness and
- * sloth, and the author has been flogged.
+ * <p>Determines whether a resource is accessable via the
+ * currently configured resource loaders. {@link
+ * org.apache.velocity.runtime.resource.Resource} is the generic
+ * description of templates, static content, etc.</p>
+ *
+ * <p>Note that the current implementation will <b>not</b> change
+ * the state of the system in any real way - so this cannot be
+ * used to pre-load the resource cache, as the previous
+ * implementation did as a side-effect.</p>
*
- * @param templateName name of the temlpate to search for
- * @return true if found, false otherwise
+ * @param resourceName The name of the resource to search for.
+ * @return Whether the resource was located.
*/
- public static boolean templateExists( String templateName )
+ public static boolean resourceExists(String resourceName)
{
- return (RuntimeSingleton.getLoaderNameForResource(templateName) != null);
+ return (RuntimeSingleton.getLoaderNameForResource(resourceName) != null);
}
/**
@@ -618,4 +617,13 @@
{
RuntimeSingleton.getRuntimeInstance().setApplicationAttribute( key, value);
}
+
+ /**
+ * @see #resourceExists(String)
+ * @deprecated Use resourceExists(String) instead.
+ */
+ public static boolean templateExists(String resourceName)
+ {
+ return resourceExists(resourceName);
+ }
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>