public final class RefResolverJsonValidator extends Object implements JsonValidator
This validator is in charge of resolving JSON References. In most cases, it will not do anything since most schemas are not JSON References.
This is also the class which detects ref loops.
Its next() method always returns a SyntaxJsonValidator.
| Modifier and Type | Field and Description |
|---|---|
private JsonSchemaFactory |
factory
The schema factory
|
private SchemaNode |
schemaNode
The schema node
|
| Constructor and Description |
|---|
RefResolverJsonValidator(JsonSchemaFactory factory,
SchemaNode schemaNode) |
| Modifier and Type | Method and Description |
|---|---|
JsonValidator |
next()
Return the next validator in the chain
|
private JsonNode |
resolve(ValidationContext context,
JsonNode node)
Resolve references
|
boolean |
validate(ValidationContext context,
ValidationReport report,
JsonNode instance)
Validate the instance, and tell whether validation should continue
|
private final JsonSchemaFactory factory
private SchemaNode schemaNode
public RefResolverJsonValidator(JsonSchemaFactory factory, SchemaNode schemaNode)
public boolean validate(ValidationContext context, ValidationReport report, JsonNode instance)
JsonValidatorvalidate in interface JsonValidatorcontext - the validation contextreport - the validation reportinstance - the instance to validatepublic JsonValidator next()
JsonValidatorThis will be called iif
JsonValidator.validate(ValidationContext, ValidationReport, JsonNode)
returns true.
next in interface JsonValidatorprivate JsonNode resolve(ValidationContext context, JsonNode node) throws JsonSchemaException
context - the validation contextnode - the schema nodeJsonSchemaException - invalid reference, loop detected, or could
not get contentCopyright © 2012. All Rights Reserved.