|
HTML Parser Home Page | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.htmlparser.AbstractNode
org.htmlparser.lexer.nodes.RemarkNode
The remark tag is identified and represented by this class.
| Field Summary | |
protected String |
mText
The contents of the remark node, or override text. |
| Fields inherited from class org.htmlparser.AbstractNode |
children, mPage, nodeBegin, nodeEnd, parent |
| Constructor Summary | |
RemarkNode(Page page,
int start,
int end)
Constructor takes in the page and beginning and ending posns. |
|
RemarkNode(String text)
Constructor takes in the text string. |
|
| Method Summary | |
void |
accept(Object visitor)
Apply the visitor object (of type NodeVisitor) to this node. |
String |
getText()
Returns the text contents of the comment tag. |
void |
setText(String text)
Sets the string contents of the node. |
String |
toHtml()
This method will make it easier when using html parser to reproduce html pages (with or without modifications) Applications reproducing html can use this method on nodes which are to be used or transferred as they were recieved, with the original html |
String |
toPlainTextString()
Returns a string representation of the node. |
String |
toString()
Print the contents of the remark tag. |
| Methods inherited from class org.htmlparser.AbstractNode |
collectInto, doSemanticAction, elementBegin, elementEnd, getChildren, getEndPosition, getPage, getParent, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHTML |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected String mText
| Constructor Detail |
public RemarkNode(String text)
text - The string node text. For correct generation of HTML, this
should not contain representations of tags (unless they are balanced).
public RemarkNode(Page page,
int start,
int end)
page - The page this remark is on.start - The beginning position of the remark.end - The ending positiong of the remark.| Method Detail |
public String getText()
getText in interface NodegetText in class AbstractNodepublic void setText(String text)
setText in interface NodesetText in class AbstractNodetext - The new text for the node.public String toPlainTextString()
AbstractNode
Node node;
for (Enumeration e = parser.elements();e.hasMoreElements();) {
node = (Node)e.nextElement();
System.out.println(node.toPlainTextString()); // Or do whatever processing you wish with the plain text string
}
toPlainTextString in interface NodetoPlainTextString in class AbstractNodepublic String toHtml()
AbstractNode
toHtml in interface NodetoHtml in class AbstractNodepublic String toString()
toString in interface NodetoString in class AbstractNodepublic void accept(Object visitor)
Node
accept in interface Nodeaccept in class AbstractNode
|
© 2004 Somik Raha Mar 14, 2004
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||