org.lobobrowser.html.parser

Class DocumentBuilderImpl


public class DocumentBuilderImpl
extends DocumentBuilder

The DocumentBuilderImpl class is an HTML DOM parser that implements the standard W3C DocumentBuilder interface.
Author:
J. H. S.

Constructor Summary

DocumentBuilderImpl(HtmlRendererContext rcontext)
Constructs a DocumentBuilderImpl.
DocumentBuilderImpl(UserAgentContext context)
Constructs a DocumentBuilderImpl.
DocumentBuilderImpl(UserAgentContext ucontext, HtmlRendererContext rcontext)
Constructs a DocumentBuilderImpl.

Method Summary

Document
createDocument(InputSource is)
Creates a document without parsing it so it can be used for incremental rendering.
DOMImplementation
getDOMImplementation()
ErrorHandler
getErrorHandler()
EntityResolver
getResolver()
boolean
isNamespaceAware()
boolean
isValidating()
Document
newDocument()
Document
parse(InputSource is)
Parses an HTML document.
void
setEntityResolver(EntityResolver er)
void
setErrorHandler(ErrorHandler eh)

Constructor Details

DocumentBuilderImpl

public DocumentBuilderImpl(HtmlRendererContext rcontext)
Constructs a DocumentBuilderImpl. This constructor should be used when rendering is expected.
Parameters:
rcontext - An instance of HtmlRendererContext, which may be an instance of SimpleHtmlRendererContext.

DocumentBuilderImpl

public DocumentBuilderImpl(UserAgentContext context)
Constructs a DocumentBuilderImpl. This constructor should be used when only the parsing functionality (without rendering) is required.
Parameters:
context - An instance of UserAgentContext, which may be an instance of SimpleUserAgentContext.

DocumentBuilderImpl

public DocumentBuilderImpl(UserAgentContext ucontext,
                           HtmlRendererContext rcontext)
Constructs a DocumentBuilderImpl. This constructor should be used when rendering is expected.
Parameters:
ucontext - An instance of UserAgentContext, which may be an instance of SimpleUserAgentContext.
rcontext - An instance of HtmlRendererContext, which may be an instance of SimpleHtmlRendererContext.

Method Details

createDocument

public Document createDocument(InputSource is)
            throws SAXException,
                   IOException
Creates a document without parsing it so it can be used for incremental rendering.

getDOMImplementation

public DOMImplementation getDOMImplementation()

getErrorHandler

public ErrorHandler getErrorHandler()

getResolver

public EntityResolver getResolver()

isNamespaceAware

public boolean isNamespaceAware()

isValidating

public boolean isValidating()

newDocument

public Document newDocument()

parse

public Document parse(InputSource is)
            throws SAXException,
                   IOException
Parses an HTML document. Note that this method will read the entire input source before returning a Document instance.

setEntityResolver

public void setEntityResolver(EntityResolver er)

setErrorHandler

public void setErrorHandler(ErrorHandler eh)