public class TextNode extends AbstractNode implements Text
构造器和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
void |
accept(NodeVisitor visitor)
String visiting code.
|
java.lang.String |
getText()
Returns the text of the node.
|
boolean |
isWhiteSpace()
Returns if the node consists of only white space.
|
void |
setText(java.lang.String text)
Sets the string contents of the node.
|
java.lang.String |
toHtml(boolean verbatim)
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, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
clone, collectInto, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
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(boolean)
for this type of node.getText
在接口中 Node
getText
在接口中 Text
getText
在类中 AbstractNode
Node.setText(java.lang.String)
public void setText(java.lang.String text)
setText
在接口中 Node
setText
在接口中 Text
setText
在类中 AbstractNode
text
- The new text for the node.Node.getText()
public java.lang.String toPlainTextString()
toHtml(boolean)
for this type of node.toPlainTextString
在接口中 Node
toPlainTextString
在类中 AbstractNode
public java.lang.String toHtml(boolean verbatim)
toHtml
在接口中 Node
toHtml
在类中 AbstractNode
verbatim
- If true
return as close to the original
page text as possible.public java.lang.String toString()
toString
在接口中 Node
toString
在类中 AbstractNode
public boolean isWhiteSpace()
public void accept(NodeVisitor visitor)
accept
在接口中 Node
accept
在类中 AbstractNode
visitor
- The NodeVisitor object to invoke visitStringNode on.