Interface IBindingContext.ISchemaValidationProvider

Enclosing interface:
IBindingContext

Provides schema validation capabilities.
  • Method Details

    • validateWithSchema

      @NonNull default 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 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 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