Interface Evaluator


public interface Evaluator
Evaluator interface is the main abstraction for the keyword evaluation logic.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Result class represents evaluation outcome.
  • Method Summary

    Modifier and Type
    Method
    Description
    Evaluation logic for a specific keyword.
    default int
    Order of Evaluator determines order of evaluators execution in scope of single schema location.
    default Set<String>
    If evaluator is considered to belong to some specific vocabularies, then it should return their URIs.
  • Method Details

    • evaluate

      Evaluation logic for a specific keyword. Must not throw any exceptions, any possible evaluation failures should be reflected by returned object.
      Parameters:
      ctx - current evaluation context
      node - JSON node on which the evaluation should act upon
      Returns:
      evaluation result
      See Also:
    • getOrder

      default int getOrder()
      Order of Evaluator determines order of evaluators execution in scope of single schema location. By default, evaluators are executed in order of their occurrence in JSON object. If Evaluator is required to be run before or after other evaluators, manipulating order value is the only way of achieving this behaviour.
      Returns:
      order
    • getVocabularies

      default Set<String> getVocabularies()
      If evaluator is considered to belong to some specific vocabularies, then it should return their URIs. By default, this method returns an empty set, which means it belongs to no vocabulary, and it will always be taken into consideration when validating against a schema. At least one of returned vocabulary URIs have to be "active" for evaluator to be run.
      Returns:
      set of vocabulary URIs