Module dev.metaschema.core
Class XmlSchemaContentValidator
java.lang.Object
dev.metaschema.core.model.AbstractResourceResolver
dev.metaschema.core.model.validation.AbstractContentValidator
dev.metaschema.core.model.validation.XmlSchemaContentValidator
- All Implemented Interfaces:
IResourceResolver,IContentValidator
Supports validating an XML resource using an XML schema.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRecords an identified individual validation result found during XML schema validation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionXmlSchemaContentValidator(@Owning List<? extends Source> schemaSources) Construct a new XML schema validator using the provided XML schema sources.protectedXmlSchemaContentValidator(Schema schema) Construct a new XML schema validator using the provided pre-parsed XML schema(s). -
Method Summary
Modifier and TypeMethodDescriptionvalidate(InputStream is, URI documentUri) Validate the resource associated with the provided input streamis.Methods inherited from class dev.metaschema.core.model.validation.AbstractContentValidator
validateMethods inherited from class dev.metaschema.core.model.AbstractResourceResolver
getUriResolver, setUriResolverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.model.validation.IContentValidator
validate, validateMethods inherited from interface dev.metaschema.core.model.IResourceResolver
resolve
-
Constructor Details
-
XmlSchemaContentValidator
public XmlSchemaContentValidator(@Owning @NonNull @Owning List<? extends Source> schemaSources) throws IOException Construct a new XML schema validator using the provided XML schema sources.This constructor takes ownership of the provided schema sources and is responsible for closing any associated input streams.
- Parameters:
schemaSources- the XML schemas to use for validation. Ownership of these sources is transferred to this constructor, which will close any associated input streams.- Throws:
IOException- if an error occurred while parsing the provided XML schemas
-
XmlSchemaContentValidator
Construct a new XML schema validator using the provided pre-parsed XML schema(s).- Parameters:
schema- the pre-parsed XML schema(s) to use for validation
-
-
Method Details
-
validate
Description copied from interface:IContentValidatorValidate the resource associated with the provided input streamis.- Parameters:
is- an input stream to access the resourcedocumentUri- the URI of the resource to validate- Returns:
- the result of the validation
- Throws:
IOException- if an error occurred while performing validation
-