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.DocumentBuilderTheDocumentBuilderImplclass is an HTML DOM parser that implements the standard W3CDocumentBuilderinterface.- 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.DocumentcreateDocument(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.DOMImplementationgetDOMImplementation()org.xml.sax.ErrorHandlergetErrorHandler()org.xml.sax.EntityResolvergetResolver()booleanisNamespaceAware()booleanisValidating()org.w3c.dom.DocumentnewDocument()org.w3c.dom.Documentparse(org.xml.sax.InputSource is)Parses an HTML document.voidsetEntityResolver(org.xml.sax.EntityResolver er)voidsetErrorHandler(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.IOExceptionParses an HTML document. Note that this method will read the entire input source before returning aDocumentinstance.- Specified by:
parsein classjavax.xml.parsers.DocumentBuilder- Parameters:
is- The input source, which may be an instance ofInputSourceImpl.- Throws:
org.xml.sax.SAXExceptionjava.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.IOExceptionCreates 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.SAXExceptionjava.io.IOException- See Also:
HTMLDocumentImpl.load()
-
isNamespaceAware
public boolean isNamespaceAware()
- Specified by:
isNamespaceAwarein classjavax.xml.parsers.DocumentBuilder
-
isValidating
public boolean isValidating()
- Specified by:
isValidatingin classjavax.xml.parsers.DocumentBuilder
-
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver er)
- Specified by:
setEntityResolverin classjavax.xml.parsers.DocumentBuilder
-
setErrorHandler
public void setErrorHandler(org.xml.sax.ErrorHandler eh)
- Specified by:
setErrorHandlerin classjavax.xml.parsers.DocumentBuilder
-
newDocument
public org.w3c.dom.Document newDocument()
- Specified by:
newDocumentin classjavax.xml.parsers.DocumentBuilder
-
getDOMImplementation
public org.w3c.dom.DOMImplementation getDOMImplementation()
- Specified by:
getDOMImplementationin classjavax.xml.parsers.DocumentBuilder
-
getErrorHandler
public org.xml.sax.ErrorHandler getErrorHandler()
-
getResolver
public org.xml.sax.EntityResolver getResolver()
-
-