public class ValidationErrorHandler extends Object implements ErrorHandler, DOMErrorHandler, Iterable<ValidationError>
| Constructor and Description |
|---|
ValidationErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addError(ErrorSeverity severity,
String msg,
ErrorLocator locator)
Adds a general validation error.
|
void |
addError(ErrorSeverity severity,
String msg,
String diag,
ErrorLocator locator)
Adds a general validation error with diagnostic information.
|
void |
addErrors(Collection<ValidationError> errors)
Adds the given collection of validation errors to this handler.
|
void |
error(SAXParseException spex)
Receives notification of a recoverable error.
|
boolean |
errorsDetected()
Indicates whether any validation errors have been detected.
|
void |
fatalError(SAXParseException spex)
Receives notification of a non-recoverable error, such as non-XML
content, XML that is not well-formed, or an incorrect encoding
declaration.
|
int |
getErrorCount()
Reports the number of errors detected during a validation episode.
|
List<ValidationError> |
getErrors()
Gets the errors reported to this handler.
|
String |
getSchemaLanguage() |
boolean |
handleError(DOMError error) |
Iterator<ValidationError> |
iterator()
Returns an iterator over the validation errors collected by this handler.
|
void |
reset()
Clears all errors and messages.
|
void |
setSchemaLanguage(String schemaLanguage) |
String |
toString()
Returns a concatenation of the summaries of all received errors.
|
String |
toXml()
Returns a simple XML representation of all received errors.
|
void |
warning(SAXParseException spex)
Receives notification of a warning.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic boolean errorsDetected()
public int getErrorCount()
public void warning(SAXParseException spex)
warning in interface ErrorHandlerspex - a non-error condition reported by the parserErrorHandler.warning(org.xml.sax.SAXParseException)public void error(SAXParseException spex)
error in interface ErrorHandlerspex - a non-fatal error condition reported by the parserErrorHandler.error(org.xml.sax.SAXParseException)public void fatalError(SAXParseException spex)
fatalError in interface ErrorHandlerspex - A fatal error condition reported by the parser.ErrorHandler.fatalError(org.xml.sax.SAXParseException),
XML 1.0 (Fourth Edition)public boolean handleError(DOMError error)
handleError in interface DOMErrorHandlerpublic void addError(ErrorSeverity severity, String msg, ErrorLocator locator)
severity - The severity of the error.msg - The error message.locator - An ErrorLocator instance that provides
information regarding the location of the error.public void addError(ErrorSeverity severity, String msg, String diag, ErrorLocator locator)
severity - The severity of the error.msg - The error message.diag - Supplementary diagnostic information about the error.locator - An ErrorLocator instance that provides
information regarding the location of the error.public void addErrors(Collection<ValidationError> errors)
errors - A collection of ValidationError objects, each
of which encapsulates information about some constraint violation (which
are not necessarily related).public List<ValidationError> getErrors()
public String toString()
public String toXml()
Returns a simple XML representation of all received errors. The structure is shown below:
<errors xmlns='http://www.galdosinc.com/arbitron'>
<error /> 1..*
</errors>
public Iterator<ValidationError> iterator()
iterator in interface Iterable<ValidationError>Iterator for this handler.public void reset()
public String getSchemaLanguage()
public void setSchemaLanguage(String schemaLanguage)
Copyright © 2016 Open Geospatial Consortium. All rights reserved.