]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/template/ForeachStatement.java
UPD: Move some template classes to there reightful place.
[gigi.git] / src / org / cacert / gigi / output / template / ForeachStatement.java
index 0b3c52697efe2554e89bd6cdf89ca51c9282fa42..edabab774c457eabe432f2aa49f65526db694967 100644 (file)
@@ -4,27 +4,28 @@ import java.io.PrintWriter;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.cacert.gigi.Language;
-import org.cacert.gigi.output.Outputable;
+import org.cacert.gigi.localisation.Language;
 
-final class ForeachStatement implements Outputable {
-       private final String variable;
-       private final TemplateBlock body;
+public final class ForeachStatement implements Outputable {
 
-       ForeachStatement(String variable, TemplateBlock body) {
-               this.variable = variable;
-               this.body = body;
-       }
+    private final String variable;
 
-       @Override
-       public void output(PrintWriter out, Language l, Map<String, Object> vars) {
-               Object o = vars.get(variable);
-               if (o instanceof IterableDataset) {
-                       IterableDataset id = (IterableDataset) o;
-                       Map<String, Object> subcontext = new HashMap<String, Object>(vars);
-                       while (id.next(subcontext)) {
-                               body.output(out, l, subcontext);
-                       }
-               }
-       }
-}
\ No newline at end of file
+    private final TemplateBlock body;
+
+    public ForeachStatement(String variable, TemplateBlock body) {
+        this.variable = variable;
+        this.body = body;
+    }
+
+    @Override
+    public void output(PrintWriter out, Language l, Map<String, Object> vars) {
+        Object o = vars.get(variable);
+        if (o instanceof IterableDataset) {
+            IterableDataset id = (IterableDataset) o;
+            Map<String, Object> subcontext = new HashMap<String, Object>(vars);
+            while (id.next(l, subcontext)) {
+                body.output(out, l, subcontext);
+            }
+        }
+    }
+}