diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 1656:94732906b094

Made feed() operation able to remove existing data items from Artifact's data pool. flys-artifacts/trunk@2850 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 28 Sep 2011 09:17:20 +0000
parents 33ade8153d74
children e8627d1e2db6
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Wed Sep 28 08:20:29 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Wed Sep 28 09:17:20 2011 +0000
@@ -489,6 +489,11 @@
     }
 
 
+    protected StateData removeData(String name) {
+        return this.data.remove(name);
+    }
+
+
     /**
      * This method returns a specific StateData object that is stored in the
      * data pool of this artifact.
@@ -570,6 +575,11 @@
 
                 addData(name, current.transform(this, context, name, value));
             }
+            else if (name.length() > 0 && value.length() == 0) {
+                if (removeData(name) != null) {
+                    logger.debug("Removed data '" + name + "' successfully.");
+                }
+            }
         }
 
         current.validate(this);

http://dive4elements.wald.intevation.org