public final class CallParamContentNode extends CallParamNode implements SoyNode.RenderUnitNode
Important: Do not use outside of Soy code (treat as superpackage-private).
SoyNode.BlockCommandNode, SoyNode.BlockNode, SoyNode.CommandNode, SoyNode.ConditionalBlockNode, SoyNode.ExprHolderNode, SoyNode.Kind, SoyNode.LocalVarBlockNode, SoyNode.LocalVarInlineNode, SoyNode.LocalVarNode, SoyNode.MsgBlockNode, SoyNode.MsgPlaceholderInitialNode, SoyNode.MsgSubstUnitNode, SoyNode.ParentSoyNode<N extends SoyNode>, SoyNode.RenderUnitNode, SoyNode.SplitLevelTopNode<N extends SoyNode>, SoyNode.StandaloneNode, SoyNode.StatementNode| Constructor and Description |
|---|
CallParamContentNode(int id,
SourceLocation location,
Identifier key,
CommandTagAttribute kindAttr,
ErrorReporter errorReporter) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(int index,
SoyNode.StandaloneNode child)
Adds the given child at the given index (shifting existing children if necessary).
|
void |
addChild(SoyNode.StandaloneNode child)
Adds the given child.
|
void |
addChildren(int index,
List<? extends SoyNode.StandaloneNode> children)
Adds the given children at the given index (shifting existing children if necessary).
|
void |
addChildren(List<? extends SoyNode.StandaloneNode> children)
Adds the given children.
|
void |
appendSourceStringForChildren(StringBuilder sb)
Appends the source strings for all the children to the given StringBuilder.
|
void |
clearChildren()
Clears the list of children.
|
CallParamContentNode |
copy(CopyState copyState)
Copies this node.
|
SoyNode.StandaloneNode |
getChild(int index)
Gets the child at the given index.
|
int |
getChildIndex(Node child)
Finds the index of the given child.
|
List<SoyNode.StandaloneNode> |
getChildren()
Gets the list of children.
|
String |
getCommandName()
Returns the Soy command name.
|
String |
getCommandText()
Returns the command text (may be the empty string).
|
SanitizedContentKind |
getContentKind()
Returns the content kind for strict autoescape, or null if not specified or not applicable.
|
SoyNode.Kind |
getKind()
Returns this node's kind (corresponding to this node's specific type).
|
protected String |
getTagString() |
protected String |
getTagString(boolean selfEnding) |
int |
numChildren()
Gets the number of children.
|
void |
removeChild(int index)
Removes the child at the given index.
|
void |
removeChild(SoyNode.StandaloneNode child)
Removes the given child.
|
void |
replaceChild(int index,
SoyNode.StandaloneNode newChild)
Replaces the child at the given index with the given new child.
|
void |
replaceChild(SoyNode.StandaloneNode currChild,
SoyNode.StandaloneNode newChild)
Replaces the given current child with the given new child.
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
getKey, getParentgetId, getSourceLocation, setId, toStringcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParentclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCommandNamecouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionUpperBound, hasAncestor, maybeSetSyntaxVersionUpperBound, setParentpublic CallParamContentNode(int id,
SourceLocation location,
Identifier key,
@Nullable
CommandTagAttribute kindAttr,
ErrorReporter errorReporter)
public SoyNode.Kind getKind()
SoyNode@Nullable public SanitizedContentKind getContentKind()
SoyNode.RenderUnitNodegetContentKind in interface SoyNode.RenderUnitNodepublic String getCommandText()
SoyNode.CommandNodegetCommandText in interface SoyNode.CommandNodepublic String toSourceString()
NodeNote: Some nodes do not have a direct mapping to Soy source (such as nodes created during some optimization passes). Thus this method may not always be supported.
toSourceString in interface Nodepublic CallParamContentNode 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 int numChildren()
ParentNodenumChildren in interface ParentNode<SoyNode.StandaloneNode>public SoyNode.StandaloneNode getChild(int index)
ParentNodegetChild in interface ParentNode<SoyNode.StandaloneNode>index - The index of the child to get.public int getChildIndex(Node child)
ParentNodegetChildIndex in interface ParentNode<SoyNode.StandaloneNode>child - The child to find the index of.public List<SoyNode.StandaloneNode> getChildren()
ParentNodeNote: The returned list may not be a copy. Please do not modify the list directly. Instead, use the other methods in this class that are intended for modifying children. Also, if you're iterating over the children list as you're modifying it, then you should first make a copy of the children list to iterate over, in order to avoid ConcurrentModificationException.
getChildren in interface ParentNode<SoyNode.StandaloneNode>public void addChild(SoyNode.StandaloneNode child)
ParentNodeaddChild in interface ParentNode<SoyNode.StandaloneNode>child - The child to add.public void addChild(int index,
SoyNode.StandaloneNode child)
ParentNodeaddChild in interface ParentNode<SoyNode.StandaloneNode>index - The index to add the child at.child - The child to add.public void removeChild(int index)
ParentNoderemoveChild in interface ParentNode<SoyNode.StandaloneNode>index - The index of the child to remove.public void removeChild(SoyNode.StandaloneNode child)
ParentNoderemoveChild in interface ParentNode<SoyNode.StandaloneNode>child - The child to remove.public void replaceChild(int index,
SoyNode.StandaloneNode newChild)
ParentNodereplaceChild in interface ParentNode<SoyNode.StandaloneNode>index - The index of the child to replace.newChild - The new child.public void replaceChild(SoyNode.StandaloneNode currChild, SoyNode.StandaloneNode newChild)
ParentNodereplaceChild in interface ParentNode<SoyNode.StandaloneNode>currChild - The current child to be replaced.newChild - The new child.public void clearChildren()
ParentNodeclearChildren in interface ParentNode<SoyNode.StandaloneNode>public void addChildren(List<? extends SoyNode.StandaloneNode> children)
ParentNodeaddChildren in interface ParentNode<SoyNode.StandaloneNode>children - The children to add.public void addChildren(int index,
List<? extends SoyNode.StandaloneNode> children)
ParentNodeaddChildren in interface ParentNode<SoyNode.StandaloneNode>index - The index to add the children at.children - The children to add.public void appendSourceStringForChildren(StringBuilder sb)
ParentNodeappendSourceStringForChildren in interface ParentNode<SoyNode.StandaloneNode>sb - The StringBuilder to which to append the children's source strings.public String getCommandName()
SoyNode.CommandNodegetCommandName in interface SoyNode.CommandNodeprotected String getTagString()
protected final String getTagString(boolean selfEnding)