org.lobobrowser.html.parser
public class DocumentBuilderImpl extends javax.xml.parsers.DocumentBuilder
DocumentBuilderImpl
class is an HTML
DOM parser that implements the
standard W3C DocumentBuilder
interface.Constructor and Description |
---|
DocumentBuilderImpl(HtmlRendererContext rcontext)
Constructs a
DocumentBuilderImpl . |
DocumentBuilderImpl(UserAgentContext context)
Constructs a
DocumentBuilderImpl . |
DocumentBuilderImpl(UserAgentContext ucontext,
HtmlRendererContext rcontext)
Constructs a
DocumentBuilderImpl . |
Modifier and Type | Method and 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) |
public DocumentBuilderImpl(UserAgentContext context)
DocumentBuilderImpl
. This constructor
should be used when only the parsing functionality (without rendering)
is required.context
- An instance of UserAgentContext
,
which may be an instance of SimpleUserAgentContext
.public DocumentBuilderImpl(UserAgentContext ucontext, HtmlRendererContext rcontext)
DocumentBuilderImpl
. This constructor
should be used when rendering is expected.ucontext
- An instance of UserAgentContext
,
which may be an instance of SimpleUserAgentContext
.rcontext
- An instance of HtmlRendererContext
,
which may be an instance of SimpleHtmlRendererContext
.public DocumentBuilderImpl(HtmlRendererContext rcontext)
DocumentBuilderImpl
. This constructor
should be used when rendering is expected.rcontext
- An instance of HtmlRendererContext
,
which may be an instance of SimpleHtmlRendererContext
.public org.w3c.dom.Document parse(org.xml.sax.InputSource is) throws org.xml.sax.SAXException, java.io.IOException
Document
instance.parse
in class javax.xml.parsers.DocumentBuilder
is
- The input source, which may be an instance of
InputSourceImpl
.org.xml.sax.SAXException
java.io.IOException
createDocument(InputSource)
public org.w3c.dom.Document createDocument(org.xml.sax.InputSource is) throws org.xml.sax.SAXException, java.io.IOException
is
- The input source, which may be an instance of
InputSourceImpl
. The input
source must provide either an input stream or a reader.org.xml.sax.SAXException
java.io.IOException
HTMLDocumentImpl.load()
public boolean isNamespaceAware()
isNamespaceAware
in class javax.xml.parsers.DocumentBuilder
public boolean isValidating()
isValidating
in class javax.xml.parsers.DocumentBuilder
public void setEntityResolver(org.xml.sax.EntityResolver er)
setEntityResolver
in class javax.xml.parsers.DocumentBuilder
public void setErrorHandler(org.xml.sax.ErrorHandler eh)
setErrorHandler
in class javax.xml.parsers.DocumentBuilder
public org.w3c.dom.Document newDocument()
newDocument
in class javax.xml.parsers.DocumentBuilder
public org.w3c.dom.DOMImplementation getDOMImplementation()
getDOMImplementation
in class javax.xml.parsers.DocumentBuilder
public org.xml.sax.ErrorHandler getErrorHandler()
public org.xml.sax.EntityResolver getResolver()