Notifies all registered listeners, that a validation failed.

@param validator
The validator, which failed, as an instance of the type {@link Validator}. The
validator may not be null
438273
private void notifyOnValidationFailure(@NonNull final Validator<ValueType> validator) {
        for (ValidationListener<ValueType> listener : listeners) {
            listener.onValidationFailure(this, validator);
        }
    }
1194913
function Validator(options) {
  options = options || {};

  this.cwd = options.cwd || process.cwd();
  this.debug = !!options.debug;
}
353858
private static MessageInterpolator getMessageInterpolatorFromValidator(Validator validator) {
        
        if(!(validator instanceof ValidatorImpl)) {
            return null;
        }
        
        try {
            Field field = ValidatorImpl.class.getDeclaredField("messageInterpolator");
            field.setAccessible(true);
            
            MessageInterpolator interpolator = (MessageInterpolator)field.get(validator);
            return interpolator;
            
        } catch (IllegalAccessException | NoSuchFieldException | SecurityException e) {
            throw new IllegalStateException("fail reflect MessageInterpolrator from ValidatorImpl.", e);
        }
        
    }
897802
public synchronized boolean addPreInvalidationListener(PreInvalidationListener listener) {
        if (bEnableListener && listener != null) {
            if (eventSource.getPreInvalidationListenerCount() > 0 && tc.isDebugEnabled()) {
                Tr.debug(tc, "addPreInvalidationListener() cacheName=" + this.cacheName + " one already exists. Overwriting old listener.");
            }
            eventSource.addListener(listener);
            return true;
        }
        return false;
    }
890233
public function setValidator($validator, array $options = null) {
		if ($validator instanceof ZendValidatorInterface) {
			$this->validator = $validator;
		}
		else if (is_string($validator)) {
			$class = 'Zend_Validate_' . ucfirst($validator);
			
			if ($options === null) {
				$this->validator = new $class();
			} else {
				$this->validator = new $class($options);
			}
		}
		else {
			throw new ValidationFailure('Invalid Zend validator definition');
		}
	}
71347
def play_all_validators(self, validators, value):
        
        successes = list()
        failures = OrderedDict()
        for validator in validators:
            name = get_callable_name(validator)
            try:
                res = validator(value)
                if result_is_success(res):
                    successes.append(name)
                else:
                    failures[validator] = res

            except Exception as exc:
                failures[validator] = exc

        return successes, failures
268685
public CellField<T> add(final FieldValidator<T> validator) {
        ArgUtils.notNull(validator, "validator");
        this.validators.add(validator);

        return this;
    }
867780
protected function failedValidation(Validator $validator)
    {
        throw (new ModelValidationException($validator))
            ->errorBag($this->errorBag)
            ->redirectTo($this->getRedirectUrl());
    }
322464
private void parseValidators(BeanDefinitionBuilder builder, Element element) {
        ManagedList validators = new ManagedList();
        for (Element validator : DomUtils.getChildElementsByTagName(element, "validator")) {

            if (validator.hasAttribute("ref")) {
                validators.add(new RuntimeBeanReference(validator.getAttribute("ref")));
            } else {
                validators.add(BeanDefinitionBuilder.rootBeanDefinition(validator.getAttribute("class")).getBeanDefinition());
            }
        }

        if (!validators.isEmpty()) {
            builder.addPropertyValue("messageValidators", validators);
        }
    }
1092642
public function addValidator(Validator $validator) : ValidationCheckerInterface
    {
        $this->validated = false;
        $validator->setValidationSet($this);
        array_push($this->validators, $validator);
        return $this;
    }
1169841
public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new java.util.ArrayList<ValidationError>(validationErrors);
    }
322219
public function validate(Validator $validator = null)
    {
        if (null === $validator) {
            $validator = new Validator(new ClassMetadataFactory(new StaticMethodLoader()), new ConstraintValidatorFactory(), new DefaultTranslator());
        }

        $failureMap = new ConstraintViolationList();

        if (!$this->alreadyInValidation) {
            $this->alreadyInValidation = true;
            $retval = null;


            $retval = $validator->validate($this);
            if (count($retval) > 0) {
                $failureMap->addAll($retval);
            }

            if (null !== $this->collAttributeAttributeTypes) {
                foreach ($this->collAttributeAttributeTypes as $referrerFK) {
                    if (method_exists($referrerFK, 'validate')) {
                        if (!$referrerFK->validate($validator)) {
                            $failureMap->addAll($referrerFK->getValidationFailures());
                        }
                    }
                }
            }
            if (null !== $this->collAttributeTypeI18ns) {
                foreach ($this->collAttributeTypeI18ns as $referrerFK) {
                    if (method_exists($referrerFK, 'validate')) {
                        if (!$referrerFK->validate($validator)) {
                            $failureMap->addAll($referrerFK->getValidationFailures());
                        }
                    }
                }
            }

            $this->alreadyInValidation = false;
        }

        $this->validationFailures = $failureMap;

        return (Boolean) (!(count($this->validationFailures) > 0));

    }
801195
public Searcher registerErrorListener(@NonNull AlgoliaErrorListener errorListener) {
        if (!errorListeners.contains(errorListener)) {
            errorListeners.add(errorListener);
        }
        return this;
    }
667716
public function validate($validator)
    {
        if ($this->checkHostname($this->Value())) {
            return true;
        }

        $validator->validationError(
            $this->getName(),
            _t('DomainNameField.INVALID_DOMAIN', 'Invalid domain name'),
            'validation'
        );
        return false;
    }
39694
public function addValidator(ValidatorInterface $validator)
    {
        if ($validator instanceof tao_helpers_form_validators_NotEmpty) {
            $this->addAttribute('required', true);
        }
        $this->validators[] = $validator;
    }
788451
public function withValidator($validator): void
    {
        $user = $this->user($this->route('guard'));

        $validator->after(function ($validator) use ($user) {
            if (! $user->phone || ! $user->hasVerifiedPhone()) {
                $validator->errors()->add('phone', trans('cortex/auth::messages.account.'.(! $user->phone ? 'phone_field_required' : 'phone_verification_required')));
            }
        });
    }
633819
public function validate($validator)
    {
        if (!$this->config()->get( 'enabled')) {
            return true;
        }

        if (!$this->isCorrectAnswer($this->Value())) {
            $validator->validationError(
                $this->name,
                _t(
                    'MathSpamProtectionField.INCORRECTSOLUTION',
                    "Incorrect solution to the spam protection question, please try again."
                ),
                "error"
            );

            return false;
        }

        return true;
    }