public abstract class BaseJsonValidator extends Object implements JsonValidator
Modifier and Type | Field and Description |
---|---|
protected SchemaValidatorsConfig |
config
SchemaValidatorsConfig can only get and set in validationContext
|
protected boolean |
failFast |
protected JsonSchema |
parentSchema |
protected com.fasterxml.jackson.databind.JsonNode |
schemaNode |
protected String |
schemaPath |
protected static ThreadLocal<ValidatorState> |
validatorState
ThreadLocal to allow to pass state in recursive validator calls
|
AT_ROOT
Constructor and Description |
---|
BaseJsonValidator(String schemaPath,
com.fasterxml.jackson.databind.JsonNode schemaNode,
JsonSchema parentSchema,
ValidatorTypeCode validatorType,
boolean suppressSubSchemaRetrieval,
boolean failFast) |
BaseJsonValidator(String schemaPath,
com.fasterxml.jackson.databind.JsonNode schemaNode,
JsonSchema parentSchema,
ValidatorTypeCode validatorType,
ValidationContext validationContext) |
Modifier and Type | Method and Description |
---|---|
protected ValidationMessage |
buildValidationMessage(String at,
String... arguments) |
protected void |
debug(org.slf4j.Logger logger,
com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at) |
protected boolean |
equals(double n1,
double n2) |
protected JsonSchema |
fetchSubSchemaNode(ValidationContext validationContext) |
protected String |
getNodeFieldType() |
JsonSchema |
getParentSchema() |
com.fasterxml.jackson.databind.JsonNode |
getSchemaNode() |
String |
getSchemaPath() |
protected ValidatorTypeCode |
getValidatorType() |
protected boolean |
greaterThan(double n1,
double n2) |
protected boolean |
lessThan(double n1,
double n2) |
protected void |
parseErrorCode(String errorCodeKey) |
Set<ValidationMessage> |
validate(com.fasterxml.jackson.databind.JsonNode node)
Validate the given root JsonNode, starting at the root of the data path.
|
Set<ValidationMessage> |
walk(com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at,
boolean shouldValidateSchema)
This is default implementation of walk method.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validate
protected String schemaPath
protected com.fasterxml.jackson.databind.JsonNode schemaNode
protected JsonSchema parentSchema
protected SchemaValidatorsConfig config
protected final boolean failFast
protected static final ThreadLocal<ValidatorState> validatorState
public BaseJsonValidator(String schemaPath, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, ValidationContext validationContext)
public BaseJsonValidator(String schemaPath, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, ValidatorTypeCode validatorType, boolean suppressSubSchemaRetrieval, boolean failFast)
public String getSchemaPath()
public com.fasterxml.jackson.databind.JsonNode getSchemaNode()
public JsonSchema getParentSchema()
protected JsonSchema fetchSubSchemaNode(ValidationContext validationContext)
public Set<ValidationMessage> validate(com.fasterxml.jackson.databind.JsonNode node)
JsonValidator
validate
in interface JsonValidator
node
- JsonNodeprotected boolean equals(double n1, double n2)
protected boolean greaterThan(double n1, double n2)
protected boolean lessThan(double n1, double n2)
protected void parseErrorCode(String errorCodeKey)
protected ValidationMessage buildValidationMessage(String at, String... arguments)
protected void debug(org.slf4j.Logger logger, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, String at)
protected ValidatorTypeCode getValidatorType()
protected String getNodeFieldType()
public Set<ValidationMessage> walk(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, String at, boolean shouldValidateSchema)
walk
in interface JsonSchemaWalker
node
- JsonNoderootNode
- JsonNodeat
- StringshouldValidateSchema
- booleanCopyright © 2020. All rights reserved.