| Package | Description | 
|---|---|
| javax.xml.parsers | 
                Provides classes allowing the processing of XML documents. | 
| javax.xml.validation | 
                    This package provides an API for validation of XML documents. | 
| org.xml.sax |  This package provides the core SAX APIs. | 
| org.xml.sax.ext | 
This package contains interfaces to SAX2 facilities that
conformant SAX drivers won't necessarily support. | 
| org.xml.sax.helpers | This package contains "helper" classes, including
support for bootstrapping SAX-based applications. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| abstract void | DocumentBuilder. setErrorHandler(ErrorHandler eh)Specify the  ErrorHandlerto be used by the parser. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| abstract ErrorHandler | SchemaFactory. getErrorHandler()Gets the current  ErrorHandlerset to thisSchemaFactory. | |
| abstract ErrorHandler | ValidatorHandler. getErrorHandler()Gets the current  ErrorHandlerset to thisValidatorHandler. | |
| abstract ErrorHandler | Validator. getErrorHandler()Gets the current  ErrorHandlerset to thisValidator. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| abstract void | SchemaFactory. setErrorHandler(ErrorHandler errorHandler)Sets the  ErrorHandlerto receive errors encountered
 during thenewSchemamethod invocation. | |
| abstract void | ValidatorHandler. setErrorHandler(ErrorHandler errorHandler)Sets the  ErrorHandlerto receive errors encountered
 during the validation. | |
| abstract void | Validator. setErrorHandler(ErrorHandler errorHandler)Sets the  ErrorHandlerto receive errors encountered
 during thevalidatemethod invocation. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | HandlerBaseDeprecated. 
 This class works with the deprecated
              DocumentHandlerinterface.  It has been replaced by the SAX2DefaultHandlerclass. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| ErrorHandler | XMLReader. getErrorHandler()Return the current error handler. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | Parser. setErrorHandler(ErrorHandler handler)Deprecated.  Allow an application to register an error event handler. | |
| void | XMLReader. setErrorHandler(ErrorHandler handler)Allow an application to register an error event handler. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | DefaultHandler2This class extends the SAX2 base handler class to support the
 SAX2  LexicalHandler,DeclHandler, andEntityResolver2extensions. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | DefaultHandlerDefault base class for SAX2 event handlers. | |
| class  | XMLFilterImplBase class for deriving an XML filter. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| ErrorHandler | ParserAdapter. getErrorHandler()Return the current error handler. | |
| ErrorHandler | XMLFilterImpl. getErrorHandler()Get the current error event handler. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | XMLReaderAdapter. setErrorHandler(ErrorHandler handler)Register the error event handler. | |
| void | ParserAdapter. setErrorHandler(ErrorHandler handler)Set the error handler. | |
| void | XMLFilterImpl. setErrorHandler(ErrorHandler handler)Set the error event handler. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.