public final class ArrayJsonValidator extends Object implements JsonValidator
Array chidren must obey one schema, depending on the values of
items and additionalItems. No items is equivalent
to an empty array.
Array indices start at 0. For a given index:
items, there is a
match;additionalItems is considered (if true or
nonexistent, then an empty schema).| Modifier and Type | Field and Description |
|---|---|
private JsonNode |
additionalItems |
private static JsonNode |
EMPTY_SCHEMA |
private JsonSchemaFactory |
factory |
private List<JsonNode> |
items |
| Constructor and Description |
|---|
ArrayJsonValidator(JsonSchemaFactory factory,
SchemaNode schemaNode) |
| Modifier and Type | Method and Description |
|---|---|
private SchemaNode |
getSchemaNode(SchemaContainer container,
int index) |
JsonValidator |
next()
Return the next validator in the chain
|
boolean |
validate(ValidationContext context,
ValidationReport report,
JsonNode instance)
Validate the instance, and tell whether validation should continue
|
private static final JsonNode EMPTY_SCHEMA
private final JsonSchemaFactory factory
private JsonNode additionalItems
ArrayJsonValidator(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 SchemaNode getSchemaNode(SchemaContainer container, int index)
Copyright © 2012. All Rights Reserved.