|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.pba.rbac.xmlpolicy.schemachecking.W3CXMLSchemaValidator
public class W3CXMLSchemaValidator
Class that abstracts the W3C XML Schema validation process. It is an implementation of the SchemaValidatorInterface.
Constructor Summary | |
---|---|
W3CXMLSchemaValidator()
Create a Validator instance with the default Schema as specified in schema_checking.properties file. |
|
W3CXMLSchemaValidator(java.io.File schemaFile)
Create a Validator instance with the Schema represented by the given File object. |
Method Summary | |
---|---|
static java.lang.String |
getExceptionDiagnostic(org.xml.sax.SAXParseException ex)
Get a meaningful report about a validation exception. |
javax.xml.validation.Schema |
getSchema()
Get the Schema used by the Validator to check instance documents. |
void |
setSchema(javax.xml.validation.Schema schema)
Set the Schema used by the Validator to check instance documents. |
void |
validate(org.w3c.dom.Node r)
Checks if xml represented by a node is valid according to the current schema. |
void |
validate(java.io.Reader r)
Checks if xml content represented by a Reader is valid according to the current schema. |
void |
validate(javax.xml.transform.Source source)
Check if xml represented by a Source is valid according to the current schema. |
void |
validate(java.lang.String s)
Checks if a given xml string is valid according to the current schema. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public W3CXMLSchemaValidator() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
- Thrown if parsing of the Schema file fails
java.io.IOException
- Thrown is a file operation failspublic W3CXMLSchemaValidator(java.io.File schemaFile) throws org.xml.sax.SAXException, java.io.IOException
schemaFile
- File that contains the Schema to be used
org.xml.sax.SAXException
- Thrown if parsing of the Schema file fails
java.io.IOException
- Thrown is a file operation failsMethod Detail |
---|
public javax.xml.validation.Schema getSchema()
getSchema
in interface SchemaValidatorInterface
public void setSchema(javax.xml.validation.Schema schema)
setSchema
in interface SchemaValidatorInterface
schema
- Schema to be used for validationpublic void validate(java.lang.String s) throws org.xml.sax.SAXException, java.io.IOException
validate
in interface SchemaValidatorInterface
s
- String to be validated
org.xml.sax.SAXException
- If parsing of the schema instance fails
java.io.IOException
- Thrown on IO errorpublic void validate(java.io.Reader r) throws org.xml.sax.SAXException, java.io.IOException
validate
in interface SchemaValidatorInterface
r
- Reader accessing the xml content
org.xml.sax.SAXException
- If parsing of the schema instance fails
java.io.IOException
- Thrown on IO errorpublic void validate(org.w3c.dom.Node r) throws org.xml.sax.SAXException, java.io.IOException
validate
in interface SchemaValidatorInterface
r
- XML Node that is to be validated
org.xml.sax.SAXException
- If parsing of the schema instance fails
java.io.IOException
- Thrown on IO errorpublic void validate(javax.xml.transform.Source source) throws org.xml.sax.SAXException, java.io.IOException
validate
in interface SchemaValidatorInterface
source
- Source to be validated
org.xml.sax.SAXException
- If parsing of the schema instance fails
java.io.IOException
- Thrown on IO errorpublic static java.lang.String getExceptionDiagnostic(org.xml.sax.SAXParseException ex)
ex
- SAXParseException to get the report for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |