Package org.htmlparser.nodes
Class RemarkNode
- java.lang.Object
-
- org.htmlparser.nodes.AbstractNode
-
- org.htmlparser.nodes.RemarkNode
-
public class RemarkNode extends AbstractNode implements Remark
The remark tag is identified and represented by this class.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RemarkNode(java.lang.String text)Constructor takes in the text string.RemarkNode(Page page, int start, int end)Constructor takes in the page and beginning and ending posns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(NodeVisitor visitor)Remark visiting code.java.lang.StringgetText()Returns the text contents of the comment tag.voidsetText(java.lang.String text)Sets the string contents of the node.java.lang.StringtoHtml(boolean verbatim)Return The full HTML remark.java.lang.StringtoPlainTextString()Return the remark text.java.lang.StringtoString()Print the contents of the remark tag.-
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
-
-
-
-
Constructor Detail
-
RemarkNode
public RemarkNode(java.lang.String text)
Constructor takes in the text string.- Parameters:
text- The string node text. For correct generation of HTML, this should not contain representations of tags (unless they are balanced).
-
RemarkNode
public RemarkNode(Page page, int start, int end)
Constructor takes in the page and beginning and ending posns.- Parameters:
page- The page this remark is on.start- The beginning position of the remark.end- The ending positiong of the remark.
-
-
Method Detail
-
getText
public java.lang.String getText()
Returns the text contents of the comment tag.- Specified by:
getTextin interfaceNode- Specified by:
getTextin interfaceRemark- Overrides:
getTextin classAbstractNode- Returns:
- The contents of the text inside the comment delimiters.
- See Also:
Node.setText(java.lang.String)
-
setText
public void setText(java.lang.String text)
Sets the string contents of the node. If the text has the remark delimiters (<!-- -->), these are stripped off.- Specified by:
setTextin interfaceNode- Specified by:
setTextin interfaceRemark- Overrides:
setTextin classAbstractNode- Parameters:
text- The new text for the node.- See Also:
Node.getText()
-
toPlainTextString
public java.lang.String toPlainTextString()
Return the remark text.- Specified by:
toPlainTextStringin interfaceNode- Specified by:
toPlainTextStringin classAbstractNode- Returns:
- The HTML comment.
-
toHtml
public java.lang.String toHtml(boolean verbatim)
Return The full HTML remark.- Specified by:
toHtmlin interfaceNode- Specified by:
toHtmlin classAbstractNode- Parameters:
verbatim- Iftruereturn as close to the original page text as possible.- Returns:
- The comment, i.e. {@.html }.
-
toString
public java.lang.String toString()
Print the contents of the remark tag. 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.- Specified by:
toStringin interfaceNode- Specified by:
toStringin classAbstractNode- Returns:
- A string representation of the remark node.
-
accept
public void accept(NodeVisitor visitor)
Remark visiting code.- Specified by:
acceptin interfaceNode- Specified by:
acceptin classAbstractNode- Parameters:
visitor- TheNodeVisitorobject to invokevisitRemarkNode()on.
-
-