final class ObjectValidator extends ContainerValidator
Unlike what happens with arrays, a same child/value instance of an object may have to satisfy more than one schema. For a given property name, the list of schemas is constructed as follows:
properties,
the corresponding schema is added to the list;patternProperties, if the property name
matches the regex, the corresponding schema is added to the list;additionalProperties is added to the list (an empty schema if
additionalProperties is either true or nonexistent).| Modifier and Type | Field and Description |
|---|---|
private JsonNode |
additionalProperties |
private Map<String,JsonNode> |
patternProperties |
private Map<String,JsonNode> |
properties |
cache, EMPTY_SCHEMA, schema| Constructor and Description |
|---|
ObjectValidator(JsonValidatorCache cache,
SchemaNode schemaNode) |
| Modifier and Type | Method and Description |
|---|---|
private Set<JsonNode> |
getSchemas(String key) |
boolean |
validate(ValidationContext context,
ValidationReport report,
JsonNode instance)
Validate the instance, and tell whether validation should continue
|
private void |
validateOne(ValidationContext context,
ValidationReport report,
Map.Entry<String,JsonNode> entry) |
private final JsonNode additionalProperties
ObjectValidator(JsonValidatorCache cache, SchemaNode schemaNode)
public boolean validate(ValidationContext context, ValidationReport report, JsonNode instance)
JsonValidatorNote: the return value is currently unused.
context - the validation contextreport - the validation reportinstance - the instance to validateprivate void validateOne(ValidationContext context, ValidationReport report, Map.Entry<String,JsonNode> entry)
Copyright © 2012. All Rights Reserved.