public interface JsonSchema
This is the interface you will use the most often. It is, in essence, a JsonValidator
initialized with a single JSON Schema. Note however that this
class still retains the ability to resolve JSON References.
Modifier and Type | Method and Description |
---|---|
ProcessingReport |
validate(JsonNode instance)
Validate an instance and return a processing report
|
ProcessingReport |
validate(JsonNode instance,
boolean deepCheck)
Validate an instance and return a processing report
|
ProcessingReport |
validateUnchecked(JsonNode instance)
Validate an instance and return a processing report (unchecked version)
|
ProcessingReport |
validateUnchecked(JsonNode instance,
boolean deepCheck)
Validate an instance and return a processing report (unchecked version)
|
boolean |
validInstance(JsonNode instance)
Check whether an instance is valid against this schema
|
boolean |
validInstanceUnchecked(JsonNode instance)
Check whether an instance is valid against this schema (unchecked
version)
|
ProcessingReport validate(JsonNode instance, boolean deepCheck) throws ProcessingException
instance
- the instance to validatedeepCheck
- validate children even if container (array, object) is
invalidProcessingException
- a processing error occurred during validationJsonValidator.validate(JsonNode, JsonNode, boolean)
ProcessingReport validate(JsonNode instance) throws ProcessingException
This calls validate(JsonNode, boolean)
with false
as
a second argument.
instance
- the instance to validateProcessingException
- a processing error occurred during validationProcessingReport validateUnchecked(JsonNode instance, boolean deepCheck)
Unchecked validation means that conditions which would normally cause the processing to stop with an exception are instead inserted into the resulting report.
Warning: this means that anomalous events like an unresolvable JSON Reference, or an invalid schema, are masked!
instance
- the instance to validatedeepCheck
- validate children even if container (array, object) is
invalidListProcessingReport
if an exception was
thrown during processing)ProcessingResult.uncheckedResult(Processor, ProcessingReport,
MessageProvider)
,
JsonValidator.validate(JsonNode, JsonNode, boolean)
ProcessingReport validateUnchecked(JsonNode instance)
This calls validateUnchecked(JsonNode, boolean)
with false
as a third argument.
instance
- the instance to validateListProcessingReport
if an exception was
thrown during processing)boolean validInstance(JsonNode instance) throws ProcessingException
instance
- the instanceProcessingException
- an error occurred during processingboolean validInstanceUnchecked(JsonNode instance)
The same warnings apply as described in validateUnchecked(JsonNode)
.
instance
- the instance to validate