public class TypeValidator extends BaseJsonValidator implements JsonValidator
config, failFast, validatorState
AT_ROOT
Constructor and Description |
---|
TypeValidator(String schemaPath,
com.fasterxml.jackson.databind.JsonNode schemaNode,
JsonSchema parentSchema,
ValidationContext validationContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
equalsToSchemaType(com.fasterxml.jackson.databind.JsonNode node) |
JsonType |
getSchemaType() |
static boolean |
isBoolean(String s) |
static boolean |
isInteger(String str) |
static boolean |
isNumber(com.fasterxml.jackson.databind.JsonNode node,
boolean isTypeLoose)
Check if the type of the JsonNode's value is number based on the
status of typeLoose flag.
|
static boolean |
isNumeric(String str) |
Set<ValidationMessage> |
validate(com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at)
Validate the given JsonNode, the given node is the child node of the root node at given
data path.
|
buildValidationMessage, debug, equals, fetchSubSchemaNode, getNodeFieldType, getParentSchema, getSchemaNode, getSchemaPath, getValidatorType, greaterThan, lessThan, parseErrorCode, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validate
public TypeValidator(String schemaPath, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, ValidationContext validationContext)
public JsonType getSchemaType()
public boolean equalsToSchemaType(com.fasterxml.jackson.databind.JsonNode node)
public Set<ValidationMessage> validate(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, String at)
JsonValidator
validate
in interface JsonValidator
node
- JsonNoderootNode
- JsonNodeat
- Stringpublic static boolean isInteger(String str)
public static boolean isBoolean(String s)
public static boolean isNumeric(String str)
public static boolean isNumber(com.fasterxml.jackson.databind.JsonNode node, boolean isTypeLoose)
node
- the JsonNode to checkisTypeLoose
- The flag to show whether typeLoose is enabledCopyright © 2020. All rights reserved.