Ejemplo n.º 1
0
 public String getCanonicalForm() {
   if (isForEach) {
     StringBuffer buf = new StringBuffer("<#foreach ");
     buf.append(indexName);
     buf.append(" in ");
     buf.append(listExpression.getCanonicalForm());
     buf.append(">");
     if (nestedBlock != null) {
       buf.append(nestedBlock.getCanonicalForm());
     }
     buf.append("</#foreach>");
     return buf.toString();
   } else {
     StringBuffer buf = new StringBuffer("<#list ");
     buf.append(listExpression.getCanonicalForm());
     buf.append(" as ");
     buf.append(indexName);
     buf.append(">");
     if (nestedBlock != null) {
       buf.append(nestedBlock.getCanonicalForm());
     }
     buf.append("</#list>");
     return buf.toString();
   }
 }
Ejemplo n.º 2
0
 public String getCanonicalForm() {
   StringBuilder buf = new StringBuilder("<#switch ");
   buf.append(testExpression.getCanonicalForm());
   buf.append(">");
   for (int i = 0; i < nestedElements.size(); i++) {
     Case cas = (Case) nestedElements.get(i);
     buf.append(cas.getCanonicalForm());
   }
   if (defaultCase != null) {
     buf.append(defaultCase.getCanonicalForm());
   }
   buf.append("</#switch>");
   return buf.toString();
 }
Ejemplo n.º 3
0
 protected String dump(boolean canonical) {
   StringBuilder sb = new StringBuilder();
   if (canonical) sb.append('<');
   sb.append(getNodeTypeSymbol())
       .append(' ')
       .append(_CoreStringUtils.toFTLTopLevelIdentifierReference(variable))
       .append(" as ")
       .append(expr.getCanonicalForm());
   if (canonical) {
     sb.append('>');
     if (getNestedBlock() != null) {
       sb.append(getNestedBlock().getCanonicalForm());
     }
     sb.append("</").append(getNodeTypeSymbol()).append('>');
   }
   return sb.toString();
 }
 @Override
 public String getCanonicalForm() {
   String op = isMinus ? "-" : "+";
   return op + target.getCanonicalForm();
 }
Ejemplo n.º 5
0
 public String getCanonicalForm() {
   return left.getCanonicalForm() + ' ' + opString + ' ' + right.getCanonicalForm();
 }
Ejemplo n.º 6
0
 public String getCanonicalForm() {
   String result = "<#recurse";
   if (targetNode != null) result += (" " + targetNode.getCanonicalForm());
   if (namespaces != null) result += (" using " + namespaces.getCanonicalForm());
   return result + "/>";
 }