|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.SchemaValidator
public class SchemaValidator
Utility class to validate an XML docuement against an XML schema.
| Constructor Summary | |
|---|---|
SchemaValidator(JPPFErrorReporter reporter)
Initialize this validator with the specified error reporter. |
|
| Method Summary | |
|---|---|
SchemaFactory |
getSchemaFactory()
Get the schema factory for this validator. |
Schema |
loadSchema(InputStream schemaStream)
Load an XML schema from the specified input stream. |
Schema |
loadSchema(Reader schemaReader)
Load an XML schema from the specified reader. |
Schema |
loadSchema(String schemaPath)
Load an XML schema from the specified path. |
static void |
main(String... args)
Entry point to test this class. |
String |
printSAXParseException(SAXParseException e,
String name)
Print a trace of the specified sax parsing exception. |
static void |
usageAndExit()
Show usage instructions for this validation toll, and exit the JVM. |
boolean |
validate(Reader docReader,
Reader schemaReader)
Validate an XML document from a reader against an XML schema. |
boolean |
validate(String docPath,
String schemaPath)
Validate an XML document in a file against an XML schema. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SchemaValidator(JPPFErrorReporter reporter)
reporter - used to collect validation error and warning messages.| Method Detail |
|---|
public static void main(String... args)
args - not used.public static void usageAndExit()
public Schema loadSchema(String schemaPath)
throws IOException,
SAXException
schemaPath - the path to the schema to load.
Schema instance, or null if the schema file could not be found.
IOException - if an IO error occurs while looking up the schema file.
SAXException - if an error occurs while loading the schema.
public Schema loadSchema(InputStream schemaStream)
throws IOException,
SAXException
schemaStream - the input stream to load the schema from.
Schema instance, or null if the schema file could not be found.
IOException - if an IO error occurs while looking up the schema file.
SAXException - if an error occurs while loading the schema.
public Schema loadSchema(Reader schemaReader)
throws IOException,
SAXException
schemaReader - the reader to load the schema from.
Schema instance, or null if the schema file could not be found.
IOException - if an IO error occurs while looking up the schema file.
SAXException - if an error occurs while loading the schema.
public boolean validate(String docPath,
String schemaPath)
throws IOException,
SAXException
docPath - the path to the XML document.schemaPath - the path to the XML schema.
IOException - if an IO error occurs while looking up one of the files.
SAXException - if an error occurs while loading the schema or validating the document.
public boolean validate(Reader docReader,
Reader schemaReader)
throws IOException,
SAXException
docReader - the reader used to access the document.schemaReader - the path to the XML schema.
IOException - if an IO error occurs while looking up one of the files.
SAXException - if an error occurs while loading the schema or validating the document.public SchemaFactory getSchemaFactory()
SchemaFactory instance.
public String printSAXParseException(SAXParseException e,
String name)
e - the exception to print.name - an identifier for the document being parsed.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||