Class CssNodesListNode<T extends CssNode>
- java.lang.Object
-
- com.google.common.css.compiler.ast.CssNode
-
- com.google.common.css.compiler.ast.CssNodesListNode<T>
-
- Type Parameters:
T- the list is restricted to nodes of this type
- All Implemented Interfaces:
Locatable
- Direct Known Subclasses:
CssAbstractBlockNode,CssAtRuleNode,CssConditionalBlockNode,CssFunctionArgumentsNode,CssImportBlockNode,CssKeyListNode,CssPropertyValueNode,CssRefinerListNode,CssSelectorListNode
public abstract class CssNodesListNode<T extends CssNode> extends CssNode
Represents a list of nodes. This is meant to represent a succession of statements that logically group together as one node in the tree. Examples include:- all the statements in a stylesheet, except for the ones that can only
appear on top (
charset,import, etc.) - all the declarations inside a ruleset, a font face or a page rule
- all the nodes that form a chain of if-elseif-else rules
- the block that belongs to some of the at rules, such as
media
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCssNodesListNode(boolean isEnclosedWithBraces)Constructor of a list of nodes alike.protectedCssNodesListNode(boolean isEnclosedWithBraces, java.util.List<CssCommentNode> comments)Constructor of a list of nodes alike.protectedCssNodesListNode(boolean isEnclosedWithBraces, java.util.List<T> childrenList, java.util.List<CssCommentNode> comments)Constructor of a list of nodes alike.protectedCssNodesListNode(CssNodesListNode<? extends CssNode> node)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildToBack(T child)java.lang.Iterable<T>childIterable()TgetChildAt(int index)java.util.Iterator<T>getChildIterator()java.util.List<T>getChildren()TgetLastChild()SourceCodeLocationgetSourceCodeLocation()booleanisEmpty()booleanisEnclosedWithBraces()intnumChildren()voidreplaceChildAt(int index, java.util.List<? extends T> newChildren)java.lang.StringtoString()For debugging only.-
Methods inherited from class com.google.common.css.compiler.ast.CssNode
ancestors, appendComment, deepCopy, deepCopyNodes, equals, getComments, getParent, getShouldBeFlipped, getVisitController, hasComment, hashCode, inFunArgs, setComments, setShouldBeFlipped, setSourceCodeLocation
-
-
-
-
Constructor Detail
-
CssNodesListNode
protected CssNodesListNode(boolean isEnclosedWithBraces)
Constructor of a list of nodes alike.- Parameters:
isEnclosedWithBraces-
-
CssNodesListNode
protected CssNodesListNode(boolean isEnclosedWithBraces, @Nullable java.util.List<CssCommentNode> comments)Constructor of a list of nodes alike.- Parameters:
isEnclosedWithBraces-comments-
-
CssNodesListNode
protected CssNodesListNode(boolean isEnclosedWithBraces, java.util.List<T> childrenList, @Nullable java.util.List<CssCommentNode> comments)Constructor of a list of nodes alike.- Parameters:
isEnclosedWithBraces-comments-childrenList- list of children
-
CssNodesListNode
protected CssNodesListNode(CssNodesListNode<? extends CssNode> node)
Copy constructor.- Parameters:
node-
-
-
Method Detail
-
getChildren
public java.util.List<T> getChildren()
-
getChildIterator
public java.util.Iterator<T> getChildIterator()
-
childIterable
public java.lang.Iterable<T> childIterable()
-
replaceChildAt
public void replaceChildAt(int index, java.util.List<? extends T> newChildren)
-
getChildAt
public T getChildAt(int index)
-
numChildren
public int numChildren()
-
getLastChild
public T getLastChild()
-
addChildToBack
public void addChildToBack(T child)
-
isEmpty
public boolean isEmpty()
-
isEnclosedWithBraces
public boolean isEnclosedWithBraces()
-
toString
public java.lang.String toString()
For debugging only.
-
getSourceCodeLocation
public SourceCodeLocation getSourceCodeLocation()
- Specified by:
getSourceCodeLocationin interfaceLocatable- Overrides:
getSourceCodeLocationin classCssNode
-
-