public final class LetContentNode extends LetNode implements SoyNode.RenderUnitNode
Important: Do not use outside of Soy code (treat as superpackage-private).
| Modifier and Type | Class and Description |
|---|---|
static class |
LetContentNode.Builder
Builder for
LetContentNode. |
LetNode.CommandTextParseResultSoyNode.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.StatementNodeINVALID_COMMAND_TEXT, varSPACES| 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 |
appendTreeStringForChildren(StringBuilder sb,
int indent)
Appends the tree strings for all the children to the given StringBuilder, at one further
indentation level (3 spaces) than the given current indentation level.
|
protected String |
buildTagStringHelper(boolean isSelfEnding)
Helper to build the source tag string (usually for testing/debugging).
|
protected String |
buildTagStringHelper(boolean isSelfEnding,
boolean isImplicitCommandName)
Helper to build the source tag string (usually for testing/debugging).
|
void |
clearChildren()
Clears the list of children.
|
LetContentNode |
clone()
Copies this node.
|
SoyNode.StandaloneNode |
getChild(int index)
Gets the child at the given index.
|
int |
getChildIndex(SoyNode.StandaloneNode child)
Finds the index of the given child.
|
List<SoyNode.StandaloneNode> |
getChildren()
Gets the list of children.
|
String |
getCommandName()
May be overridden by subclasses to keep consistent with tree modifications.
|
String |
getCommandText()
May be overridden by subclasses to keep consistent with tree modifications.
|
SanitizedContent.ContentKind |
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).
|
String |
getTagString()
Builds a Soy tag string that could be the Soy tag for this node.
|
String |
getVarName()
Return The local variable name (without preceding '$').
|
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.
|
String |
toTreeString(int indent)
Builds a string that visually shows the subtree rooted at this node (for debugging).
|
getParent, getUniqueVarName, getVar, parseCommandTextHelpergetId, getSourceLocation, setId, toStringcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParentequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCommandName, getCommandText, getTagStringcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSourceLocation, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParentpublic SoyNode.Kind getKind()
SoyNodepublic final String getVarName()
getVarName in interface SoyNode.LocalVarNode@Nullable public SanitizedContent.ContentKind getContentKind()
SoyNode.RenderUnitNodegetContentKind in interface SoyNode.RenderUnitNodepublic String toSourceString()
NodetoSourceString in interface Nodepublic 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(SoyNode.StandaloneNode child)
ParentNodegetChildIndex in interface ParentNode<SoyNode.StandaloneNode>child - The child to find the index of.public List<SoyNode.StandaloneNode> getChildren()
ParentNodegetChildren 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 void appendTreeStringForChildren(StringBuilder sb, int indent)
ParentNodeappendTreeStringForChildren in interface ParentNode<SoyNode.StandaloneNode>sb - The StringBuilder to which to append the children's tree strings.indent - The current indentation level of this parent node.public String toTreeString(int indent)
NodetoTreeString in interface NodetoTreeString in class AbstractNodeindent - The indentation for each line of the tree string (usually pass 0).public LetContentNode 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.
public String getCommandName()
getCommandName in interface SoyNode.CommandNodepublic String getCommandText()
getCommandText in interface SoyNode.CommandNodepublic String getTagString()
SoyNode.CommandNodegetTagString in interface SoyNode.CommandNodeprotected String buildTagStringHelper(boolean isSelfEnding)
isSelfEnding - Whether the tag is self-ending, i.e. { ... /}.protected String buildTagStringHelper(boolean isSelfEnding, boolean isImplicitCommandName)
isSelfEnding - Whether the tag is self-ending, i.e. { ... /}.isImplicitCommandName - Whether the command name is implicit, e.g. a 'print' tag without
the explicit 'print'.