dlr 01/05/01 00:05:40
Modified: src/java/org/apache/velocity/runtime/configuration
Configuration.java
Log:
Added constant for the property values delimeter.
Revision Changes Path
1.28 +10 -5
jakarta-velocity/src/java/org/apache/velocity/runtime/configuration/Configuration.java
Index: Configuration.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/configuration/Configuration.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Configuration.java 2001/05/01 02:36:12 1.27
+++ Configuration.java 2001/05/01 07:05:39 1.28
@@ -164,7 +164,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Leon Messerschmidt</a>
* @author <a href="mailto:[EMAIL PROTECTED]>Kent Johnson</a>
- * @version $Id: Configuration.java,v 1.27 2001/05/01 02:36:12 dlr Exp $
+ * @version $Id: Configuration.java,v 1.28 2001/05/01 07:05:39 dlr Exp $
*/
public class Configuration extends Hashtable
{
@@ -276,13 +276,18 @@
class PropertiesTokenizer extends StringTokenizer
{
/**
+ * The property delimeter used while parsing (a comma).
+ */
+ static final String DELIMETER = ",";
+
+ /**
* Constructor.
*
* @param string A String.
*/
public PropertiesTokenizer(String string)
{
- super(string, ",");
+ super(string, DELIMETER);
}
/**
@@ -310,7 +315,7 @@
if (token.endsWith("\\"))
{
buffer.append(token.substring(0, token.length() - 1));
- buffer.append(",");
+ buffer.append(DELIMETER);
}
else
{
@@ -513,7 +518,6 @@
* if there isn't a value there, get it from the
* defaults if we have them
*/
-
if (defaults != null)
{
o = defaults.get(key);
@@ -587,7 +591,8 @@
* like that cannot parse multiple same key
* values.
*/
- if (token instanceof String && ((String)token).indexOf(",") > 0)
+ if (token instanceof String &&
+ ((String)token).indexOf(PropertiesTokenizer.DELIMETER) > 0)
{
PropertiesTokenizer tokenizer =
new PropertiesTokenizer((String)token);