java.lang.Object | |
↳ | org.apache.xerces.impl.XMLErrorReporter |
This class is a common element of all parser configurations and is used to report errors that occur. This component can be queried by parser components from the component manager using the following property ID:
http://apache.org/xml/properties/internal/error-reporter
Errors are separated into domains that categorize a class of errors.
In a parser configuration, the parser would register a
MessageFormatter
for each domain that is capable of
localizing error messages and formatting them based on information
about the error. Any parser component can invent new error domains
and register additional message formatters to localize messages in
those domains.
This component requires the following features and properties from the component manager that uses it:
This component can use the following features and properties but they are not required:
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CONTINUE_AFTER_FATAL_ERROR | Feature identifier: continue after fatal error. | |||||||||
String | ERROR_HANDLER | Property identifier: error handler. | |||||||||
short | SEVERITY_ERROR | Severity: error. | |||||||||
short | SEVERITY_FATAL_ERROR | Severity: fatal error. | |||||||||
short | SEVERITY_WARNING | Severity: warning. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fContinueAfterFatalError | Continue after fatal error feature. | ||||||||||
fDefaultErrorHandler | Default error handler. | ||||||||||
fErrorHandler | Error handler. | ||||||||||
fLocale | The locale to be used to format error messages. | ||||||||||
fLocator | Document locator. | ||||||||||
fMessageFormatters | Mapping of Message formatters for domains. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an error reporter with a locator.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the internal XMLErrrorHandler.
| |||||||||||
Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
| |||||||||||
Gets the current locale.
| |||||||||||
Returns the message formatter associated with the specified domain,
or null if no message formatter is registered for that domain.
| |||||||||||
Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
| |||||||||||
Returns a list of feature identifiers that are recognized by
this component.
| |||||||||||
Returns a list of property identifiers that are recognized by
this component.
| |||||||||||
Gets the internal XMLErrorHandler
as SAX ErrorHandler.
| |||||||||||
Registers a message formatter for the specified domain.
| |||||||||||
Removes the message formatter for the specified domain and
returns the removed message formatter.
| |||||||||||
Reports an error at a specific location.
| |||||||||||
Reports an error.
| |||||||||||
Resets the component.
| |||||||||||
Sets the document locator.
| |||||||||||
Sets the state of a feature.
| |||||||||||
Sets the current locale.
| |||||||||||
Sets the value of a property.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLComponent
|
Feature identifier: continue after fatal error.
Property identifier: error handler.
Severity: error. Common causes of errors are document structure and/or content that that does not conform to the grammar rules specified for the document. These are typically validation errors.
Severity: fatal error. Fatal errors are errors in the syntax of the XML document or invalid byte sequences for a given encoding. The XML 1.0 Specification mandates that errors of this type are not recoverable.
Note: The parser does have a "continue after fatal error" feature but it should be used with extreme caution and care.
Severity: warning. Warnings represent informational messages only that should not be considered serious enough to stop parsing or indicate an error in the document's validity.
Continue after fatal error feature.
Default error handler. This error handler is only used in the absence of a registered error handler so that errors are not "swallowed" silently. This is one of the most common "problems" reported by users of the parser.
Constructs an error reporter with a locator.
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
featureId | The feature identifier. |
---|
Returns the message formatter associated with the specified domain, or null if no message formatter is registered for that domain.
domain | The domain of the message formatter. |
---|
Returns the default state for a property, or null if this component does not want to report a default value for this property.
propertyId | The property identifier. |
---|
Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.
Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.
Gets the internal XMLErrorHandler as SAX ErrorHandler.
Registers a message formatter for the specified domain.
Note: Registering a message formatter for a domain when there is already a formatter registered will cause the previous formatter to be lost. This method replaces any previously registered message formatter for the specified domain.
Removes the message formatter for the specified domain and returns the removed message formatter.
domain | The domain of the message formatter. |
---|
Reports an error at a specific location.
location | The error location. |
---|---|
domain | The error domain. |
key | The key of the error message. |
arguments | The replacement arguments for the error message, if needed. |
severity | The severity of the error. |
XNIException |
---|
Reports an error. The error message passed to the error handler is formatted for the locale by the message formatter installed for the specified error domain.
domain | The error domain. |
---|---|
key | The key of the error message. |
arguments | The replacement arguments for the error message, if needed. |
severity | The severity of the error. |
XNIException |
---|
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
componentManager | The component manager. |
---|
Thrown by component on initialization error. For example, if a feature or property is required for the operation of the component, the component manager may throw a SAXNotRecognizedException or a SAXNotSupportedException. | |
XNIException |
Sets the document locator.
locator | The locator. |
---|
Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.
Note: Components should silently ignore features that do not affect the operation of the component.
featureId | The feature identifier. |
---|---|
state | The state of the feature. |
The component should not throw this exception. | |
The component should not throw this exception. | |
XMLConfigurationException |
Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.
Note: Components should silently ignore properties that do not affect the operation of the component.
propertyId | The property identifier. |
---|---|
value | The value of the property. |
The component should not throw this exception. | |
The component should not throw this exception. | |
XMLConfigurationException |