01: package cb.jdynamite.analyser;
02:
03: import cb.jdynamite.ITemplateDocument;
04:
05: public class ConstantElement implements ITemplateElement {
06: private String value;
07:
08: public ConstantElement(String constant) {
09: value = constant;
10: }
11:
12: public String getValue(ITemplateDocument rootDocument) {
13: return value;
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("ConstantElement: ");
22: def.append(value.replace('\n', ' ')); // Just for presentation
23: def.append('\n');
24: return def.toString();
25: }
26: }
|