01: package cb.jdynamite.analyser;
02:
03: import cb.jdynamite.ITemplateDocument;
04:
05: public class VariableElement implements ITemplateElement {
06: private String key;
07:
08: public VariableElement(String key) {
09: this .key = key;
10: }
11:
12: public String getValue(ITemplateDocument rootDocument) {
13: return rootDocument.getVariable(key);
14: }
15:
16: public String getDefinition(int depth) {
17: StringBuffer def = new StringBuffer();
18: for (int indent = 0; indent < depth; indent++) {
19: def.append(" ");
20: }
21: def.append("VariableElement: ");
22: def.append(key);
23: def.append('\n');
24: return def.toString();
25: }
26: }
|