public class GenJsCodeVisitorAssistantForMsgs extends AbstractSoyNodeVisitor<Void>
Precondition: MsgNode should not exist in the tree.
| Modifier and Type | Field and Description |
|---|---|
protected GenJsCodeVisitor |
master
Master instance of GenJsCodeVisitor.
|
protected TranslationContext |
translationContext |
| Modifier | Constructor and Description |
|---|---|
protected |
GenJsCodeVisitorAssistantForMsgs(GenJsCodeVisitor master,
SoyJsSrcOptions jsSrcOptions,
GenCallCodeUtils genCallCodeUtils,
IsComputableAsJsExprsVisitor isComputableAsJsExprsVisitor,
TemplateAliases functionAliases,
GenJsExprsVisitor genJsExprsVisitor,
TranslationContext translationContext,
ErrorReporter errorReporter) |
| Modifier and Type | Method and Description |
|---|---|
Void |
exec(SoyNode node)
Executes the function defined by this visitor.
|
CodeChunk.WithValue |
generateMsgGroupVariable(MsgFallbackGroupNode node)
Returns a code chunk representing a translated variable.
|
protected CodeChunk.WithValue |
genGoogMsgPlaceholder(MsgPlaceholderNode msgPhNode)
Returns a code chunk for the given placeholder node.
|
protected void |
visitMsgHtmlTagNode(MsgHtmlTagNode node)
Example:
|
protected void |
visitSoyNode(SoyNode node) |
visit, visitCallBasicNode, visitCallDelegateNode, visitCallNode, visitCallParamContentNode, visitCallParamNode, visitCallParamValueNode, visitChildren, visitChildrenAllowingConcurrentModification, visitDebuggerNode, visitForIfemptyNode, visitForNode, visitForNonemptyNode, visitHtmlAttributeNode, visitHtmlAttributeValueNode, visitHtmlCloseTagNode, visitHtmlCommentNode, visitHtmlOpenTagNode, visitIfCondNode, visitIfElseNode, visitIfNode, visitLetContentNode, visitLetNode, visitLetValueNode, visitLogNode, visitMsgFallbackGroupNode, visitMsgNode, visitMsgPlaceholderNode, visitMsgPluralCaseNode, visitMsgPluralDefaultNode, visitMsgPluralNode, visitMsgSelectCaseNode, visitMsgSelectDefaultNode, visitMsgSelectNode, visitMsgSubstUnitNode, visitPrintDirectiveNode, visitPrintNode, visitRawTextNode, visitSoyFileNode, visitSoyFileSetNode, visitSwitchCaseNode, visitSwitchDefaultNode, visitSwitchNode, visitTemplateBasicNode, visitTemplateDelegateNode, visitTemplateNode, visitVeLogNodevisitChildren, visitChildrenAllowingConcurrentModificationprotected final GenJsCodeVisitor master
protected final TranslationContext translationContext
protected GenJsCodeVisitorAssistantForMsgs(GenJsCodeVisitor master, SoyJsSrcOptions jsSrcOptions, GenCallCodeUtils genCallCodeUtils, IsComputableAsJsExprsVisitor isComputableAsJsExprsVisitor, TemplateAliases functionAliases, GenJsExprsVisitor genJsExprsVisitor, TranslationContext translationContext, ErrorReporter errorReporter)
public Void exec(SoyNode node)
NodeVisitorexec in interface NodeVisitor<SoyNode,Void>exec in class AbstractNodeVisitor<SoyNode,Void>node - The node to execute the function on.public CodeChunk.WithValue generateMsgGroupVariable(MsgFallbackGroupNode node)
Example:
{msg desc="Link to help content."}Learn more{/msg}
{msg desc="Tells user how to access a product." hidden="true"}
Click <a href="}{$url}">here</a> to access {$productName}.
{/msg}
might return the following code chunk:
/** @desc Link to help content. * /
var MSG_UNNAMED_9 = goog.getMsg('Learn more');
var msg_s9 = MSG_UNNAMED_9;
/** @desc Tells user how to access a product.
* @hidden * /
var MSG_UNNAMED_10 = goog.getMsg(
'Click {$startLink}here{$endLink} to access {$productName}.',
{startLink: '<a href="' + opt_data.url + '">',
endLink: '</a>',
productName: opt_data.productName});
protected CodeChunk.WithValue genGoogMsgPlaceholder(MsgPlaceholderNode msgPhNode)
protected void visitMsgHtmlTagNode(MsgHtmlTagNode node)
<a href="http://www.google.com/search?hl=en
{for $i in range(3)}
¶m{$i}={$i}
{/for}
">
might generate
var htmlTag84 = (new soy.StringBuilder()).append('<a href="'); for (var i80 = 1; i80 < 3;
i80++) { htmlTag84.append('¶m', i80, '=', i80); } htmlTag84.append('">'); visitMsgHtmlTagNode in class AbstractSoyNodeVisitor<Void>protected void visitSoyNode(SoyNode node)
visitSoyNode in class AbstractSoyNodeVisitor<Void>node - the visited node.