Interface IBindingContext.ISchemaValidationProvider

Enclosing interface:
IBindingContext

Provides schema validation capabilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    dev.metaschema.core.model.validation.JsonSchemaContentValidator
    getJsonSchema(org.json.JSONObject json, IBindingContext bindingContext)
    Get a JSON schema to use for content validation.
    dev.metaschema.core.model.validation.XmlSchemaContentValidator
    getXmlSchemas(URL targetResource, IBindingContext bindingContext)
    Get a XML schema to use for content validation.
    default dev.metaschema.core.model.validation.IValidationResult
    validateWithSchema(URI target, Format asFormat, IBindingContext bindingContext)
    Validate the target resource.
  • Method Details

    • validateWithSchema

      @NonNull default dev.metaschema.core.model.validation.IValidationResult validateWithSchema(@NonNull URI target, @NonNull Format asFormat, @NonNull IBindingContext bindingContext) throws FileNotFoundException, IOException
      Validate the target resource.
      Parameters:
      target - the resource to validate
      asFormat - the format to validate the content as
      bindingContext - the Metaschema binding context used to load bound resources
      Returns:
      the validation result
      Throws:
      FileNotFoundException - if the resource was not found
      IOException - if an error occurred while reading the resource
    • getJsonSchema

      @NonNull dev.metaschema.core.model.validation.JsonSchemaContentValidator getJsonSchema(@NonNull org.json.JSONObject json, @NonNull IBindingContext bindingContext) throws IOException
      Get a JSON schema to use for content validation.
      Parameters:
      json - the JSON content to validate
      bindingContext - the Metaschema binding context used to load bound resources
      Returns:
      the JSON schema validator
      Throws:
      IOException - if an error occurred while loading the schema
      Since:
      2.0.0
    • getXmlSchemas

      @NonNull dev.metaschema.core.model.validation.XmlSchemaContentValidator getXmlSchemas(@NonNull URL targetResource, @NonNull IBindingContext bindingContext) throws IOException, SAXException
      Get a XML schema to use for content validation.
      Parameters:
      targetResource - the URL for the XML content to validate
      bindingContext - the Metaschema binding context used to load bound resources
      Returns:
      the XML schema validator
      Throws:
      IOException - if an error occurred while loading the schema
      SAXException - if an error occurred while parsing the schema
      Since:
      2.0.0