/** * Dump the raw template in canonical form. */ public void dump(PrintStream ps) { ps.print(rootElement.getCanonicalForm()); }
/** * Dump the raw template in canonical form. */ public void dump(Writer out) throws IOException { out.write(rootElement.getCanonicalForm()); }
static String getChildrenCanonicalForm(TemplateElement[] children) { if (children == null) { return ""; } StringBuilder sb = new StringBuilder(); for (TemplateElement child : children) { if (child == null) { break; } sb.append(child.getCanonicalForm()); } return sb.toString(); }
@Override protected String dump(boolean canonical) { if (canonical) { StringBuilder sb = new StringBuilder(); sb.append("<#-- "); sb.append("debug break"); if (getChildCount() == 0) { sb.append(" /-->"); } else { sb.append(" -->"); sb.append(getChild(0).getCanonicalForm()); sb.append("<#--/ debug break -->"); } return sb.toString(); } else { return "debug break"; } }
@Override protected String dump(boolean canonical) { StringBuilder buf = new StringBuilder(); if (canonical) buf.append('<'); buf.append(getNodeTypeSymbol()); buf.append(' '); buf.append(searched.getCanonicalForm()); if (canonical) { buf.append('>'); int ln = getChildCount(); for (int i = 0; i < ln; i++) { buf.append(getChild(i).getCanonicalForm()); } buf.append("</").append(getNodeTypeSymbol()).append('>'); } return buf.toString(); }
final String canonicalForm = templateElement.getCanonicalForm();
public String getCanonicalForm() { return nestedBlock.getCanonicalForm(); } }
public String getCanonicalForm() { String nested = nestedBlock != null ? nestedBlock.getCanonicalForm() : ""; return "<#compress>" + nested + "</#compress>"; }
/** * Dump the raw template in canonical form. */ public void dump(PrintStream ps) { ps.print(rootElement.getCanonicalForm()); }
/** * Dump the raw template in canonical form. */ public void dump(Writer out) throws IOException { out.write(rootElement.getCanonicalForm()); }
/** * Dump the raw template in canonical form. */ public void dump(PrintStream ps) { ps.print(rootElement.getCanonicalForm()); }
/** * Dump the raw template in canonical form. */ public void dump(PrintStream ps) { ps.print(rootElement.getCanonicalForm()); }
/** * Dump the raw template in canonical form. */ public void dump(Writer out) throws IOException { out.write(rootElement.getCanonicalForm()); }
/** * Dump the raw template in canonical form. */ public void dump(Writer out) throws IOException { out.write(rootElement.getCanonicalForm()); }
public String getCanonicalForm() { StringBuffer buf = new StringBuffer("<#attempt>"); if (attemptBlock != null) { buf.append(attemptBlock.getCanonicalForm()); } if (recoveryBlock != null) { buf.append(recoveryBlock.getCanonicalForm()); } return buf.toString(); }
public String getCanonicalForm() { StringBuffer buf = new StringBuffer("<#recover>"); if (nestedBlock != null) { buf.append(nestedBlock.getCanonicalForm()); } buf.append("/#recover"); return buf.toString(); }
static String getChildrenCanonicalForm(TemplateElement[] children) { if (children == null) { return ""; } StringBuilder sb = new StringBuilder(); for (TemplateElement child : children) { if (child == null) { break; } sb.append(child.getCanonicalForm()); } return sb.toString(); }
public String getCanonicalForm() { StringBuffer buf = new StringBuffer(); for (int i = 0; i<nestedElements.size(); i++) { TemplateElement element = (TemplateElement) nestedElements.get(i); buf.append(element.getCanonicalForm()); } return buf.toString(); }
public String getCanonicalForm() { return "<#escape " + variable + " as " + expr.getCanonicalForm() + ">" + nestedBlock.getCanonicalForm() + "</#escape>"; } }
private void extractVariables(TemplateElement templateElement, FieldsExtractor extractor) throws TemplateModelException { if (DOLLAR_VARIABLE.equals(templateElement.getClass().getSimpleName())) { String fieldName = templateElement.getCanonicalForm(); fieldName = fieldName.substring(2, fieldName.length() - 1); extractor.addFieldName(fieldName); } Enumeration<TemplateElement> enums = templateElement.children(); while (enums.hasMoreElements()) { TemplateElement element = (TemplateElement) enums.nextElement(); extractVariables(element, extractor); } }