Package | Description |
---|---|
org.htmlparser |
The basic API classes which will be used by most developers when working with
the HTML Parser.
|
Modifier and Type | Class and Description |
---|---|
class |
StringNodeFactory
Deprecated.
Use PrototypicalNodeFactory#setTextPrototype(Text)
A more efficient implementation of affecting all string nodes, is to replace
the Text node prototype in the For example, if you were using: StringNodeFactory factory = new StringNodeFactory(); factory.setDecode(true);to decode all text issued from Text.toPlainTextString() ,
you would instead create a subclass of TextNode
and set it as the prototype for text node generation:
PrototypicalNodeFactory factory = new PrototypicalNodeFactory (); factory.setTextPrototype (new TextNode () { public String toPlainTextString() { return (org.htmlparser.util.Translate.decode (super.toPlainTextString ())); } });Similar constructs apply to removing escapes and converting non-breaking spaces, which were the examples previously provided. Using a subclass avoids the wrapping and delegation inherent in the decorator pattern, with subsequent improvements in processing speed and memory usage. |
Modifier and Type | Method and Description |
---|---|
PrototypicalNodeFactory |
PrototypicalNodeFactory.registerTags()
Register all known tags in the tag package.
|
HTML Parser is an open source library released under LGPL.