Interface IContentValidator

All Known Implementing Classes:
AbstractContentValidator, JsonSchemaContentValidator, XmlSchemaContentValidator

public interface IContentValidator
A common interface for validation of Metaschema module-based content.
  • Method Details

    • validate

      @NonNull default IValidationResult validate(@NonNull Path path) throws IOException
      Validate the resource at provided path.
      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 provided url.
      Parameters:
      url - the resource to validate
      Returns:
      the result of the validation
      Throws:
      IOException - if an error occurred while performing validation
      URISyntaxException - if there is a problem with the provided url
    • validate

      @NonNull IValidationResult validate(@NonNull URI uri) throws IOException
      Validate the resource identified by the provided uri.
      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 stream is.
      Parameters:
      is - an input stream to access the resource
      documentUri - 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 validate
      schemaSources - the XML schema sources to validate with
      Returns:
      the validation result
      Throws:
      IOException - if an error occurred while performing validation
      SAXException - 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 validate
      schema - the JSON schema to validate with
      Returns:
      the validation result
      Throws:
      IOException - if an error occurred while performing validation
      See Also: