Package org.apache.jasper.compiler
Class TextOptimizer.TextCatVisitor
- java.lang.Object
-
- org.apache.jasper.compiler.Node.Visitor
-
- org.apache.jasper.compiler.TextOptimizer.TextCatVisitor
-
- Enclosing class:
- TextOptimizer
static class TextOptimizer.TextCatVisitor extends Node.Visitor
A visitor to concatenate contiguous template texts.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
emptyText
private Node.TemplateText
firstTextNode
private boolean
prePass
private java.lang.StringBuilder
textBuffer
private int
textNodeCount
private boolean
trim
-
Constructor Summary
Constructors Constructor Description TextCatVisitor(boolean prePass, boolean trim)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
collectText()
This method breaks concatenation mode.void
doVisit(Node n)
This method provides a place to put actions that are common to all nodes.void
visit(Node.AttributeDirective n)
void
visit(Node.PageDirective n)
void
visit(Node.TagDirective n)
void
visit(Node.TaglibDirective n)
void
visit(Node.TemplateText n)
void
visit(Node.VariableDirective n)
void
visitBody(Node n)
Visit the body of a node, using the current visitor
-
-
-
Field Detail
-
textNodeCount
private int textNodeCount
-
firstTextNode
private Node.TemplateText firstTextNode
-
textBuffer
private java.lang.StringBuilder textBuffer
-
emptyText
private final java.lang.String emptyText
-
prePass
private boolean prePass
-
trim
private boolean trim
-
-
Method Detail
-
doVisit
public void doVisit(Node n) throws JasperException
Description copied from class:Node.Visitor
This method provides a place to put actions that are common to all nodes. Override this in the child visitor class if need to.- Overrides:
doVisit
in classNode.Visitor
- Throws:
JasperException
-
visit
public void visit(Node.PageDirective n) throws JasperException
- Overrides:
visit
in classNode.Visitor
- Throws:
JasperException
-
visit
public void visit(Node.TagDirective n) throws JasperException
- Overrides:
visit
in classNode.Visitor
- Throws:
JasperException
-
visit
public void visit(Node.TaglibDirective n) throws JasperException
- Overrides:
visit
in classNode.Visitor
- Throws:
JasperException
-
visit
public void visit(Node.AttributeDirective n) throws JasperException
- Overrides:
visit
in classNode.Visitor
- Throws:
JasperException
-
visit
public void visit(Node.VariableDirective n) throws JasperException
- Overrides:
visit
in classNode.Visitor
- Throws:
JasperException
-
visitBody
public void visitBody(Node n) throws JasperException
Description copied from class:Node.Visitor
Visit the body of a node, using the current visitor- Overrides:
visitBody
in classNode.Visitor
- Throws:
JasperException
-
visit
public void visit(Node.TemplateText n) throws JasperException
- Overrides:
visit
in classNode.Visitor
- Throws:
JasperException
-
collectText
private void collectText()
This method breaks concatenation mode. As a side effect it copies the concatenated string to the first text node
-
-