Package org.lobobrowser.html.parser
Class DocumentBuilderImpl
- java.lang.Object
-
- javax.xml.parsers.DocumentBuilder
-
- org.lobobrowser.html.parser.DocumentBuilderImpl
-
public class DocumentBuilderImpl extends javax.xml.parsers.DocumentBuilder
TheDocumentBuilderImpl
class is an HTML DOM parser that implements the standard W3CDocumentBuilder
interface.- Author:
- J. H. S.
-
-
Constructor Summary
Constructors Constructor Description DocumentBuilderImpl(HtmlRendererContext rcontext)
Constructs aDocumentBuilderImpl
.DocumentBuilderImpl(UserAgentContext context)
Constructs aDocumentBuilderImpl
.DocumentBuilderImpl(UserAgentContext ucontext, HtmlRendererContext rcontext)
Constructs aDocumentBuilderImpl
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Document
createDocument(org.xml.sax.InputSource is)
Creates a document without parsing the input provided, so the document object can be used for incremental rendering.org.w3c.dom.DOMImplementation
getDOMImplementation()
org.xml.sax.ErrorHandler
getErrorHandler()
org.xml.sax.EntityResolver
getResolver()
boolean
isNamespaceAware()
boolean
isValidating()
org.w3c.dom.Document
newDocument()
org.w3c.dom.Document
parse(org.xml.sax.InputSource is)
Parses an HTML document.void
setEntityResolver(org.xml.sax.EntityResolver er)
void
setErrorHandler(org.xml.sax.ErrorHandler eh)
-
-
-
Constructor Detail
-
DocumentBuilderImpl
public DocumentBuilderImpl(UserAgentContext context)
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
public DocumentBuilderImpl(UserAgentContext ucontext, HtmlRendererContext rcontext)
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
public DocumentBuilderImpl(HtmlRendererContext rcontext)
Constructs aDocumentBuilderImpl
. This constructor should be used when rendering is expected.- Parameters:
rcontext
- An instance ofHtmlRendererContext
, which may be an instance ofSimpleHtmlRendererContext
.
-
-
Method Detail
-
parse
public org.w3c.dom.Document parse(org.xml.sax.InputSource is) throws org.xml.sax.SAXException, java.io.IOException
Parses an HTML document. Note that this method will read the entire input source before returning aDocument
instance.- Specified by:
parse
in classjavax.xml.parsers.DocumentBuilder
- Parameters:
is
- The input source, which may be an instance ofInputSourceImpl
.- Throws:
org.xml.sax.SAXException
java.io.IOException
- See Also:
createDocument(InputSource)
-
createDocument
public org.w3c.dom.Document createDocument(org.xml.sax.InputSource is) throws org.xml.sax.SAXException, java.io.IOException
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:
org.xml.sax.SAXException
java.io.IOException
- See Also:
HTMLDocumentImpl.load()
-
isNamespaceAware
public boolean isNamespaceAware()
- Specified by:
isNamespaceAware
in classjavax.xml.parsers.DocumentBuilder
-
isValidating
public boolean isValidating()
- Specified by:
isValidating
in classjavax.xml.parsers.DocumentBuilder
-
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver er)
- Specified by:
setEntityResolver
in classjavax.xml.parsers.DocumentBuilder
-
setErrorHandler
public void setErrorHandler(org.xml.sax.ErrorHandler eh)
- Specified by:
setErrorHandler
in classjavax.xml.parsers.DocumentBuilder
-
newDocument
public org.w3c.dom.Document newDocument()
- Specified by:
newDocument
in classjavax.xml.parsers.DocumentBuilder
-
getDOMImplementation
public org.w3c.dom.DOMImplementation getDOMImplementation()
- Specified by:
getDOMImplementation
in classjavax.xml.parsers.DocumentBuilder
-
getErrorHandler
public org.xml.sax.ErrorHandler getErrorHandler()
-
getResolver
public org.xml.sax.EntityResolver getResolver()
-
-