public class HTMLConfiguration
extends org.apache.xerces.util.ParserConfigurationSettings
implements org.apache.xerces.xni.parser.XMLPullParserConfiguration
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 |
BALANCE_TAGS
Balance tags.
|
protected static String |
ERROR_DOMAIN
Error domain.
|
protected static String |
ERROR_REPORTER
Error reporter.
|
protected boolean |
fCloseStream
Stream opened by parser.
|
protected org.apache.xerces.xni.XMLDocumentHandler |
fDocumentHandler
Document handler.
|
protected HTMLScanner |
fDocumentScanner
Document scanner.
|
protected org.apache.xerces.xni.XMLDTDContentModelHandler |
fDTDContentModelHandler
DTD content model handler.
|
protected org.apache.xerces.xni.XMLDTDHandler |
fDTDHandler
DTD handler.
|
protected org.apache.xerces.xni.parser.XMLEntityResolver |
fEntityResolver
Entity resolver.
|
protected org.apache.xerces.xni.parser.XMLErrorHandler |
fErrorHandler
Error handler.
|
protected HTMLErrorReporter |
fErrorReporter
Error reporter.
|
protected List<HTMLComponent> |
fHTMLComponents
Components.
|
protected static String |
FILTERS
Pipeline filters.
|
protected Locale |
fLocale
Locale.
|
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.
|
protected static boolean |
XERCES_2_0_0
Parser version is Xerces 2.0.0.
|
protected static boolean |
XERCES_2_0_1
Parser version is Xerces 2.0.1.
|
protected static boolean |
XML4J_4_0_x
Parser version is XML4J 4.0.x.
|
| Constructor and Description |
|---|
HTMLConfiguration()
Default constructor.
|
HTMLConfiguration(HTMLElements htmlElements) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponent(HTMLComponent component)
Adds a 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(org.apache.xerces.xni.parser.XMLInputSource inputSource)
EXPERIMENTAL: may change in next release
Immediately evaluates an input source and add the new content (e.g. |
org.apache.xerces.xni.XMLDocumentHandler |
getDocumentHandler()
Returns the document handler.
|
org.apache.xerces.xni.XMLDTDContentModelHandler |
getDTDContentModelHandler()
Returns the DTD content model handler.
|
org.apache.xerces.xni.XMLDTDHandler |
getDTDHandler()
Returns the DTD handler.
|
org.apache.xerces.xni.parser.XMLEntityResolver |
getEntityResolver()
Returns the entity resolver.
|
org.apache.xerces.xni.parser.XMLErrorHandler |
getErrorHandler()
Returns the error handler.
|
Locale |
getLocale()
Returns the locale.
|
boolean |
parse(boolean complete)
Parses the document in a pull parsing fashion.
|
void |
parse(org.apache.xerces.xni.parser.XMLInputSource source)
Parses a document.
|
void |
pushInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
Pushes an input source onto the current entity stack.
|
protected void |
reset()
Resets the parser configuration.
|
void |
setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
Sets the document handler.
|
void |
setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler handler)
Sets the DTD content model handler.
|
void |
setDTDHandler(org.apache.xerces.xni.XMLDTDHandler handler)
Sets the DTD handler.
|
void |
setEntityResolver(org.apache.xerces.xni.parser.XMLEntityResolver resolver)
Sets the entity resolver.
|
void |
setErrorHandler(org.apache.xerces.xni.parser.XMLErrorHandler handler)
Sets the error handler.
|
void |
setFeature(String featureId,
boolean state)
Sets a feature.
|
void |
setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
Sets the input source for the document to parse.
|
void |
setLocale(Locale locale)
Sets the locale.
|
void |
setProperty(String propertyId,
Object value)
Sets a property.
|
addRecognizedFeatures, addRecognizedProperties, checkFeature, checkProperty, 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 BALANCE_TAGS
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 org.apache.xerces.xni.XMLDocumentHandler fDocumentHandler
protected org.apache.xerces.xni.XMLDTDHandler fDTDHandler
protected org.apache.xerces.xni.XMLDTDContentModelHandler fDTDContentModelHandler
protected org.apache.xerces.xni.parser.XMLErrorHandler fErrorHandler
protected org.apache.xerces.xni.parser.XMLEntityResolver fEntityResolver
protected Locale fLocale
protected boolean fCloseStream
protected final List<HTMLComponent> fHTMLComponents
protected final HTMLScanner fDocumentScanner
protected final HTMLTagBalancer fTagBalancer
protected final NamespaceBinder fNamespaceBinder
protected final HTMLErrorReporter fErrorReporter
protected static boolean XERCES_2_0_0
protected static boolean XERCES_2_0_1
protected static boolean XML4J_4_0_x
public final HTMLElements htmlElements_
public HTMLConfiguration()
public HTMLConfiguration(HTMLElements htmlElements)
protected HTMLScanner createDocumentScanner()
public void pushInputSource(org.apache.xerces.xni.parser.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(org.apache.xerces.xni.parser.XMLInputSource inputSource)
inputSource - The new input source to start scanning.pushInputSource(XMLInputSource)public void setFeature(String featureId, boolean state) throws org.apache.xerces.xni.parser.XMLConfigurationException
setFeature in interface org.apache.xerces.xni.parser.XMLParserConfigurationsetFeature in class org.apache.xerces.util.ParserConfigurationSettingsorg.apache.xerces.xni.parser.XMLConfigurationExceptionpublic void setProperty(String propertyId, Object value) throws org.apache.xerces.xni.parser.XMLConfigurationException
setProperty in interface org.apache.xerces.xni.parser.XMLParserConfigurationsetProperty in class org.apache.xerces.util.ParserConfigurationSettingsorg.apache.xerces.xni.parser.XMLConfigurationExceptionpublic void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
setDocumentHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()
getDocumentHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic void setDTDHandler(org.apache.xerces.xni.XMLDTDHandler handler)
setDTDHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic org.apache.xerces.xni.XMLDTDHandler getDTDHandler()
getDTDHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic void setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler handler)
setDTDContentModelHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic org.apache.xerces.xni.XMLDTDContentModelHandler getDTDContentModelHandler()
getDTDContentModelHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic void setErrorHandler(org.apache.xerces.xni.parser.XMLErrorHandler handler)
setErrorHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic org.apache.xerces.xni.parser.XMLErrorHandler getErrorHandler()
getErrorHandler in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic void setEntityResolver(org.apache.xerces.xni.parser.XMLEntityResolver resolver)
setEntityResolver in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic org.apache.xerces.xni.parser.XMLEntityResolver getEntityResolver()
getEntityResolver in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic void setLocale(Locale locale)
setLocale in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic Locale getLocale()
getLocale in interface org.apache.xerces.xni.parser.XMLParserConfigurationpublic void parse(org.apache.xerces.xni.parser.XMLInputSource source)
throws org.apache.xerces.xni.XNIException,
IOException
parse in interface org.apache.xerces.xni.parser.XMLParserConfigurationorg.apache.xerces.xni.XNIExceptionIOExceptionpublic void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
throws org.apache.xerces.xni.parser.XMLConfigurationException,
IOException
setInputSource in interface org.apache.xerces.xni.parser.XMLPullParserConfigurationinputSource - The document's input source.org.apache.xerces.xni.parser.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 org.apache.xerces.xni.XNIException,
IOException
parse in interface org.apache.xerces.xni.parser.XMLPullParserConfigurationcomplete - True if the pull parser should parse the
remaining document completely.org.apache.xerces.xni.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(org.apache.xerces.xni.parser.XMLInputSource)public void cleanup()
cleanup in interface org.apache.xerces.xni.parser.XMLPullParserConfigurationprotected void addComponent(HTMLComponent component)
protected void reset()
throws org.apache.xerces.xni.parser.XMLConfigurationException
org.apache.xerces.xni.parser.XMLConfigurationExceptionCopyright © 2018. All rights reserved.