Class ReferenceTypeValidator

    • Constructor Detail

      • ReferenceTypeValidator

        public ReferenceTypeValidator​(Map<String,​Object> schema,
                                      String reference,
                                      List<String> jsonPointer)
        Default ctor.
        Parameters:
        schema - the schema holding the reference to this validator
        reference - the reference to the pointed schema
        jsonPointer - the JSON pointer locating where this validator was defined in the schema.
    • Method Detail

      • validate

        public void validate​(Object node,
                             JsonPointer at,
                             ErrorHandler handler)
        Validates the node value against the embedded schema object.

        The selected error handler defines the behaviour of the validator. The FailFastErrorHandler throws exception at firs violation. Other customised ErrorHandler can collect all exceptions and after the validation the examination of the handler contains the final result.

        Parameters:
        node - value to validate
        at - JSONPath of the node. null means it's the root node
        handler - customised error handler like FailFastErrorHandler
      • getReference

        public String getReference()
        Returns the reference to the pointed schema.
        Returns:
        the reference to the pointed schema
      • setReferencedValidator

        public void setReferencedValidator​(Validator validator)
        Sets the validator being referenced by this object.
        Parameters:
        validator - the validator being referenced by this object