@Override public Object visit(ASTBlock node, Object data) { String prefix = node.getPrefix(); if (prefix.length() > 0) { node.childrenAccept(this, null); } return null; }
/** * @see org.apache.velocity.runtime.parser.node.SimpleNode#render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) */ public boolean render( InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException, ResourceNotFoundException, ParseErrorException { int i, k = jjtGetNumChildren(); for (i = 0; i < k; i++) jjtGetChild(i).render(context, writer); return true; } }
@Override public void writeOut(Writer out) throws IOException { block.render(context, out); }
case WHITESPACE: t = jj_consume_token(WHITESPACE); previousBlock.setPostfix(t.image); t = null; break; ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtn001.setPrefix(t == null ? u.image : t.image + u.image); t = u = null; afterNewline = true; if (pos > 0) previousBlock.setMorePostfix(_else.image.substring(0, pos));
try { jj_consume_token(ELSE_DIRECTIVE); ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
/** * @see org.apache.velocity.runtime.parser.node.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTBlock, java.lang.Object) */ public Object visit(ASTBlock node, Object data) { data = node.childrenAccept(this, data); return data; }
/** * @throws TemplateInitException * @see org.apache.velocity.runtime.parser.node.Node#init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object) */ public Object init( InternalContextAdapter context, Object data) throws TemplateInitException { Object obj = super.init(context, data); cleanupParserAndTokens(); // drop reference to Parser and all JavaCC Tokens return obj; }
case WHITESPACE: t = jj_consume_token(WHITESPACE); previousBlock.setPostfix(t.image); t = null; break; Expression(); jj_consume_token(RPAREN); ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtn001.setPrefix(t == null ? u.image : t.image + u.image); t = u = null; afterNewline = true; if (pos > 0) previousBlock.setMorePostfix(elseif.image.substring(0, pos));
try { jj_consume_token(ELSE_DIRECTIVE); ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
/** * @see org.apache.velocity.runtime.parser.node.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTBlock, java.lang.Object) */ public Object visit(ASTBlock node, Object data) { data = node.childrenAccept(this, data); return data; }
Expression(); jj_consume_token(RPAREN); ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtn001.setPrefix(t == null ? u.image : t.image + u.image); t = u = null; afterNewline = true; lastBlock.setPostfix(t.image); t = null; } else { if (pos > 0) lastBlock.setMorePostfix(end.image.substring(0, pos));
try { jj_consume_token(ELSE_DIRECTIVE); ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
/** * @see org.apache.velocity.runtime.parser.node.SimpleNode#render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) */ public boolean render( InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException, ResourceNotFoundException, ParseErrorException { int i, k = jjtGetNumChildren(); for (i = 0; i < k; i++) jjtGetChild(i).render(context, writer); return true; } }
/** * @see org.apache.velocity.runtime.parser.node.ParserVisitor#visit(org.apache.velocity.runtime.parser.node.ASTBlock, java.lang.Object) */ public Object visit(ASTBlock node, Object data) { data = node.childrenAccept(this, data); return data; }
@Override public void invoke(Writer out) throws JspException, IOException { block.render(context, out); }
ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtc001 = false; block = jjtn001; block.setPrefix(blockPrefix); } catch (Throwable jjte001) { if (jjtc001) { block.setPostfix(t.image); t = null; } else { if (pos > 0) block.setMorePostfix(end.image.substring(0, pos)); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false;
ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
/** * @see org.apache.velocity.runtime.parser.node.SimpleNode#render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer) */ public boolean render( InternalContextAdapter context, Writer writer) throws IOException, MethodInvocationException, ResourceNotFoundException, ParseErrorException { SpaceGobbling spaceGobbling = rsvc.getSpaceGobbling(); if (spaceGobbling == SpaceGobbling.NONE) { writer.write(prefix); } int i, k = jjtGetNumChildren(); for (i = 0; i < k; i++) jjtGetChild(i).render(context, writer); if (morePostfix.length() > 0 || spaceGobbling.compareTo(SpaceGobbling.LINES) < 0) { writer.write(postfix); } writer.write(morePostfix); return true; } }
@Override public String getString() { StringWriter stringWriter = new StringWriter(); try { block.render(context, stringWriter); stringWriter.close(); return stringWriter.toString(); } catch (MethodInvocationException e) { throw new VelocityToolsJspException( "Cannot invoke a method while rendering a body", e); } catch (ResourceNotFoundException e) { throw new VelocityToolsJspException( "Cannot find a resource while rendering a body", e); } catch (ParseErrorException e) { throw new VelocityToolsJspException( "Cannot parse while rendering a body", e); } catch (IOException e) { throw new VelocityToolsJspException( "I/O exception while rendering a body", e); } }
{if (true) return jjtn000;} ASTBlock jjtn001 = new ASTBlock(this, JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);