public final class GoogMsgDefNode extends AbstractParentSoyNode<MsgNode> implements SoyNode.StandaloneNode, SoyNode.SplitLevelTopNode<MsgNode>, SoyNode.LocalVarInlineNode
goog.getMsg* definition of a group of one or more messages. If more than one
message, then they form a fallback list (first message that has a translation will be shown).
Important: Do not use outside of Soy code (treat as superpackage-private).
All children are MsgNodes.
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 |
|---|
GoogMsgDefNode(int id,
MsgFallbackGroupNode origMsgFbGrpNode,
List<Long> childMsgIds)
Regular constructor.
|
| Modifier and Type | Method and Description |
|---|---|
GoogMsgDefNode |
clone()
Copies this node.
|
long |
getChildMsgId(MsgNode child)
Returns the msg id for the given child.
|
SoyNode.Kind |
getKind()
Returns this node's kind (corresponding to this node's specific type).
|
SoyNode.BlockNode |
getParent()
Gets this node's parent.
|
String |
getRenderedGoogMsgVarName()
Returns the JS var name of the rendered goog msg.
|
String |
getVarName()
Returns the name of this node's local variable (without the preceding '$').
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
addChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChild, toTreeStringgetId, getSourceLocation, setId, toStringcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParentequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChildcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toTreeStringpublic GoogMsgDefNode(int id,
MsgFallbackGroupNode origMsgFbGrpNode,
List<Long> childMsgIds)
id - The id for this node.origMsgFbGrpNode - The original MsgFallbackGroupNode that this node is based off. Note
this original node will be destructively modified.childMsgIds - The list of child msg ids (must correspond to children of origMsgFbGrpNode
by index).public SoyNode.Kind getKind()
SoyNodepublic long getChildMsgId(MsgNode child)
public String getRenderedGoogMsgVarName()
public String getVarName()
SoyNode.LocalVarNodegetVarName in interface SoyNode.LocalVarNodepublic String toSourceString()
NodetoSourceString in interface Nodepublic SoyNode.BlockNode getParent()
NodegetParent in interface NodegetParent in interface SoyNodegetParent in interface SoyNode.StandaloneNodegetParent in class AbstractSoyNodepublic GoogMsgDefNode clone()
NodeAll clone() overrides should follow this contract:
{@literal @}Override public T clone() {
return new T(this);
}
NOTE: this means we do not ultimately delegate to Object.clone(), ever.
TODO(lukes): The usecases for a clone method are few and far between. Making the AST nodes immutable (or at least unmodifiable) would be preferable to maintaining our clone() methods.