Package dev.harrel.jsonschema
Interface Evaluator
public interface Evaluator
Evaluator interface is the main abstraction for the keyword evaluation logic.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classResultclass represents evaluation outcome. -
Method Summary
Modifier and TypeMethodDescriptionevaluate(EvaluationContext ctx, JsonNode node) Evaluation logic for a specific keyword.default intgetOrder()Order ofEvaluatordetermines order of evaluators execution in scope of single schema location.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 contextnode- JSON node on which the evaluation should act upon- Returns:
- evaluation result
- See Also:
-
getOrder
default int getOrder()Order ofEvaluatordetermines order of evaluators execution in scope of single schema location. By default, evaluators are executed in order of their occurrence in JSON object. IfEvaluatoris required to be run before or after other evaluators, manipulating order value is the only way of achieving this behaviour.- Returns:
- order
-
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
-