[Dive4elements-commits] [PATCH 2 of 4] [branch dc-km-filter] StackFrames: New putGlobal to add variable to bottom of stack

Wald Commits scm-commit at wald.intevation.org
Wed Jan 30 15:47:42 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1359557525 -3600
# Branch dc-km-filter
# Node ID bbedd9af069e9351fe81d83ac68c9b383d9c6b4e
# Parent  4d1e2a0c283a16d33b34212c5a31c44a6e1bebc7
[branch dc-km-filter] StackFrames: New putGlobal to add variable to bottom of stack.

diff -r 4d1e2a0c283a -r bbedd9af069e flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/StackFrames.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/StackFrames.java	Wed Jan 30 14:32:46 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/StackFrames.java	Wed Jan 30 15:52:05 2013 +0100
@@ -57,6 +57,15 @@
         }
     }
 
+    public void putGlobal(String key, Object value) {
+        if (!frames.isEmpty()) {
+            frames.get(0).put(key, value);
+        }
+        else {
+            log.warn("Try to register global variable, but no frames!");
+        }
+    }
+
     /** Put multiple Key/Values in last String->Object map. */
     public void put(String [] keys, Object [] values) {
         Map<String, Object> top = frames.get(frames.size()-1);


More information about the Dive4elements-commits mailing list