]> WPIA git - gigi.git/blob - src/org/cacert/gigi/output/template/TemplateBlock.java
UPD: Move some template classes to there reightful place.
[gigi.git] / src / org / cacert / gigi / output / template / TemplateBlock.java
1 package org.cacert.gigi.output.template;
2
3 import java.io.PrintWriter;
4 import java.util.Map;
5
6 import org.cacert.gigi.localisation.Language;
7
8 class TemplateBlock implements Outputable {
9
10     private String[] contents;
11
12     private Outputable[] vars;
13
14     public TemplateBlock(String[] contents, Outputable[] vars) {
15         this.contents = contents;
16         this.vars = vars;
17     }
18
19     @Override
20     public void output(PrintWriter out, Language l, Map<String, Object> vars) {
21         for (int i = 0; i < contents.length; i++) {
22             out.print(contents[i]);
23             if (i < this.vars.length) {
24                 this.vars[i].output(out, l, vars);
25             }
26         }
27     }
28
29 }