Class AbstractKeywordValidator

    • Field Detail

      • schemaNode

        protected final com.fasterxml.jackson.databind.JsonNode schemaNode
    • Constructor Detail

      • AbstractKeywordValidator

        public AbstractKeywordValidator​(String keyword,
                                        com.fasterxml.jackson.databind.JsonNode schemaNode,
                                        SchemaLocation schemaLocation)
        Constructor.
        Parameters:
        keyword - the keyword
        schemaNode - the schema node
        schemaLocation - the schema location
      • AbstractKeywordValidator

        public AbstractKeywordValidator​(Keyword keyword,
                                        com.fasterxml.jackson.databind.JsonNode schemaNode,
                                        SchemaLocation schemaLocation)
        Constructor.
        Parameters:
        keyword - the keyword
        schemaNode - the schema node
        schemaLocation - the schema location
    • Method Detail

      • getSchemaLocation

        public SchemaLocation getSchemaLocation()
        Description copied from interface: Validator
        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.
        Specified by:
        getSchemaLocation in interface Validator
        Returns:
        the schema location
      • getSchemaNode

        public com.fasterxml.jackson.databind.JsonNode getSchemaNode()
        The schema node used to create the validator.
        Returns:
        the schema node
      • collectAnnotations

        protected boolean collectAnnotations​(ExecutionContext executionContext)
        Determine if annotations should be reported.
        Parameters:
        executionContext - the execution context
        Returns:
        true if annotations should be reported
      • collectAnnotations

        protected boolean collectAnnotations​(ExecutionContext executionContext,
                                             String keyword)
        Determine if annotations should be reported.
        Parameters:
        executionContext - the execution context
        keyword - the keyword
        Returns:
        true if annotations should be reported
      • putAnnotation

        protected void putAnnotation​(ExecutionContext executionContext,
                                     Consumer<Annotation.Builder> customizer)
        Puts an annotation.
        Parameters:
        executionContext - the execution context
        customizer - to customize the annotation
      • hasAdjacentKeywordInEvaluationPath

        protected boolean hasAdjacentKeywordInEvaluationPath​(ExecutionContext executionContext,
                                                             String keyword)
        Determines if the keyword exists adjacent in the evaluation path.

        This does not check if the keyword exists in the current meta schema as this can be a cross-draft case where the properties keyword is in a Draft 7 schema and the unevaluatedProperties keyword is in an outer Draft 2020-12 schema.

        The fact that the validator exists in the evaluation path implies that the keyword was valid in whatever meta schema for that schema it was created for.

        Parameters:
        keyword - the keyword to check
        Returns:
        true if found
      • hasUnevaluatedItemsInEvaluationPath

        protected boolean hasUnevaluatedItemsInEvaluationPath​(ExecutionContext executionContext)
      • hasUnevaluatedPropertiesInEvaluationPath

        protected boolean hasUnevaluatedPropertiesInEvaluationPath​(ExecutionContext executionContext)