|
HTML Parser Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.htmlparser.nodes.AbstractNode
org.htmlparser.nodes.TextNode
public class TextNode
Normal text in the HTML document is represented by this class.
| Field Summary | |
|---|---|
protected String |
mText
The contents of the string node, or override text. |
| Fields inherited from class org.htmlparser.nodes.AbstractNode |
|---|
children, mPage, nodeBegin, nodeEnd, parent |
| Constructor Summary | |
|---|---|
TextNode(Page page,
int start,
int end)
Constructor takes in the page and beginning and ending posns. |
|
TextNode(String text)
Constructor takes in the text string. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.htmlparser.nodes.AbstractNode |
|---|
clone, collectInto, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.htmlparser.Node |
|---|
clone, collectInto, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml |
| Field Detail |
|---|
protected String mText
| Constructor Detail |
|---|
public TextNode(String text)
text - The string node text. For correct generation of HTML, this
should not contain representations of tags (unless they are balanced).
public TextNode(Page page,
int start,
int end)
page - The page this string is on.start - The beginning position of the string.end - The ending positiong of the string.| Method Detail |
|---|
public String getText()
toHtml(boolean) for this type of node.
getText in interface NodegetText in interface TextgetText in class AbstractNodeNode.setText(java.lang.String)public void setText(String text)
setText in interface NodesetText in interface TextsetText in class AbstractNodetext - The new text for the node.Node.getText()public String toPlainTextString()
toHtml(boolean) for this type of node.
toPlainTextString in interface NodetoPlainTextString in class AbstractNodepublic String toHtml(boolean verbatim)
toHtml in interface NodetoHtml in class AbstractNodeverbatim - If true return as close to the original
page text as possible.
public String toString()
toString in interface NodetoString in class AbstractNodepublic boolean isWhiteSpace()
public void accept(NodeVisitor visitor)
accept in interface Nodeaccept in class AbstractNodevisitor - The NodeVisitor object to invoke
visitStringNode() on.
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| HTML Parser is an open source library released under Common Public License. | |