- All Known Implementing Classes:
AbstractContentValidator,JsonSchemaContentValidator,XmlSchemaContentValidator
public interface IContentValidator
A common interface for validation of Metaschema module-based content.
-
Method Summary
Modifier and TypeMethodDescriptionvalidate(InputStream is, URI documentUri) Validate the resource associated with the provided input streamis.Validate the resource identified by the provideduri.default IValidationResultValidate the resource at the providedurl.default IValidationResultValidate the resource at providedpath.static IValidationResultvalidateWithJsonSchema(URI target, org.json.JSONObject schema) Validate the target using the provided JSON schema.static IValidationResultvalidateWithXmlSchema(URI target, List<Source> schemaSources) Validate the target using the provided XML schemas.
-
Method Details
-
validate
Validate the resource at providedpath.- Parameters:
path- the resource to validate- Returns:
- the result of the validation
- Throws:
IOException- if an error occurred while performing validation
-
validate
@NonNull default IValidationResult validate(@NonNull URL url) throws IOException, URISyntaxException Validate the resource at the providedurl.- Parameters:
url- the resource to validate- Returns:
- the result of the validation
- Throws:
IOException- if an error occurred while performing validationURISyntaxException- if there is a problem with the providedurl
-
validate
Validate the resource identified by the provideduri.- Parameters:
uri- the resource to validate- Returns:
- the result of the validation
- Throws:
IOException- if an error occurred while performing validation
-
validate
@NonNull IValidationResult validate(@NonNull InputStream is, @NonNull URI documentUri) throws IOException Validate 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
-
validateWithXmlSchema
@NonNull static IValidationResult validateWithXmlSchema(@NonNull URI target, @NonNull List<Source> schemaSources) throws IOException, SAXException Validate the target using the provided XML schemas.- Parameters:
target- the target to validateschemaSources- the XML schema sources to validate with- Returns:
- the validation result
- Throws:
IOException- if an error occurred while performing validationSAXException- if an error occurred while parsing the XML target or schema
-
validateWithJsonSchema
@NonNull static IValidationResult validateWithJsonSchema(@NonNull URI target, @NonNull org.json.JSONObject schema) throws IOException Validate the target using the provided JSON schema.- Parameters:
target- the target to validateschema- the JSON schema to validate with- Returns:
- the validation result
- Throws:
IOException- if an error occurred while performing validation- See Also:
-