public final class MsgFallbackGroupNode extends AbstractParentSoyNode<MsgNode> implements SoyNode.StandaloneNode, SoyNode.SplitLevelTopNode<MsgNode>, SoyNode.StatementNode
Only one fallbackmsg is allowed by the parser.
com.google.template.soy.soyparse.TemplateParserTest.java#testRecognizeCommands
TODO(user): fix the grammar.
Important: Do not use outside of Soy code (treat as superpackage-private).
All children are MsgNodes. And conversely, all MsgNodes must be children of
MsgFallbackGroupNodes through parsing and middleend passes (backends may have their own
special structure for messages).
SoyNode.BlockCommandNode, SoyNode.BlockNode, SoyNode.CommandNode, SoyNode.ConditionalBlockNode, SoyNode.ExprHolderNode, SoyNode.Kind, SoyNode.LocalVarBlockNode, SoyNode.LocalVarInlineNode, SoyNode.LocalVarNode, SoyNode.LoopNode, SoyNode.MsgBlockNode, SoyNode.MsgPlaceholderInitialNode, SoyNode.MsgSubstUnitNode, SoyNode.ParentSoyNode<N extends SoyNode>, SoyNode.RenderUnitNode, SoyNode.SplitLevelTopNode<N extends SoyNode>, SoyNode.StandaloneNode, SoyNode.StatementNodeSPACES| Constructor and Description |
|---|
MsgFallbackGroupNode(int id,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
MsgFallbackGroupNode |
copy(CopyState copyState)
Copies this node.
|
com.google.common.collect.ImmutableList<String> |
getEscapingDirectiveNames()
Returns the escaping directives, applied from left to right.
|
MsgNode |
getFallbackMsg() |
HtmlContext |
getHtmlContext()
Gets the HTML context (typically tag, attribute value, HTML PCDATA, or plain text) which
this node appears in.
|
SoyNode.Kind |
getKind()
Returns this node's kind (corresponding to this node's specific type).
|
MsgNode |
getMsg() |
SoyNode.BlockNode |
getParent()
Gets this node's parent.
|
boolean |
hasFallbackMsg() |
PrintNode |
makePrintNode(IdGenerator nodeIdGen,
VarDefn var)
Creates a print node that corresponds to this node, for tree rewriting.
|
void |
setEscapingDirectiveNames(com.google.common.collect.ImmutableList<String> escapingDirectiveNames)
Sets the inferred escaping directives from the contextual engine.
|
void |
setHtmlContext(HtmlContext value) |
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChildgetId, getSourceLocation, setId, toStringcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParentclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChildcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionUpperBound, hasAncestor, maybeSetSyntaxVersionUpperBound, setParentpublic MsgFallbackGroupNode(int id,
SourceLocation sourceLocation)
id - The id for this node.sourceLocation - The node's source location.public HtmlContext getHtmlContext()
public void setHtmlContext(HtmlContext value)
public PrintNode makePrintNode(IdGenerator nodeIdGen, VarDefn var)
public SoyNode.Kind getKind()
SoyNodepublic String toSourceString()
NodetoSourceString in interface Nodepublic SoyNode.BlockNode getParent()
NodegetParent in interface NodegetParent in interface SoyNodegetParent in interface SoyNode.StandaloneNodegetParent in class AbstractSoyNodepublic boolean hasFallbackMsg()
public MsgNode getMsg()
public MsgNode getFallbackMsg()
public MsgFallbackGroupNode copy(CopyState copyState)
SoyNodeAll copy() overrides should follow this contract:
{@literal @}Override public T copy(CopyState copyState) {
return new T(this, copyState);
}
TODO(lukes): The usecases for a copy method are few and far between. Making the AST nodes immutable (or at least unmodifiable) would be preferable to maintaining our copy() methods.
Don't clone nodes unless you know what you're doing. The Soy AST is not actually a tree (it contains back edges from variables to their definitions), and naively copying nodes can result in pointers into stale ASTs
The copied nodes will have the same ids as the original nodes. If you need to copy a
subtree with new ids assigned to the copied nodes, use SoytreeUtils.cloneWithNewIds(T, com.google.template.soy.base.internal.IdGenerator).
public void setEscapingDirectiveNames(com.google.common.collect.ImmutableList<String> escapingDirectiveNames)
public com.google.common.collect.ImmutableList<String> getEscapingDirectiveNames()
It is an error to call this before the contextual rewriter has been run.