Mercurial > dive4elements > river
changeset 4915:bbedd9af069e dc-km-filter
[branch dc-km-filter] StackFrames: New putGlobal to add variable to bottom of stack.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 30 Jan 2013 15:52:05 +0100 |
parents | 4d1e2a0c283a |
children | 2cec81e697e8 |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/StackFrames.java |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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);