public class SchemaValidator
extends org.xml.sax.helpers.DefaultHandler
| Constructor and Description |
|---|
SchemaValidator() |
| Modifier and Type | Method and Description |
|---|---|
void |
error(org.xml.sax.SAXParseException ex)
A method required by the
org.xml.sax.ErrorHandler interface |
void |
fatalError(org.xml.sax.SAXParseException ex)
A method required by the
org.xml.sax.ErrorHandler interface |
java.lang.String |
getError()
Retrieve the error message set by the
org.xml.sax.ErrorHandler methods. |
boolean |
validate(java.io.Reader xmlReader)
The actual validation method.
|
void |
warning(org.xml.sax.SAXParseException ex)
A method required by the
org.xml.sax.ErrorHandler interface |
public boolean validate(java.io.Reader xmlReader)
throws java.io.IOException,
org.xml.sax.SAXException
getError() method.
xmlReader - The reader for the XML file to validate
true if the XML file could be validated against the XML schema, else falsejava.io.IOExceptionorg.xml.sax.SAXExceptionpublic java.lang.String getError()
org.xml.sax.ErrorHandler methods.
If no error has been found, null is returned.
public void warning(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
org.xml.sax.ErrorHandler interface
warning in interface org.xml.sax.ErrorHandlerwarning in class org.xml.sax.helpers.DefaultHandlerex - A parsing exceptionorg.xml.sax.SAXExceptionpublic void error(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
org.xml.sax.ErrorHandler interface
error in interface org.xml.sax.ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerex - A parsing exceptionorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
org.xml.sax.ErrorHandler interface
fatalError in interface org.xml.sax.ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerex - A parsing exceptionorg.xml.sax.SAXException