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
ConstructorsConstructorDescriptionDocumentBuilderImpl(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 ofUserAgentContextrcontext- An instance ofHtmlRendererContextconfig- aHtmlRendererConfigobject.
-
-
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
Documentobject. - 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- aInputSourceobject.- Returns:
- a
Documentobject. - Throws:
Exception- if any.
-