public class HTMLConfiguration extends ParserConfigurationSettings implements XMLParserConfiguration
This configuration recognizes the following features:
This configuration recognizes the following properties:
For complete usage information, refer to the documentation.
HTMLScanner,
HTMLTagBalancer,
HTMLErrorReporter| Modifier and Type | Class and Description |
|---|---|
protected class |
HTMLConfiguration.ErrorReporter
Defines an error reporter for reporting HTML errors.
|
| Modifier and Type | Field and Description |
|---|---|
protected static String |
AUGMENTATIONS
Include infoset augmentations.
|
protected static String |
ERROR_DOMAIN
Error domain.
|
protected static String |
ERROR_REPORTER
Error reporter.
|
protected boolean |
fCloseStream
Stream opened by parser.
|
protected XMLDocumentHandler |
fDocumentHandler
Document handler.
|
protected HTMLScanner |
fDocumentScanner
Document scanner.
|
protected XMLErrorHandler |
fErrorHandler
Error handler.
|
protected HTMLErrorReporter |
fErrorReporter
Error reporter.
|
protected List<HTMLComponent> |
fHTMLComponents
Components.
|
protected static String |
FILTERS
Pipeline filters.
|
protected NamespaceBinder |
fNamespaceBinder
Namespace binder.
|
protected HTMLTagBalancer |
fTagBalancer
HTML tag balancer.
|
HTMLElements |
htmlElements_ |
protected static String |
NAMES_ATTRS
Modify HTML attribute names: { "upper", "lower", "default" }.
|
protected static String |
NAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }.
|
protected static String |
NAMESPACES
Namespaces.
|
protected static String |
REPORT_ERRORS
Report errors.
|
protected static String |
SIMPLE_ERROR_FORMAT
Simple report format.
|
fFeatures, fProperties, fRecognizedFeatures, fRecognizedProperties| Constructor and Description |
|---|
HTMLConfiguration()
Default constructor.
|
HTMLConfiguration(HTMLElements htmlElements) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponent(HTMLComponent component) |
void |
cleanup()
If the application decides to terminate parsing before the xml document
is fully parsed, the application should call this method to free any
resource allocated during parsing.
|
protected HTMLScanner |
createDocumentScanner() |
void |
evaluateInputSource(XMLInputSource inputSource)
EXPERIMENTAL: may change in next release
Immediately evaluates an input source and add the new content (e.g. |
XMLDocumentHandler |
getDocumentHandler() |
XMLErrorHandler |
getErrorHandler() |
boolean |
parse(boolean complete)
Parses the document in a pull parsing fashion.
|
void |
parse(XMLInputSource source)
Parses a document.
|
void |
pushInputSource(XMLInputSource inputSource)
Pushes an input source onto the current entity stack.
|
protected void |
reset()
Resets the parser configuration.
|
void |
setDocumentHandler(XMLDocumentHandler handler)
Sets the document handler to receive information about the document.
|
void |
setErrorHandler(XMLErrorHandler handler)
Sets the error handler.
|
void |
setFeature(String featureId,
boolean state)
Set the state of a feature.
|
void |
setInputSource(XMLInputSource inputSource)
Sets the input source for the document to parse.
|
void |
setProperty(String propertyId,
Object value)
setProperty
|
addRecognizedFeatures, addRecognizedProperties, checkFeature, checkProperty, getFeature, getPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddRecognizedFeatures, addRecognizedProperties, getFeature, getPropertyprotected static final String NAMESPACES
protected static final String AUGMENTATIONS
protected static final String REPORT_ERRORS
protected static final String SIMPLE_ERROR_FORMAT
protected static final String NAMES_ELEMS
protected static final String NAMES_ATTRS
protected static final String FILTERS
protected static final String ERROR_REPORTER
protected static final String ERROR_DOMAIN
protected XMLDocumentHandler fDocumentHandler
protected XMLErrorHandler fErrorHandler
protected boolean fCloseStream
protected final List<HTMLComponent> fHTMLComponents
protected final HTMLScanner fDocumentScanner
protected final HTMLTagBalancer fTagBalancer
protected final NamespaceBinder fNamespaceBinder
protected final HTMLErrorReporter fErrorReporter
public final HTMLElements htmlElements_
public HTMLConfiguration()
public HTMLConfiguration(HTMLElements htmlElements)
protected HTMLScanner createDocumentScanner()
public void pushInputSource(XMLInputSource inputSource)
Hint: To use this feature to insert the output of <SCRIPT> tags, remember to buffer the entire output of the processed instructions before pushing a new input source. Otherwise, events may appear out of sequence.
inputSource - The new input source to start scanning.evaluateInputSource(XMLInputSource)public void evaluateInputSource(XMLInputSource inputSource)
inputSource - The new input source to start scanning.pushInputSource(XMLInputSource)public void setFeature(String featureId, boolean state) throws XMLConfigurationException
ParserConfigurationSettingsSet the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.
setFeature in interface XMLParserConfigurationsetFeature in class ParserConfigurationSettingsfeatureId - The unique identifier (URI) of the feature.state - The requested state of the feature (true or false).XMLConfigurationException - Thrown if there is a configuration
error.public void setProperty(String propertyId, Object value) throws XMLConfigurationException
ParserConfigurationSettingssetProperty in interface XMLParserConfigurationsetProperty in class ParserConfigurationSettingspropertyId - the property idvalue - the valueXMLConfigurationException - Thrown if there is a configuration
error.public void setDocumentHandler(XMLDocumentHandler handler)
XMLParserConfigurationsetDocumentHandler in interface XMLParserConfigurationhandler - The document handler.public XMLDocumentHandler getDocumentHandler()
getDocumentHandler in interface XMLParserConfigurationpublic void setErrorHandler(XMLErrorHandler handler)
XMLParserConfigurationsetErrorHandler in interface XMLParserConfigurationhandler - The error resolver.public XMLErrorHandler getErrorHandler()
getErrorHandler in interface XMLParserConfigurationpublic void parse(XMLInputSource source) throws XNIException, IOException
parse in interface XMLParserConfigurationsource - The input source for the top-level of the
XML document.XNIException - Any XNI exception, possibly wrapping
another exception.IOException - An IO exception from the parser, possibly
from a byte stream or character stream
supplied by the parser.public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException
setInputSource in interface XMLParserConfigurationinputSource - The document's input source.XMLConfigurationException - Thrown if there is a
configuration error when initializing the
parser.IOException - Thrown on I/O error.parse(boolean)public boolean parse(boolean complete)
throws XNIException,
IOException
parse in interface XMLParserConfigurationcomplete - True if the pull parser should parse the
remaining document completely.XNIException - Any XNI exception, possibly wrapping
another exception.IOException - An IO exception from the parser, possibly
from a byte stream or character stream
supplied by the parser.setInputSource(net.sourceforge.htmlunit.xerces.xni.parser.XMLInputSource)public void cleanup()
cleanup in interface XMLParserConfigurationprotected void addComponent(HTMLComponent component)
protected void reset()
throws XMLConfigurationException
XMLConfigurationExceptionCopyright © 2023 Gargoyle Software Inc.. All rights reserved.