public abstract class AbstractNode extends Object implements Node
Important: Do not use outside of Soy code (treat as superpackage-private).
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNode() |
protected |
AbstractNode(AbstractNode orig,
CopyState copyState)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
couldHaveSyntaxVersionAtLeast(SyntaxVersion syntaxVersionCutoff)
Returns false if we know that this node's syntax version must be lower than the given value.
|
boolean |
equals(Object other) |
<N extends Node> |
getNearestAncestor(Class<N> ancestorClass)
Finds and returns this node's nearest ancestor of the given type.
|
ParentNode<?> |
getParent()
Gets this node's parent.
|
SyntaxVersionUpperBound |
getSyntaxVersionUpperBound()
Returns a pair (syntaxVersion, reasonStr), where the first item is the lowest known upper bound
(exclusive!) for the syntax version of this node, and the second item is a user-friendly
explanation of the reason for the bound.
|
boolean |
hasAncestor(Class<? extends Node> ancestorClass)
Determines whether this node has an ancestor of the given type.
|
int |
hashCode() |
void |
maybeSetSyntaxVersionUpperBound(SyntaxVersionUpperBound newSyntaxVersionBound)
Records a newly discovered upper bound for the syntax version of this node.
|
void |
setParent(ParentNode<?> parent)
Sets this node's parent.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopy, getSourceLocation, toSourceStringprotected AbstractNode()
protected AbstractNode(AbstractNode orig, CopyState copyState)
orig - The node to copy.public void maybeSetSyntaxVersionUpperBound(SyntaxVersionUpperBound newSyntaxVersionBound)
NodemaybeSetSyntaxVersionUpperBound in interface NodenewSyntaxVersionBound - A newly discovered upper bound (exclusive!) for the syntax version
of this node.@Nullable public SyntaxVersionUpperBound getSyntaxVersionUpperBound()
NodegetSyntaxVersionUpperBound in interface Nodepublic boolean couldHaveSyntaxVersionAtLeast(SyntaxVersion syntaxVersionCutoff)
NodecouldHaveSyntaxVersionAtLeast in interface NodesyntaxVersionCutoff - The syntax version cutoff to check.public void setParent(ParentNode<?> parent)
Nodepublic ParentNode<?> getParent()
Nodepublic boolean hasAncestor(Class<? extends Node> ancestorClass)
NodehasAncestor in interface NodeancestorClass - The type of ancestor to look for.public <N extends Node> N getNearestAncestor(Class<N> ancestorClass)
NodegetNearestAncestor in interface NodeN - The type of ancestor to retrieve.ancestorClass - The class object for the type of ancestor to retrieve.