com.vaadin.sass.internal.tree
Class Node

java.lang.Object
  extended by com.vaadin.sass.internal.tree.Node
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BlockNode, CommentNode, ContentNode, DefNode, EachDefNode, ElseNode, ExtendNode, FontFaceNode, ForNode, IfElseDefNode, IfNode, ImportNode, KeyframeSelectorNode, KeyframesNode, MediaNode, MicrosoftRuleNode, NestPropertiesNode, NodeWithVariableArguments, ReturnNode, RuleNode, ScssStylesheet, SimpleNode, VariableNode, WhileNode

public abstract class Node
extends Object
implements Serializable

See Also:
Serialized Form

Nested Class Summary
static interface Node.BuildStringStrategy
           
static class Node.PrintStrategy
           
static class Node.ToStringStrategy
           
 
Field Summary
static Node.BuildStringStrategy PRINT_STRATEGY
           
static Node.BuildStringStrategy TO_STRING_STRATEGY
           
 
Constructor Summary
Node()
           
 
Method Summary
 void appendAfterNode(Node after, Collection<? extends Node> newNodes)
           
 void appendChild(Node node)
          Append a new child node to the end of the child list.
 Node copy()
           
 List<Node> getChildren()
           
 Node getParentNode()
           
 String printState()
          Prints out the current state of the node tree.
 void removeFromParent()
          Remove this node from its parent (if any).
 void replaceNode(Node oldChild, Collection<? extends Node> newNodes)
          Replace the child oldNode with a collection of nodes.
abstract  void traverse()
          Method for manipulating the data contained within the Node.
 void traverseChildren()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRINT_STRATEGY

public static Node.BuildStringStrategy PRINT_STRATEGY

TO_STRING_STRATEGY

public static Node.BuildStringStrategy TO_STRING_STRATEGY
Constructor Detail

Node

public Node()
Method Detail

replaceNode

public void replaceNode(Node oldChild,
                        Collection<? extends Node> newNodes)
Replace the child oldNode with a collection of nodes.

Parameters:
oldChild - child to replace
newNodes - replacing nodes, can be an empty collection

appendAfterNode

public void appendAfterNode(Node after,
                            Collection<? extends Node> newNodes)

appendChild

public void appendChild(Node node)
Append a new child node to the end of the child list. This method should only be used when constructing the Node tree, not when modifying it.

Parameters:
node - new child to append

removeFromParent

public void removeFromParent()
Remove this node from its parent (if any).


getChildren

public List<Node> getChildren()

traverse

public abstract void traverse()
Method for manipulating the data contained within the Node. Traversing a node is allowed to modify the node, replace it with one or more nodes at the same or later position in its parent and modify the children of the node, but not modify or remove preceding nodes in its parent.


printState

public String printState()
Prints out the current state of the node tree. Will return SCSS before compile and CSS after. Result value could be null.

Returns:
State as a string

getParentNode

public Node getParentNode()

copy

public Node copy()

traverseChildren

public void traverseChildren()


Copyright © 2013–2014 Vaadin. All rights reserved.