Interface Evaluator


  • public interface Evaluator
    An evaluator interface for applying a JSON schema to a JSON instance.

    Note that this type is not intended to be used directly by end users.

    Author:
    leadpony
    • Field Detail

      • ALWAYS_TRUE

        static final Evaluator ALWAYS_TRUE
        The evaluator which evaluates anything as true.
    • Method Detail

      • evaluate

        Evaluator.Result evaluate​(JsonParser.Event event,
                                  int depth,
                                  ProblemDispatcher dispatcher)
        Evaluates a JSON schema against each instance location to which it applies.
        Parameters:
        event - the event triggered by the JSON parser, cannot be null.
        depth - the depth where the event occurred.
        dispatcher - the dispatcher of the found problems, cannot be null.
        Returns:
        the result of the evaluation, one defined in Evaluator.Result. This cannot be null.
      • isAlwaysFalse

        default boolean isAlwaysFalse()
        Checks whether this evaluator evaluates anything as false or not. This method returns false by default.
        Returns:
        true if this evaluator is always false, otherwise false.