The factory is used when lexing to generate the nodes passed back to the caller. By implementing this interface, and setting that concrete object as the node factory for the {@link org.htmlparser.lexer.Lexer#setNodeFactory lexer} (perhaps via the{@link Parser#setNodeFactory parser}), the way that nodes are generated can be customized.
In general, replacing the factory with a custom factory is not required because of the flexibility of the {@link PrototypicalNodeFactory}.
Creation of Text and Remark nodes is straight forward, because essentially they are just sequences of characters extracted from the page. Creation of a Tag node requires that the attributes from the tag be remembered as well. @see PrototypicalNodeFactory
|
|