Package com.networknt.schema
Interface Validator
-
- All Superinterfaces:
Walker
- All Known Subinterfaces:
KeywordValidator
- All Known Implementing Classes:
AbstractKeywordValidator,AdditionalPropertiesValidator,AllOfValidator,AnyOfValidator,BaseFormatValidator,BaseKeywordValidator,ConstValidator,ContainsValidator,ContentEncodingValidator,ContentMediaTypeValidator,DependenciesValidator,DependentRequired,DependentSchemas,DiscriminatorValidator,DynamicRefValidator,EnumValidator,ExclusiveMaximumValidator,ExclusiveMinimumValidator,FalseValidator,FormatValidator,IfValidator,ItemsLegacyValidator,ItemsValidator,MaximumValidator,MaxItemsValidator,MaxLengthValidator,MaxPropertiesValidator,MinimumValidator,MinItemsValidator,MinLengthValidator,MinMaxContainsValidator,MinPropertiesValidator,MultipleOfValidator,NotAllowedValidator,NotValidator,OneOfValidator,PatternPropertiesValidator,PatternValidator,PrefixItemsValidator,PropertiesValidator,PropertyDependenciesValidator,PropertyNamesValidator,ReadOnlyValidator,RecursiveRefValidator,RefValidator,RequiredValidator,Schema,TrueValidator,TypeValidator,UnevaluatedItemsValidator,UnevaluatedPropertiesValidator,UnionTypeValidator,UniqueItemsValidator,WriteOnlyValidator
public interface Validator extends Walker
A processor that checks an instance node belonging to an instance document against a schema.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SchemaLocationgetSchemaLocation()The schema location is the canonical URI of the schema object plus a JSON Pointer fragment indicating the subschema that produced a result.voidvalidate(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode instanceNode, com.fasterxml.jackson.databind.JsonNode instance, NodePath instanceLocation)Validate the instance node which belongs to the instance document at the instance location.default voidwalk(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode instanceNode, com.fasterxml.jackson.databind.JsonNode instance, NodePath instanceLocation, boolean shouldValidateSchema)This is default implementation of walk method.
-
-
-
Method Detail
-
validate
void validate(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode instanceNode, com.fasterxml.jackson.databind.JsonNode instance, NodePath instanceLocation)
Validate the instance node which belongs to the instance document at the instance location.- Parameters:
executionContext- the execution contextinstanceNode- the instance node being processedinstance- the instance document that the instance node belongs toinstanceLocation- the location of the instance node being processed
-
walk
default void walk(ExecutionContext executionContext, com.fasterxml.jackson.databind.JsonNode instanceNode, com.fasterxml.jackson.databind.JsonNode instance, NodePath instanceLocation, boolean shouldValidateSchema)
This is default implementation of walk method. Its job is to call the validate method if shouldValidateSchema is enabled.- Specified by:
walkin interfaceWalker- Parameters:
executionContext- the execution contextinstanceNode- the instance node being processedinstance- the instance document that the instance node belongs toinstanceLocation- the location of the instance node being processedshouldValidateSchema- true to validate the schema while walking
-
getSchemaLocation
SchemaLocation getSchemaLocation()
The schema location is the canonical URI of the schema object plus a JSON Pointer fragment indicating the subschema that produced a result. In contrast with the evaluation path, the schema location MUST NOT include by-reference applicators such as $ref or $dynamicRef.- Returns:
- the schema location
-
-