Package org.geotools.xsd.impl
Class ParserHandler
- Object
-
- DefaultHandler
-
- DefaultHandler2
-
- ParserHandler
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,DeclHandler,EntityResolver2,LexicalHandler
- Direct Known Subclasses:
StreamingParserHandler
public class ParserHandler extends DefaultHandler2
The main sax event handler used for parsing the input document. This handler maintains a stack ofHandlerobjects. A handler is purshed onto the stack when a startElement event is processed, and popped off the stack when the corresponding endElement event is processed.- Author:
- Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceParserHandler.ContextCustomizerCustomize the context, after the configuration has set up the context before the document is parsed.
-
Constructor Summary
Constructors Constructor Description ParserHandler(Configuration config)
-
Method Summary
-
Methods inherited from class DefaultHandler2
attributeDecl, comment, elementDecl, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, startDTD, startEntity
-
Methods inherited from class DefaultHandler
fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
ParserHandler
public ParserHandler(Configuration config)
-
-
Method Detail
-
setContextCustomizer
public void setContextCustomizer(ParserHandler.ContextCustomizer contextCustomizer)
-
getConfiguration
public Configuration getConfiguration()
-
setStrict
public void setStrict(boolean strict)
-
isStrict
public boolean isStrict()
-
isValidating
public boolean isValidating()
-
setValidating
public void setValidating(boolean validating)
-
setFailOnValidationError
public void setFailOnValidationError(boolean failOnValidationError)
-
isFailOnValidationError
public boolean isFailOnValidationError()
-
setHandleMixedContent
public void setHandleMixedContent(boolean handleMixedContent)
-
isHandleMixedContent
public boolean isHandleMixedContent()
-
setForceParserDelegate
public void setForceParserDelegate(boolean forceParserDelegate)
-
isForceParserDelegate
public boolean isForceParserDelegate()
-
setRootElementType
public void setRootElementType(QName rootElementType)
-
getRootElementType
public QName getRootElementType()
-
getValidator
public ValidatorHandler getValidator()
-
getHandlerFactory
public HandlerFactory getHandlerFactory()
-
getBindingLoader
public BindingLoader getBindingLoader()
-
getBindingWalker
public BindingWalker getBindingWalker()
-
getBindingFactory
public BindingFactory getBindingFactory()
-
getSchemas
public XSDSchema[] getSchemas()
-
getSchemaIndex
public SchemaIndex getSchemaIndex()
-
getLogger
public Logger getLogger()
-
getNamespaceSupport
public ParserNamespaceSupport getNamespaceSupport()
-
getURIHandlers
public List<URIHandler> getURIHandlers()
-
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
-
getEntityResolver
public EntityResolver getEntityResolver()
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler2- Throws:
IOExceptionSAXException
-
resolveEntity
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException
- Specified by:
resolveEntityin interfaceEntityResolver2- Overrides:
resolveEntityin classDefaultHandler2- Throws:
SAXExceptionIOException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classDefaultHandler- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
endElementInternal
protected void endElementInternal(ElementHandler handler)
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classDefaultHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
warning
public void warning(SAXParseException e) throws SAXException
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Throws:
SAXException
-
error
public void error(SAXParseException e) throws SAXException
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
getValue
public Object getValue()
-
configure
protected void configure(Configuration config)
-
findSchemaLocators
protected XSDSchemaLocator[] findSchemaLocators()
-
findSchemaLocationResolvers
protected XSDSchemaLocationResolver[] findSchemaLocationResolvers()
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Overrides:
startCDATAin classDefaultHandler2- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Overrides:
endCDATAin classDefaultHandler2- Throws:
SAXException
-
isCDATAEnding
public boolean isCDATAEnding()
- Returns:
- the cDATAEnding
-
setCDATA
public void setCDATA(boolean b)
Inform the parser that it is inside a CDATA block.
-
isCDATA
public boolean isCDATA()
Check if the current text is inside a CDATA block.
-
-