Package org.lobobrowser.html.parser
Class DocumentBuilderImpl
java.lang.Object
javax.xml.parsers.DocumentBuilder
org.lobobrowser.html.parser.DocumentBuilderImpl
The
DocumentBuilderImpl
class is an HTML
DOM parser that implements the
standard W3C DocumentBuilder
interface.- Author:
- J. H. S.
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentBuilderImpl
(HtmlRendererContext rcontext) Constructs aDocumentBuilderImpl
.DocumentBuilderImpl
(UserAgentContext context) Constructs aDocumentBuilderImpl
.DocumentBuilderImpl
(UserAgentContext ucontext, HtmlRendererContext rcontext) Constructs aDocumentBuilderImpl
. -
Method Summary
Modifier and TypeMethodDescriptionCreates a document without parsing the input provided, so the document object can be used for incremental rendering.boolean
boolean
parse
(InputSource is) Parses an HTML document.void
void
Methods inherited from class javax.xml.parsers.DocumentBuilder
getSchema, isXIncludeAware, parse, parse, parse, parse, reset
-
Constructor Details
-
DocumentBuilderImpl
Constructs aDocumentBuilderImpl
. This constructor should be used when only the parsing functionality (without rendering) is required.- Parameters:
context
- An instance ofUserAgentContext
, which may be an instance ofSimpleUserAgentContext
.
-
DocumentBuilderImpl
Constructs aDocumentBuilderImpl
. This constructor should be used when rendering is expected.- Parameters:
ucontext
- An instance ofUserAgentContext
, which may be an instance ofSimpleUserAgentContext
.rcontext
- An instance ofHtmlRendererContext
, which may be an instance ofSimpleHtmlRendererContext
.
-
DocumentBuilderImpl
Constructs aDocumentBuilderImpl
. This constructor should be used when rendering is expected.- Parameters:
rcontext
- An instance ofHtmlRendererContext
, which may be an instance ofSimpleHtmlRendererContext
.
-
-
Method Details
-
parse
Parses an HTML document. Note that this method will read the entire input source before returning aDocument
instance.- Specified by:
parse
in classDocumentBuilder
- Parameters:
is
- The input source, which may be an instance ofInputSourceImpl
.- Throws:
SAXException
IOException
- See Also:
-
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.- Throws:
SAXException
IOException
- See Also:
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAware
in classDocumentBuilder
-
isValidating
public boolean isValidating()- Specified by:
isValidating
in classDocumentBuilder
-
setEntityResolver
- Specified by:
setEntityResolver
in classDocumentBuilder
-
setErrorHandler
- Specified by:
setErrorHandler
in classDocumentBuilder
-
newDocument
- Specified by:
newDocument
in classDocumentBuilder
-
getDOMImplementation
- Specified by:
getDOMImplementation
in classDocumentBuilder
-
getErrorHandler
-
getResolver
-