public class SchemaValidator extends Object
| Modifier and Type | Field and Description |
|---|---|
private Logger |
log
Class logger.
|
private Schema |
schema
Compiled schema object.
|
| Constructor and Description |
|---|
SchemaValidator(net.shibboleth.utilities.java.support.xml.SchemaBuilder.SchemaLanguage schemaLanguage,
File schemaLocation)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
getSchemaFiles(net.shibboleth.utilities.java.support.xml.SchemaBuilder.SchemaLanguage lang,
File[] schemaFilesOrDirectories,
List<File> accumulatedSchemaFiles)
Gets all of the schema files in the given set of readable files, directories or subdirectories.
|
private String |
schemaFileExtension(net.shibboleth.utilities.java.support.xml.SchemaBuilder.SchemaLanguage schemaLanguage)
Provides the file name extension associated with a schema language.
|
void |
validate(Source document)
Validate a document against the compiled schema.
|
private final Logger log
private final Schema schema
public SchemaValidator(@Nonnull net.shibboleth.utilities.java.support.xml.SchemaBuilder.SchemaLanguage schemaLanguage, @Nonnull File schemaLocation) throws SAXException
schemaLanguage - schema language in use: either XSD or RELAXschemaLocation - location of the schema description (may be a directory of schema files)SAXExceptionprivate String schemaFileExtension(@Nonnull net.shibboleth.utilities.java.support.xml.SchemaBuilder.SchemaLanguage schemaLanguage)
schemaLanguage - schema languageprotected void getSchemaFiles(@Nonnull net.shibboleth.utilities.java.support.xml.SchemaBuilder.SchemaLanguage lang, File[] schemaFilesOrDirectories, List<File> accumulatedSchemaFiles)
lang - schema language, must not be nullschemaFilesOrDirectories - files and directories which may contain schema filesaccumulatedSchemaFiles - list that accumulates the schema filespublic void validate(@Nonnull Source document) throws SAXException, IOException
document - document to validateSAXException - if the document fails to validateIOException - if an I/O error occurs while reading the documentCopyright © 2011–2016. All rights reserved.