public final class ValidationContext extends Object
This object is passed along the validation process. At any point in the validation process, it contains the current schema context, the feature set and the validator cache.
The latter is necessary since four keywords may have to spawn other
validators: type
, disallow
, dependencies
and extends
.
One instance is created for each validation and is passed around to all validators. Due to this particular usage, it is not thread safe.
Constructor and Description |
---|
ValidationContext(JsonValidatorCache cache)
Create a validation context with an empty feature set
|
Modifier and Type | Method and Description |
---|---|
FormatAttribute |
getFormat(String fmt)
Return a format attribute for a given attribute
|
JsonValidator |
newValidator(JsonNode node)
Build a new validator out of a JSON document
|
String |
toString() |
public ValidationContext(JsonValidatorCache cache)
cache
- the validator cache to usepublic FormatAttribute getFormat(String fmt)
fmt
- the format attributenull
if not foundpublic JsonValidator newValidator(JsonNode node)
This calls JsonValidatorCache.getValidator(SchemaNode)
with
this context's SchemaContainer
used as a schema context.
node
- the node (a subnode of the schema)Copyright © 2013. All Rights Reserved.