01: package org.ztemplates.actions.expression;
02:
03: import org.ztemplates.actions.util.ZFormatUtil;
04:
05: public class ZSlash implements ZTerm {
06:
07: public String parse(String s) throws ZParserException {
08: if (s.charAt(0) != '/') {
09: throw new ZParserException(s, "slash must start with '/'");
10: }
11:
12: return s.substring(1);
13: }
14:
15: public String toDefinition() {
16: return "/";
17: }
18:
19: public void toXml(StringBuffer sb, int depth) {
20: ZFormatUtil.indent(sb, depth);
21: sb.append("<slash/>");
22: }
23:
24: public String getText() {
25: return "/";
26: }
27: }
|