01: package org.ztemplates.actions.urlhandler.tree.term;
02:
03: import org.ztemplates.actions.expression.ZParserException;
04: import org.ztemplates.actions.util.ZFormatUtil;
05:
06: public class ZTreeVariable extends ZTreeTerm {
07: private final String name;
08:
09: public ZTreeVariable(Class clazz, String name)
10: throws ZParserException {
11: super (clazz);
12: this .name = name;
13: }
14:
15: public String getName() {
16: return name;
17: }
18:
19: public void toXml(StringBuffer sb, int depth) {
20: ZFormatUtil.indent(sb, depth);
21: sb.append("<variable name=\"" + name + "\"/>");
22: }
23:
24: public String toDefinition() {
25: return "${" + name + "}";
26: }
27: }
|