Package org.loboevolution.html.parser
Class DocumentBuilderImpl
java.lang.Object
org.loboevolution.html.parser.DocumentBuilderImpl
The DocumentBuilderImpl class is an HTML DOM parser that
implements the standard W3C DocumentBuilder interface.
-
Constructor Summary
ConstructorDescriptionDocumentBuilderImpl
(UserAgentContext ucontext, HtmlRendererContext rcontext, HtmlRendererConfig config) Constructs a DocumentBuilderImpl. -
Method Summary
Modifier and TypeMethodDescriptionCreates a document without parsing the input provided, so the document object can be used for incremental rendering.parse
(InputSource is) Parses an HTML document.
-
Constructor Details
-
DocumentBuilderImpl
public DocumentBuilderImpl(UserAgentContext ucontext, HtmlRendererContext rcontext, HtmlRendererConfig config) Constructs a DocumentBuilderImpl. This constructor should be used when rendering is expected.- Parameters:
ucontext
- An instance ofUserAgentContext
rcontext
- An instance ofHtmlRendererContext
config
- aHtmlRendererConfig
object.
-
-
Method Details
-
createDocument
Creates a document without parsing the input provided, so the document object can be used for incremental rendering.- Parameters:
is
- The input source, which may be an instance ofInputSourceImpl
. The input source must provide either an input stream or a reader.- Returns:
- a
Document
object. - Throws:
IOException
- if any.Exception
- See Also:
-
parse
Parses an HTML document. Note that this method will read the entire input source before returning a Document instance.- Parameters:
is
- aInputSource
object.- Returns:
- a
Document
object. - Throws:
Exception
- if any.
-