Interface IBindingContext.ISchemaValidationProvider
- Enclosing interface:
- IBindingContext
public static interface IBindingContext.ISchemaValidationProvider
Provides schema validation capabilities.
-
Method Summary
Modifier and TypeMethodDescriptiongetJsonSchema(org.json.JSONObject json, IBindingContext bindingContext) Get a JSON schema to use for content validation.getXmlSchemas(URL targetResource, IBindingContext bindingContext) Get a XML schema to use for content validation.default IValidationResultvalidateWithSchema(URI target, Format asFormat, IBindingContext bindingContext) Validate the target resource.
-
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 validateasFormat- the format to validate the content asbindingContext- the Metaschema binding context used to load bound resources- Returns:
- the validation result
- Throws:
FileNotFoundException- if the resource was not foundIOException- 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 validatebindingContext- 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 validatebindingContext- the Metaschema binding context used to load bound resources- Returns:
- the XML schema validator
- Throws:
IOException- if an error occurred while loading the schemaSAXException- if an error occurred while parsing the schema- Since:
- 2.0.0
-