public abstract class AbstractParentExprNode extends AbstractExprNode implements ExprNode.ParentExprNode
Important: Do not use outside of Soy code (treat as superpackage-private).
ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNode| Modifier | Constructor and Description |
|---|---|
protected |
AbstractParentExprNode(AbstractParentExprNode orig,
CopyState copyState)
Copy constructor.
|
protected |
AbstractParentExprNode(SourceLocation sourceLocation) |
protected |
AbstractParentExprNode(SoyType type,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(ExprNode child)
Adds the given child.
|
void |
addChild(int index,
ExprNode child)
Adds the given child at the given index (shifting existing children if necessary).
|
void |
addChildren(int index,
List<? extends ExprNode> children)
Adds the given children at the given index (shifting existing children if necessary).
|
void |
addChildren(List<? extends ExprNode> 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.
|
ExprNode |
getChild(int index)
Gets the child at the given index.
|
int |
getChildIndex(Node child)
Finds the index of the given child.
|
List<ExprNode> |
getChildren()
Gets the list of children.
|
SoyType |
getType()
Gets the data type of this node.
|
int |
numChildren()
Gets the number of children.
|
void |
removeChild(ExprNode child)
Removes the given child.
|
void |
removeChild(int index)
Removes the child at the given index.
|
void |
replaceChild(ExprNode currChild,
ExprNode newChild)
Replaces the given current child with the given new child.
|
void |
replaceChild(int index,
ExprNode newChild)
Replaces the child at the given index with the given new child.
|
void |
setType(SoyType type) |
getParent, getSourceLocationcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionUpperBound, hasAncestor, maybeSetSyntaxVersionUpperBound, setParent, toSourceStringprotected AbstractParentExprNode(SourceLocation sourceLocation)
protected AbstractParentExprNode(SoyType type, SourceLocation sourceLocation)
protected AbstractParentExprNode(AbstractParentExprNode orig, CopyState copyState)
orig - The node to copy.public SoyType getType()
ExprNodepublic void setType(SoyType type)
public int numChildren()
ParentNodenumChildren in interface ParentNode<ExprNode>public ExprNode getChild(int index)
ParentNodegetChild in interface ParentNode<ExprNode>index - The index of the child to get.public int getChildIndex(Node child)
ParentNodegetChildIndex in interface ParentNode<ExprNode>child - The child to find the index of.public List<ExprNode> 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<ExprNode>public void addChild(ExprNode child)
ParentNodeaddChild in interface ParentNode<ExprNode>child - The child to add.public void addChild(int index,
ExprNode child)
ParentNodeaddChild in interface ParentNode<ExprNode>index - The index to add the child at.child - The child to add.public void removeChild(int index)
ParentNoderemoveChild in interface ParentNode<ExprNode>index - The index of the child to remove.public void removeChild(ExprNode child)
ParentNoderemoveChild in interface ParentNode<ExprNode>child - The child to remove.public void replaceChild(int index,
ExprNode newChild)
ParentNodereplaceChild in interface ParentNode<ExprNode>index - The index of the child to replace.newChild - The new child.public void replaceChild(ExprNode currChild, ExprNode newChild)
ParentNodereplaceChild in interface ParentNode<ExprNode>currChild - The current child to be replaced.newChild - The new child.public void clearChildren()
ParentNodeclearChildren in interface ParentNode<ExprNode>public void addChildren(List<? extends ExprNode> children)
ParentNodeaddChildren in interface ParentNode<ExprNode>children - The children to add.public void addChildren(int index,
List<? extends ExprNode> children)
ParentNodeaddChildren in interface ParentNode<ExprNode>index - The index to add the children at.children - The children to add.public void appendSourceStringForChildren(StringBuilder sb)
ParentNodeappendSourceStringForChildren in interface ParentNode<ExprNode>sb - The StringBuilder to which to append the children's source strings.