ml.options
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 false
java.io.IOException
org.xml.sax.SAXException
public 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.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
ex
- A parsing exceptionorg.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
org.xml.sax.ErrorHandler
interface
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
ex
- A parsing exceptionorg.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
org.xml.sax.ErrorHandler
interface
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
ex
- A parsing exceptionorg.xml.sax.SAXException