velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r593771 - /velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/ValueParser.java
Date Sat, 10 Nov 2007 13:33:26 GMT
Author: cbrisson
Date: Sat Nov 10 05:33:26 2007
New Revision: 593771

URL: http://svn.apache.org/viewvc?rev=593771&view=rev
Log:
have ValueParser inherit Map

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/ValueParser.java

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/ValueParser.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/ValueParser.java?rev=593771&r1=593770&r2=593771&view=diff
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/ValueParser.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/ValueParser.java
Sat Nov 10 05:33:26 2007
@@ -19,10 +19,7 @@
  * under the License.
  */
 
-import java.util.Map;
-import java.util.Locale;
-import java.util.Set;
-import java.util.HashMap;
+import java.util.*;
 import java.lang.reflect.Array;
 
 import org.apache.velocity.tools.config.DefaultKey;
@@ -43,7 +40,7 @@
  * @since VelocityTools 1.2
  */
 @DefaultKey("parser")
-public class ValueParser extends ConversionTool
+public class ValueParser extends ConversionTool implements Map
 {
     private Map source = null;
 
@@ -447,5 +444,53 @@
         {
             return new ValueParser(values);
         }
+    }
+
+    public int size() {
+        return getSource().size();
+    }
+
+    public boolean isEmpty() {
+        return getSource().isEmpty();
+    }
+
+    public boolean containsKey(Object key) {
+        return getSource().containsKey(key);
+    }
+
+    public boolean containsValue(Object value) {
+        return getSource().containsValue(value);
+    }
+
+    public Object get(Object key) {
+        return get(String.valueOf(key));
+    }
+
+    public Object put(Object key, Object value) {
+        throw new UnsupportedOperationException("ValueParser is read-only");
+    }
+
+    public Object remove(Object key) {
+        throw new UnsupportedOperationException("ValueParser is read-only");
+    }
+
+    public void putAll(Map m) {
+        throw new UnsupportedOperationException("ValueParser is read-only");
+    }
+
+    public void clear() {
+        throw new UnsupportedOperationException("ValueParser is read-only");
+    }
+
+    public Set keySet() {
+        return getSource().keySet();
+    }
+
+    public Collection values() {
+        return getSource().values();
+    }
+
+    public Set entrySet() {
+        return getSource().entrySet();
     }
 }



Mime
View raw message