Interface IContentValidator
-
- All Known Implementing Classes:
AbstractContentValidator
,JsonSchemaContentValidator
,XmlSchemaContentValidator
public interface IContentValidator
A common interface for validation of Metaschema module-based content.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IValidationResult
validate(InputStream is, URI documentUri)
Validate the resource associated with the provided input streamis
.IValidationResult
validate(URI uri)
Validate the resource identified by the provideduri
.default IValidationResult
validate(URL url)
Validate the resource at the providedurl
.default IValidationResult
validate(Path path)
Validate the resource at providedpath
.static IValidationResult
validateWithJsonSchema(URI target, org.json.JSONObject schema)
Validate the target using the provided JSON schema.static IValidationResult
validateWithXmlSchema(URI target, List<Source> schemaSources)
Validate the target using the provided XML schemas.
-
-
-
Method Detail
-
validate
@NonNull default IValidationResult validate(@NonNull Path path) throws IOException
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
@NonNull IValidationResult validate(@NonNull URI uri) throws IOException
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:
JsonUtil.toJsonObject(InputStream)
,JsonUtil.toJsonObject(java.io.Reader)
-
-