public class Node extends Object
| Constructor and Description |
|---|
Node() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(String key,
String value)
Adds Attribute to current Node.
|
void |
addChildNode(Node childNode)
Adds child Node to this Node.
|
void |
convertToContent()
Converts this Tag Node to Content Node, add Close Tag at the end of child nodes and move all child Nodes of this
Node to parent Node.
|
Attributes |
getAttributes()
Returns Attributes of Node
|
LinkedList<Node> |
getChildNodes()
Gets the list child nodes of current Node.
|
String |
getContent()
Gets the Content of Node, if Node have Content it mean that is text Node.
|
Node |
getParentNode()
Gets parent Node of current Node.
|
String |
getTitle()
Gets title of Node, node's title ak the tag name.
|
void |
insertAfter(int position,
Node node)
Insert Node to DOM tree after the node at position
|
void |
insertAfter(Node refNode,
Node nodeToInsert)
insert Node to DOM tree after refNode
|
boolean |
isRootNode()
Check if node is RootNode
|
boolean |
isSelfClosedNode()
Check if node is SelfCloseNode
|
boolean |
isTextNode()
Check if node is TextNode
|
void |
setAttributes(Attributes attributes)
Sets attributes of Node.
|
void |
setChildNodes(LinkedList<Node> childNodes)
Sets the list child nodes of current Node.
|
void |
setContent(String content)
Sets the Content of Node, if Node have Content it mean that is text Node.
|
void |
setParentNode(Node parentNode)
Sets the parent Node of currentNode
|
void |
setTitle(String nodeTitle)
Sets title of Node, node's title ak the tag name.
|
String |
toString()
Convert Node to XML String including all sub-Node
|
public Node getParentNode()
public void setParentNode(Node parentNode)
parentNode - public String getTitle()
public void setTitle(String nodeTitle)
nodeTitle - public Attributes getAttributes()
public void setAttributes(Attributes attributes)
attributes - public String getContent()
public void setContent(String content)
content - public LinkedList<Node> getChildNodes()
public void setChildNodes(LinkedList<Node> childNodes)
childNodes - the child nodespublic void addChildNode(Node childNode)
childNode - the child nodepublic void addAttribute(String key, String value)
key - attribute keyvalue - attribute valuepublic boolean isTextNode()
public boolean isRootNode()
public boolean isSelfClosedNode()
public void insertAfter(Node refNode, Node nodeToInsert)
refNode - nodeToInsert - public void insertAfter(int position,
Node node)
position - node - public String toString()
public void convertToContent()
Copyright © 2003–2021 eXo Platform SAS. All rights reserved.