use of org.apache.jsieve.parser.generated.ASTstring in project zm-mailbox by Zimbra.
the class RuleRewriter method action.
private void action(Element elem, Node node) {
int numChildren = node.jjtGetNumChildren();
for (int i = 0; i < numChildren; i++) {
Node childNode = node.jjtGetChild(i);
if (childNode instanceof ASTstring) {
String val = ((SieveNode) childNode).getValue().toString();
if (val.startsWith("text:")) {
elem.addText(val.substring(5));
} else {
// Put quotes around value to maintain backward compatibility
// with ZCS 5.x. See bug 39911.
StringBuilder buf = new StringBuilder();
if (!val.startsWith("\"")) {
buf.append('"');
}
buf.append(val);
if (!val.endsWith("\"")) {
buf.append('"');
}
elem.addElement(MailConstants.E_FILTER_ARG).setText(buf.toString());
}
} else {
action(elem, childNode);
}
}
}
Aggregations