org.htmlparser.nodeDecorators
Class DecodingNode
java.lang.Object
org.htmlparser.nodeDecorators.AbstractNodeDecorator
org.htmlparser.nodeDecorators.DecodingNode
- All Implemented Interfaces:
- Node
- public class DecodingNode
- extends AbstractNodeDecorator
| Methods inherited from class org.htmlparser.nodeDecorators.AbstractNodeDecorator |
accept, collectInto, doSemanticAction, elementBegin, elementEnd, equals, getChildren, getEndPosition, getParent, getStartPosition, getText, setChildren, setEndPosition, setParent, setStartPosition, setText, toHtml, toString |
DecodingNode
public DecodingNode(Node node)
toPlainTextString
public String toPlainTextString()
- Description copied from interface:
Node
- Returns a string representation of the node. This is an important method, it allows a simple string transformation
of a web page, regardless of a node.
Typical application code (for extracting only the text from a web page) would then be simplified to :
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
}
- Specified by:
toPlainTextString in interface Node- Overrides:
toPlainTextString in class AbstractNodeDecorator
HTML Parser is an open source library released under LGPL.