@OpenApiAll public class TextNode extends java.lang.Object implements Node, java.io.Serializable
Constructor and Description |
---|
TextNode()
Create a text node.
|
TextNode(java.lang.String text)
Create a text node with text content.
|
Modifier and Type | Method and Description |
---|---|
void |
appendChild(Node e)
Adds the node newChild to the end of the list of children of this node.
|
void |
appendContent(char[] str,
int offset,
int len)
Append a content.
|
java.util.Collection<Node> |
getChildNodes()
Return a child.
|
java.lang.StringBuffer |
getContent()
Return a content.
|
Node |
getParentNode()
Return the parent of this node.
|
void |
insertBefore(Node newChild,
int index)
Inserts the node newChild before the child index.
|
Node |
removeChild(Node oldChild)
Removes the child node indicated by oldChild from the list of children, and returns it.
|
void |
setParentNode(Node e)
Set a parent of this node.
|
java.lang.String |
toString()
Return string represents this object.
|
public TextNode()
public TextNode(java.lang.String text)
text
- text content.public java.lang.StringBuffer getContent()
public void appendContent(char[] str, int offset, int len)
str
- the characters to be appended.offset
- the index of the first char to append.len
- the number of chars to append.public java.util.Collection<Node> getChildNodes()
getChildNodes
in interface Node
public java.lang.String toString()
toString
in class java.lang.Object
public void setParentNode(Node e)
setParentNode
in interface Node
e
- a node.public Node getParentNode()
getParentNode
in interface Node
public void appendChild(Node e)
appendChild
in interface Node
e
- a child elementpublic Node removeChild(Node oldChild)
removeChild
in interface Node
oldChild
- The node being removed.public void insertBefore(Node newChild, int index)
insertBefore
in interface Node
newChild
- the node to insertindex
- the reference child indexCopyright © 2010 - No Magic Asia