public class TextNode extends AbstractNode implements Text
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
mText
The contents of the string node, or override text.
|
Constructor and Description |
---|
TextNode(Page page,
int start,
int end)
Constructor takes in the page and beginning and ending posns.
|
TextNode(java.lang.String text)
Constructor takes in the text string.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(NodeVisitor visitor)
String visiting code.
|
java.lang.String |
getText()
Returns the text of the node.
|
void |
setText(java.lang.String text)
Sets the string contents of the node.
|
java.lang.String |
toHtml()
Returns the text of the node.
|
java.lang.String |
toPlainTextString()
Returns the text of the node.
|
java.lang.String |
toString()
Express this string node as a printable string
This is suitable for display in a debugger or output to a printout.
|
clone, collectInto, doSemanticAction, getChildren, getEndPosition, getPage, getParent, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clone, collectInto, doSemanticAction, getChildren, getEndPosition, getPage, getParent, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition
protected java.lang.String mText
public TextNode(java.lang.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.public java.lang.String getText()
toHtml()
for this type of node.public void setText(java.lang.String text)
public java.lang.String toPlainTextString()
toHtml()
for this type of node.toPlainTextString
in interface Node
toPlainTextString
in class AbstractNode
public java.lang.String toHtml()
toHtml
in interface Node
toHtml
in class AbstractNode
public java.lang.String toString()
toString
in interface Node
toString
in class AbstractNode
public void accept(NodeVisitor visitor)
accept
in interface Node
accept
in class AbstractNode
visitor
- The NodeVisitor
object to invoke
visitStringNode()
on.HTML Parser is an open source library released under LGPL.