public final class IfCondNode extends AbstractBlockCommandNode implements SoyNode.ConditionalBlockNode, SoyNode.ExprHolderNode
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.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 |
|---|
IfCondNode(int id,
String commandName,
ExprUnion condition) |
IfCondNode(int id,
String commandName,
String commandText) |
| Modifier and Type | Method and Description |
|---|---|
IfCondNode |
clone()
Copies this node.
|
List<ExprUnion> |
getAllExprUnions()
Returns the list of expressions in this node.
|
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.
|
String |
getExprText()
Returns the text of the conditional expression.
|
ExprUnion |
getExprUnion()
Returns the parsed expression.
|
SoyNode.Kind |
getKind()
Returns this node's kind (corresponding to this node's specific type).
|
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, toTreeStringbuildTagStringHelper, buildTagStringHelper, getTagStringgetId, getParent, getSourceLocation, setId, setSourceLocation, toStringcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParentequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetId, getParent, getSourceLocation, setId, setSourceLocationaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, appendTreeStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChildcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toTreeStringgetTagStringpublic IfCondNode(int id,
String commandName,
String commandText)
id - The id for this node.commandName - The command name -- either 'if' or 'elseif'.commandText - The command text.public SoyNode.Kind getKind()
SoyNodepublic String getExprText()
public ExprUnion getExprUnion()
public String getCommandName()
AbstractCommandNodegetCommandName in interface SoyNode.CommandNodegetCommandName in class AbstractCommandNodepublic String getCommandText()
AbstractCommandNodegetCommandText in interface SoyNode.CommandNodegetCommandText in class AbstractCommandNodepublic String toSourceString()
NodetoSourceString in interface NodetoSourceString in class AbstractParentCommandNode<SoyNode.StandaloneNode>public List<ExprUnion> getAllExprUnions()
SoyNode.ExprHolderNodegetAllExprUnions in interface SoyNode.ExprHolderNodepublic IfCondNode 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.