|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.fge.jsonschema.main.JsonSchema
@Immutable public final class JsonSchema
Single-schema instance validator
This is the class 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.
It has no public constructors: you should use the appropriate methods in
JsonSchemaFactory
to obtain an instance of this class.
Method Summary | |
---|---|
com.github.fge.jsonschema.core.report.ProcessingReport |
validate(JsonNode instance)
Validate an instance and return a processing report |
com.github.fge.jsonschema.core.report.ProcessingReport |
validate(JsonNode instance,
boolean deepCheck)
Validate an instance and return a processing report |
com.github.fge.jsonschema.core.report.ProcessingReport |
validateUnchecked(JsonNode instance)
Validate an instance and return a processing report (unchecked version) |
com.github.fge.jsonschema.core.report.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) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public com.github.fge.jsonschema.core.report.ProcessingReport validate(JsonNode instance, boolean deepCheck) throws com.github.fge.jsonschema.core.exceptions.ProcessingException
instance
- the instance to validatedeepCheck
- validate children even if container (array, object) is
invalid
com.github.fge.jsonschema.core.exceptions.ProcessingException
- a processing error occurred during validationJsonValidator.validate(JsonNode, JsonNode, boolean)
public com.github.fge.jsonschema.core.report.ProcessingReport validate(JsonNode instance) throws com.github.fge.jsonschema.core.exceptions.ProcessingException
This calls validate(JsonNode, boolean)
with false
as
a third argument.
instance
- the instance to validate
com.github.fge.jsonschema.core.exceptions.ProcessingException
- a processing error occurred during validationpublic com.github.fge.jsonschema.core.report.ProcessingReport 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
invalid
ListProcessingReport
if an exception was
thrown during processing)ProcessingResult.uncheckedResult(Processor, ProcessingReport,
MessageProvider)
,
JsonValidator.validate(JsonNode, JsonNode, boolean)
public com.github.fge.jsonschema.core.report.ProcessingReport validateUnchecked(JsonNode instance)
This calls validateUnchecked(JsonNode, boolean)
with false
as a third argument.
instance
- the instance to validate
ListProcessingReport
if an exception was
thrown during processing)public boolean validInstance(JsonNode instance) throws com.github.fge.jsonschema.core.exceptions.ProcessingException
instance
- the instance
com.github.fge.jsonschema.core.exceptions.ProcessingException
- an error occurred during processingpublic boolean validInstanceUnchecked(JsonNode instance)
The same warnings apply as described in validateUnchecked(JsonNode)
.
instance
- the instance to validate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |