Package com.clumd.projects.javajson.api
Interface JsonSchemaEnforceable
- All Known Implementing Classes:
JsonSchemaEnforcer
public interface JsonSchemaEnforceable
Used to define all the methods required to verify that a given JSON object satisfies a given JSON Schema.
-
Method Summary
Modifier and Type Method Description default booleanvalidateWithOutReasoning(Json objectToValidate, Json againstSchema)Validate but never throw exceptionsbooleanvalidateWithReasoning(Json objectToValidate, Json againstSchema)Validate with the potential to throw exceptions to the caller.
-
Method Details
-
validateWithOutReasoning
Validate but never throw exceptions- Parameters:
objectToValidate- The JSON Object to be validated.againstSchema- The Schema JSON Object which defines the object to be validated.- Returns:
- True if the object passes validation, False if it fails for any reason.
-
validateWithReasoning
Validate with the potential to throw exceptions to the caller.- Parameters:
objectToValidate- The JSON Object to be validated.againstSchema- The Schema JSON Object which defines the object to be validated.- Returns:
- True if the object passes validation, False if it fails for any reason.
- Throws:
SchemaException- Thrown to give reason/context as to why an object failed validation.
-