changeset 385:e08f1475facc

XSLTransformer: Widen parameters to store more than strings. artifacts/trunk@4329 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 02 May 2012 16:42:24 +0000
parents 823752e3d392
children fd32dc33a24c
files ChangeLog artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XSLTransformer.java
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 27 10:56:38 2012 +0000
+++ b/ChangeLog	Wed May 02 16:42:24 2012 +0000
@@ -1,3 +1,8 @@
+2012-05-02	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XSLTransformer.java:
+	  Widen parameters to store more than strings.
+
 2012-04-27	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/JSON.java:
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XSLTransformer.java	Fri Apr 27 10:56:38 2012 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XSLTransformer.java	Wed May 02 16:42:24 2012 +0000
@@ -25,7 +25,7 @@
 
     private static Logger log = Logger.getLogger(XSLTransformer.class);
 
-    protected Map<String, String> parameters;
+    protected Map<String, Object> parameters;
 
     public XSLTransformer() {
     }
@@ -40,7 +40,7 @@
                 xformFactory.newTransformer(templateSource);
 
             if (parameters != null) {
-                for (Map.Entry<String, String> entry: parameters.entrySet()) {
+                for (Map.Entry<String, Object> entry: parameters.entrySet()) {
                     transformer.setParameter(entry.getKey(), entry.getValue());
                 }
             }
@@ -63,9 +63,9 @@
         return null;
     }
 
-    public void addParameter(String key, String value) {
+    public void addParameter(String key, Object value) {
         if (parameters == null) {
-            parameters = new HashMap<String, String>();
+            parameters = new HashMap<String, Object>();
         }
         parameters.put(key, value);
     }

http://dive4elements.wald.intevation.org