org.htmlparser.nodes
Class TextNode
- Cloneable, Node, Serializable, Text
Normal text in the HTML document is represented by this class.
protected String | mText - The contents of the string node, or override text.
|
TextNode(String text) - Constructor takes in the text string.
|
TextNode(Page page, int start, int end) - Constructor takes in the page and beginning and ending posns.
|
void | accept(NodeVisitor visitor) - String visiting code.
|
String | getText() - Returns the text of the node.
|
boolean | isWhiteSpace() - Returns if the node consists of only white space.
|
void | setText(String text) - Sets the string contents of the node.
|
String | toHtml(boolean verbatim) - Returns the text of the node.
|
String | toPlainTextString() - Returns the text of the node.
|
String | toString() - Express this string node as a printable string
This is suitable for display in a debugger or output to a printout.
|
accept , clone , collectInto , doSemanticAction , getChildren , getEndPosition , getFirstChild , getLastChild , getNextSibling , getPage , getParent , getPreviousSibling , getStartPosition , getText , setChildren , setEndPosition , setPage , setParent , setStartPosition , setText , toHtml , toHtml , toPlainTextString , toString |
mText
protected String mText
The contents of the string node, or override text.
TextNode
public TextNode(String text)
Constructor takes in the text string.
text
- The string node text. For correct generation of HTML, this
should not contain representations of tags (unless they are balanced).
TextNode
public TextNode(Page page,
int start,
int end)
Constructor takes in the page and beginning and ending posns.
page
- The page this string is on.start
- The beginning position of the string.end
- The ending positiong of the string.
isWhiteSpace
public boolean isWhiteSpace()
Returns if the node consists of only white space.
White space can be spaces, new lines, etc.
toHtml
public String toHtml(boolean verbatim)
Returns the text of the node.
- toHtml in interface Node
- toHtml in interface AbstractNode
verbatim
- If true
return as close to the original
page text as possible.
- The contents of this text node.
toString
public String toString()
Express this string node as a printable string
This is suitable for display in a debugger or output to a printout.
Control characters are replaced by their equivalent escape
sequence and contents is truncated to 80 characters.
- toString in interface Node
- toString in interface AbstractNode
- A string representation of the string node.
| © 2005 Derrick Oswald Mai 08, 2008 |
HTML Parser is an open source library released under LGPL. |  |