public final class HtmlTransformVisitor extends AbstractSoyNodeVisitor<Void>
RawTextNodes to
the following nodes:
Also annotates msg and print nodes with their HtmlContext.
RawTextNodes not found in a place where HTML or attributes may be present, such as in a
XidNode, are left alone.| Constructor and Description |
|---|
HtmlTransformVisitor(ErrorReporter errorReporter) |
| Modifier and Type | Method and Description |
|---|---|
Void |
exec(SoyNode node)
Transforms all the
RawTextNodes corresponding to HTML to the
corresponding Html*Node. |
protected void |
visitCallNode(CallNode node)
Visits a
CallNode - makes sure that the node does not occur in an invalid location. |
protected void |
visitCallParamContentNode(CallParamContentNode node) |
protected void |
visitCssNode(CssNode node) |
protected void |
visitIfCondNode(IfCondNode node) |
protected void |
visitIfElseNode(IfElseNode node) |
protected void |
visitLetContentNode(LetContentNode node) |
protected void |
visitLogNode(LogNode node) |
protected void |
visitLoopNode(SoyNode.LoopNode node) |
protected void |
visitMsgFallbackGroupNode(MsgFallbackGroupNode node) |
protected void |
visitPrintNode(PrintNode node)
Visits a
PrintNode, annotating it with an HtmlContext. |
protected void |
visitRawTextNode(RawTextNode node)
Visits a
RawTextNode, going through each of the characters and building up the HTML
pieces (e.g. |
protected void |
visitSoyFileNode(SoyFileNode node)
Visits a
SoyFileNode, making sure it has strict autoescape. |
protected void |
visitSoyFileSetNode(SoyFileSetNode node)
Visits a
SoyFileNode, getting its id generator. |
protected void |
visitSoyNode(SoyNode node) |
protected void |
visitSwitchCaseNode(SwitchCaseNode node) |
protected void |
visitSwitchDefaultNode(SwitchDefaultNode node) |
protected void |
visitTemplateNode(TemplateNode node)
Visits a
TemplateNode, processing those that have kind html or
attributes and making sure that the autoescape mode is strict. |
protected void |
visitXidNode(XidNode node) |
visit, visitCallBasicNode, visitCallDelegateNode, visitCallParamNode, visitCallParamValueNode, visitChildren, visitChildrenAllowingConcurrentModification, visitDebuggerNode, visitForeachIfemptyNode, visitForeachNode, visitForeachNonemptyNode, visitForNode, visitIfNode, visitLetNode, visitLetValueNode, visitMsgHtmlTagNode, visitMsgNode, visitMsgPlaceholderNode, visitMsgPluralCaseNode, visitMsgPluralDefaultNode, visitMsgPluralNode, visitMsgSelectCaseNode, visitMsgSelectDefaultNode, visitMsgSelectNode, visitMsgSubstUnitNode, visitPrintDirectiveNode, visitSwitchNode, visitTemplateBasicNode, visitTemplateDelegateNodevisitChildren, visitChildrenAllowingConcurrentModificationpublic HtmlTransformVisitor(ErrorReporter errorReporter)
public Void exec(SoyNode node)
RawTextNodes corresponding to HTML to the
corresponding Html*Node. Additionally, nodes that occur in HTML data
or attributes declarations are annotated with HtmlContext.exec in interface NodeVisitor<SoyNode,Void>exec in class AbstractNodeVisitor<SoyNode,Void>node - The node to execute the function on.AbstractNodeVisitor.exec(com.google.template.soy.basetree.Node)protected void visitRawTextNode(RawTextNode node)
RawTextNode, going through each of the characters and building up the HTML
pieces (e.g. HtmlOpenTagStartNode and HtmlOpenTagEndNode). The new pieces are
mapped to the RawTextNode where they ended. The applyTransforms() method
actually performs the replacement.visitRawTextNode in class AbstractSoyNodeVisitor<Void>protected void visitPrintNode(PrintNode node)
PrintNode, annotating it with an HtmlContext. This allows the code
generator to handle HTML print statements separately and know the state in which they occurred.
If the PrintNode occurs in HtmlContext.HTML_NORMAL_ATTR_VALUE, the print node
becomes part of the current attribute's value.visitPrintNode in class AbstractSoyNodeVisitor<Void>protected void visitLetContentNode(LetContentNode node)
visitLetContentNode in class AbstractSoyNodeVisitor<Void>protected void visitCallParamContentNode(CallParamContentNode node)
visitCallParamContentNode in class AbstractSoyNodeVisitor<Void>protected void visitSoyFileNode(SoyFileNode node)
SoyFileNode, making sure it has strict autoescape.visitSoyFileNode in class AbstractSoyNodeVisitor<Void>protected void visitSoyFileSetNode(SoyFileSetNode node)
SoyFileNode, getting its id generator.visitSoyFileSetNode in class AbstractSoyNodeVisitor<Void>protected void visitTemplateNode(TemplateNode node)
TemplateNode, processing those that have kind html or
attributes and making sure that the autoescape mode is strict.visitTemplateNode in class AbstractSoyNodeVisitor<Void>protected void visitCallNode(CallNode node)
CallNode - makes sure that the node does not occur in an invalid location.visitCallNode in class AbstractSoyNodeVisitor<Void>protected void visitIfCondNode(IfCondNode node)
visitIfCondNode in class AbstractSoyNodeVisitor<Void>protected void visitIfElseNode(IfElseNode node)
visitIfElseNode in class AbstractSoyNodeVisitor<Void>protected void visitSwitchCaseNode(SwitchCaseNode node)
visitSwitchCaseNode in class AbstractSoyNodeVisitor<Void>protected void visitSwitchDefaultNode(SwitchDefaultNode node)
visitSwitchDefaultNode in class AbstractSoyNodeVisitor<Void>protected void visitLoopNode(SoyNode.LoopNode node)
visitLoopNode in class AbstractSoyNodeVisitor<Void>protected void visitCssNode(CssNode node)
visitCssNode in class AbstractSoyNodeVisitor<Void>protected void visitXidNode(XidNode node)
visitXidNode in class AbstractSoyNodeVisitor<Void>protected void visitMsgFallbackGroupNode(MsgFallbackGroupNode node)
visitMsgFallbackGroupNode in class AbstractSoyNodeVisitor<Void>protected void visitLogNode(LogNode node)
visitLogNode in class AbstractSoyNodeVisitor<Void>protected void visitSoyNode(SoyNode node)
visitSoyNode in class AbstractSoyNodeVisitor<Void>node - the visited node.