public class DOMParser extends AbstractDOMParser
Modifier and Type | Field and Description |
---|---|
protected boolean |
fUseEntityResolver2
Use EntityResolver2.
|
protected static String |
SYMBOL_TABLE
Property identifier: symbol table.
|
protected static String |
USE_ENTITY_RESOLVER2
Feature identifier: EntityResolver2.
|
protected static String |
XMLGRAMMAR_POOL
Property identifier: XML grammar pool.
|
ABORT, CORE_DOCUMENT_CLASS_NAME, CREATE_CDATA_NODES_FEATURE, CREATE_ENTITY_REF_NODES, CURRENT_ELEMENT_NODE, DEFAULT_DOCUMENT_CLASS_NAME, DEFER_NODE_EXPANSION, DOCUMENT_CLASS_NAME, fBaseURIStack, fCreateCDATANodes, fCreateEntityRefNodes, fCurrentCDATASection, fCurrentCDATASectionIndex, fCurrentEntityDecl, fCurrentNode, fCurrentNodeIndex, fDeferNodeExpansion, fDeferredDocumentImpl, fDeferredEntityDecl, fDocument, fDocumentClassName, fDocumentImpl, fDocumentIndex, fDocumentType, fDocumentTypeIndex, fDOMFilter, fErrorHandler, fFilterReject, fFirstChunk, fInCDATASection, fIncludeComments, fIncludeIgnorableWhitespace, fInDTD, fInDTDExternalSubset, fInEntityRef, fInternalSubset, fNamespaceAware, fRejectedElement, fRoot, fSkippedElemStack, fStorePSVI, fStringBuffer, INCLUDE_COMMENTS_FEATURE, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, PSVI_DOCUMENT_CLASS_NAME
fDocumentSource, fDTDContentModelSource, fDTDSource
ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
Constructor and Description |
---|
DOMParser()
Constructs a DOM parser using the dtd/xml schema parser configuration.
|
DOMParser(SymbolTable symbolTable)
Constructs a DOM parser using the specified symbol table.
|
DOMParser(SymbolTable symbolTable,
XMLGrammarPool grammarPool)
Constructs a DOM parser using the specified symbol table and
grammar pool.
|
DOMParser(XMLParserConfiguration config)
Constructs a DOM parser using the specified parser configuration.
|
Modifier and Type | Method and Description |
---|---|
EntityResolver |
getEntityResolver()
Return the current entity resolver.
|
ErrorHandler |
getErrorHandler()
Return the current error handler.
|
boolean |
getFeature(String featureId)
Query the state of a feature.
|
Object |
getProperty(String propertyId)
Query the value of a property.
|
XMLParserConfiguration |
getXMLParserConfiguration()
Returns this parser's XMLParserConfiguration.
|
void |
parse(InputSource inputSource)
parse
|
void |
parse(String systemId)
Parses the input source specified by the given system identifier.
|
void |
setEntityResolver(EntityResolver resolver)
Sets the resolver used to resolve external entities.
|
void |
setErrorHandler(ErrorHandler errorHandler)
Allow an application to register an error event handler.
|
void |
setFeature(String featureId,
boolean state)
Set the state of any feature in a SAX2 parser.
|
void |
setProperty(String propertyId,
Object value)
Set the value of any property in a SAX2 parser.
|
abort, attributeDecl, characters, comment, createAttrNode, createElementNode, doctypeDecl, dropDocumentReferences, elementDecl, emptyElement, endAttlist, endCDATA, endConditional, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getDocument, getDocumentClassName, handleBaseURI, handleBaseURI, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, processingInstruction, reset, setCharacterData, setDocumentClassName, setLocale, startAttlist, startCDATA, startConditional, startDocument, startDTD, startElement, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl
any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroup
protected static final String USE_ENTITY_RESOLVER2
protected static final String SYMBOL_TABLE
protected static final String XMLGRAMMAR_POOL
protected boolean fUseEntityResolver2
public DOMParser(XMLParserConfiguration config)
public DOMParser()
public DOMParser(SymbolTable symbolTable)
public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool)
public void parse(String systemId) throws SAXException, IOException
This method is equivalent to the following:
parse(new InputSource(systemId));
systemId
- The system identifier (URI).SAXException
- Throws exception on SAX error.IOException
- Throws exception on i/o error.public void parse(InputSource inputSource) throws SAXException, IOException
inputSource
- SAXException
IOException
public void setEntityResolver(EntityResolver resolver)
resolver
- The new entity resolver. Passing a null value will
uninstall the currently installed resolver.public EntityResolver getEntityResolver()
setEntityResolver(org.xml.sax.EntityResolver)
public void setErrorHandler(ErrorHandler errorHandler)
If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
errorHandler
- The error handler.NullPointerException
- If the handler
argument is null.getErrorHandler()
public ErrorHandler getErrorHandler()
setErrorHandler(org.xml.sax.ErrorHandler)
public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException
featureId
- The unique identifier (URI) of the feature.state
- The requested state of the feature (true or false).SAXNotRecognizedException
- If the
requested feature is not known.SAXNotSupportedException
- If the
requested feature is known, but the requested
state is not supported.public boolean getFeature(String featureId) throws SAXNotRecognizedException, SAXNotSupportedException
featureId
- The unique identifier (URI) of the feature
being set.SAXNotRecognizedException
- If the
requested feature is not known.SAXNotSupportedException
- If the
requested feature is known but not supported.public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
propertyId
- The unique identifier (URI) of the property
being set.value
- The value to which the property is being set.SAXNotRecognizedException
- If the
requested property is not known.SAXNotSupportedException
- If the
requested property is known, but the requested
value is not supported.public Object getProperty(String propertyId) throws SAXNotRecognizedException, SAXNotSupportedException
propertyId
- The unique identifier (URI) of the property
being set.SAXNotRecognizedException
- If the
requested property is not known.SAXNotSupportedException
- If the
requested property is known but not supported.public XMLParserConfiguration getXMLParserConfiguration()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.