public abstract class CallNode extends AbstractSoyNode implements SoyNode.StandaloneNode, SoyNode.SplitLevelTopNode<CallParamNode>, SoyNode.StatementNode, SoyNode.ExprHolderNode, SoyNode.MsgPlaceholderInitialNode
Important: Do not use outside of Soy code (treat as superpackage-private).
| Modifier and Type | Class and Description |
|---|---|
protected static class |
CallNode.CommandTextInfo
Private helper class used by constructors.
|
static class |
CallNode.DataAttribute
A Parsed
data attribute. |
| Modifier and Type | Field and Description |
|---|---|
static String |
FALLBACK_BASE_PLACEHOLDER_NAME
Fallback base placeholder name.
|
SPACES| Modifier | Constructor and Description |
|---|---|
protected |
CallNode(CallNode orig,
CopyState copyState)
Copy constructor.
|
protected |
CallNode(int id,
SourceLocation sourceLocation,
String commandName,
CallNode.CommandTextInfo commandTextInfo,
com.google.common.collect.ImmutableList<String> escapingDirectiveNames)
Protected constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(int index,
N child)
Adds the given child at the given index (shifting existing children if necessary).
|
void |
addChild(N child)
Adds the given child.
|
void |
addChildren(int index,
List<? extends N> children)
Adds the given children at the given index (shifting existing children if necessary).
|
void |
addChildren(List<? extends N> children)
Adds the given children.
|
void |
appendSourceStringForChildren(StringBuilder sb)
Appends the source strings for all the children to the given StringBuilder.
|
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.
|
CallNode.DataAttribute |
dataAttribute()
The parsed 'data' attribute.
|
String |
genBasePhName()
Generates the base placeholder name for this node.
|
Object |
genSamenessKey()
Generates the key object used in comparisons to determine whether two placeholder nodes
should be represented by the same placeholder.
|
List<ExprUnion> |
getAllExprUnions()
Returns the list of expressions in this node.
|
N |
getChild(int index)
Gets the child at the given index.
|
int |
getChildIndex(N child)
Finds the index of the given child.
|
List<N> |
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.
|
com.google.common.collect.ImmutableList<String> |
getEscapingDirectiveNames()
Returns the escaping directives, applied from left to right.
|
Collection<TemplateParam> |
getParamsToRuntimeCheck(TemplateNode callee)
Returns the subset of
params of the callee that require runtime
type checking when this node is being rendered. |
SoyNode.BlockNode |
getParent()
Gets this node's parent.
|
String |
getTagString()
Builds a Soy tag string that could be the Soy tag for this node.
|
String |
getUserSuppliedPhName()
Gets the user-supplied placeholder name, or null if not supplied or not applicable.
|
int |
numChildren()
Gets the number of children.
|
protected static CallNode.DataAttribute |
parseDataAttributeHelper(String dataAttr,
SourceLocation sourceLocation,
SoyParsingContext context)
Private helper function for subclass constructors to parse the 'data' attribute.
|
void |
removeChild(int index)
Removes the child at the given index.
|
void |
removeChild(N child)
Removes the given child.
|
void |
replaceChild(int index,
N newChild)
Replaces the child at the given index with the given new child.
|
void |
replaceChild(N currChild,
N newChild)
Replaces the given current child with the given new child.
|
void |
setEscapingDirectiveNames(com.google.common.collect.ImmutableList<String> escapingDirectiveNames)
Sets the inferred escaping directives.
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
getId, getSourceLocation, setId, toStringcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParentclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddChild, addChild, addChildren, addChildren, appendSourceStringForChildren, clearChildren, getChild, getChildIndex, getChildren, numChildren, removeChild, removeChild, replaceChild, replaceChildpublic static final String FALLBACK_BASE_PLACEHOLDER_NAME
protected CallNode(int id,
SourceLocation sourceLocation,
String commandName,
CallNode.CommandTextInfo commandTextInfo,
com.google.common.collect.ImmutableList<String> escapingDirectiveNames)
id - The id for this node.sourceLocation - The node's source location.commandTextInfo - All the info derived from the command text.escapingDirectiveNames - Call-site escaping directives used by strict autoescaping.
This is inferred by the autoescaper and not part of the syntax, and thus is not in the
CommandTextInfo.protected static CallNode.DataAttribute parseDataAttributeHelper(String dataAttr, SourceLocation sourceLocation, SoyParsingContext context)
dataAttr - The 'data' attribute in a call.sourceLocation - The 'data' attribute's source location.errorReporter - For reporting syntax errors.public CallNode.DataAttribute dataAttribute()
public String getUserSuppliedPhName()
SoyNode.MsgPlaceholderInitialNodegetUserSuppliedPhName in interface SoyNode.MsgPlaceholderInitialNodepublic String getTagString()
SoyNode.CommandNodegetTagString in interface SoyNode.CommandNodepublic String toSourceString()
NodetoSourceString in interface Nodepublic List<ExprUnion> getAllExprUnions()
SoyNode.ExprHolderNodegetAllExprUnions in interface SoyNode.ExprHolderNodepublic String genBasePhName()
SoyNode.MsgPlaceholderInitialNodegenBasePhName in interface SoyNode.MsgPlaceholderInitialNodepublic Object genSamenessKey()
SoyNode.MsgPlaceholderInitialNodegenSamenessKey in interface SoyNode.MsgPlaceholderInitialNodepublic SoyNode.BlockNode getParent()
NodegetParent in interface NodegetParent in interface SoyNodegetParent in interface SoyNode.StandaloneNodegetParent in class AbstractSoyNodepublic Collection<TemplateParam> getParamsToRuntimeCheck(TemplateNode callee)
params of the callee that require runtime
type checking when this node is being rendered.public void setEscapingDirectiveNames(com.google.common.collect.ImmutableList<String> escapingDirectiveNames)
public com.google.common.collect.ImmutableList<String> getEscapingDirectiveNames()
public int numChildren()
ParentNodenumChildren in interface ParentNode<N extends SoyNode>public N getChild(int index)
ParentNodegetChild in interface ParentNode<N extends SoyNode>index - The index of the child to get.public int getChildIndex(N child)
ParentNodegetChildIndex in interface ParentNode<N extends SoyNode>child - The child to find the index of.public List<N> getChildren()
ParentNodegetChildren in interface ParentNode<N extends SoyNode>public void addChild(N child)
ParentNodeaddChild in interface ParentNode<N extends SoyNode>child - The child to add.public void addChild(int index,
N child)
ParentNodeaddChild in interface ParentNode<N extends SoyNode>index - The index to add the child at.child - The child to add.public void removeChild(int index)
ParentNoderemoveChild in interface ParentNode<N extends SoyNode>index - The index of the child to remove.public void removeChild(N child)
ParentNoderemoveChild in interface ParentNode<N extends SoyNode>child - The child to remove.public void replaceChild(int index,
N newChild)
ParentNodereplaceChild in interface ParentNode<N extends SoyNode>index - The index of the child to replace.newChild - The new child.public void replaceChild(N currChild,
N newChild)
ParentNodereplaceChild in interface ParentNode<N extends SoyNode>currChild - The current child to be replaced.newChild - The new child.public void clearChildren()
ParentNodeclearChildren in interface ParentNode<N extends SoyNode>public void addChildren(List<? extends N> children)
ParentNodeaddChildren in interface ParentNode<N extends SoyNode>children - The children to add.public void addChildren(int index,
List<? extends N> children)
ParentNodeaddChildren in interface ParentNode<N extends SoyNode>index - The index to add the children at.children - The children to add.public void appendSourceStringForChildren(StringBuilder sb)
ParentNodeappendSourceStringForChildren in interface ParentNode<N extends SoyNode>sb - The StringBuilder to which to append the children's source strings.public String getCommandName()
getCommandName in interface SoyNode.CommandNodepublic String getCommandText()
getCommandText 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'.