geirm 01/05/10 20:56:32
Modified: src/java/org/apache/velocity/app Velocity.java
Log:
Converted from Configuration to ExtendedProperties. Should be no functional
change other than the deprecated setConfiguration() method.
Revision Changes Path
1.17 +29 -3 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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Velocity.java 2001/04/27 22:12:40 1.16
+++ Velocity.java 2001/05/11 03:56:31 1.17
@@ -71,10 +71,10 @@
import org.apache.velocity.context.InternalContextAdapterImpl;
import org.apache.velocity.runtime.Runtime;
import org.apache.velocity.runtime.RuntimeConstants;
-import org.apache.velocity.runtime.configuration.Configuration;
import org.apache.velocity.runtime.parser.ParserTreeConstants;
import org.apache.velocity.runtime.parser.node.SimpleNode;
import org.apache.velocity.runtime.directive.VelocimacroProxy;
+import org.apache.velocity.runtime.configuration.Configuration;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.exception.ParseErrorException;
@@ -82,6 +82,7 @@
import org.apache.velocity.runtime.parser.ParseException;
+import org.apache.commons.collections.ExtendedProperties;
/**
* This class provides services to the application
@@ -107,7 +108,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.16 2001/04/27 22:12:40 dlr Exp $
+ * @version $Id: Velocity.java,v 1.17 2001/05/11 03:56:31 geirm Exp $
*/
public class Velocity implements RuntimeConstants
@@ -193,10 +194,35 @@
* is a subset of the parent application's configuration.
*
* @param Configuration configuration
+ *
+ * @deprecated Use
+ * {@link #setExtendedProperties( ExtendedProperties ) }
*/
public static void setConfiguration(Configuration configuration)
+ {
+ /*
+ * Yuk. We added a little helper to Configuration to
+ * help with deprecation. The Configuration class
+ * contains a 'shadow' ExtendedProperties
+ */
+
+ ExtendedProperties ep = configuration.getExtendedProperties();
+
+ Runtime.setConfiguration( ep );
+ }
+
+ /**
+ * Set an entire configuration at once. This is
+ * useful in cases where the parent application uses
+ * the ExtendedProperties class and the velocity configuration
+ * is a subset of the parent application's configuration.
+ *
+ * @param ExtendedProperties configuration
+ *
+ */
+ public static void setExtendedProperties( ExtendedProperties configuration)
{
- Runtime.setConfiguration(configuration);
+ Runtime.setConfiguration( configuration );
}
/**