{@inheritDoc} check if given object is valid.

@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext)
513782
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    return StringUtils.isEmpty(valueAsString)
        || countCriteriaMatches(valueAsString) >= minRules && !isBlacklist(pcontext, valueAsString)
            && !startsWithDisalowedCharacter(pcontext, valueAsString)
            && !maxRepeatCharacterExceded(pcontext, valueAsString);
  }
1324080
public boolean isValid(final CharSequence value, final ConstraintValidatorContext context) {
    if (value == null) {
      return true;
    }

    final String valueAsString = value.toString();
    String digitsAsString;
    char checkDigit;
    try {
      digitsAsString = this.extractVerificationString(valueAsString);
      checkDigit = this.extractCheckDigit(valueAsString);
    } catch (final IndexOutOfBoundsException e) {
      return false;
    }
    digitsAsString = this.stripNonDigitsIfRequired(digitsAsString);

    List<Integer> digits;
    try {
      digits = this.extractDigits(digitsAsString);
    } catch (final NumberFormatException e) {
      return false;
    }

    return this.isCheckDigitValid(digits, checkDigit);
  }
873366
public void validate(FacesContext context,
                         UIComponent  component,
                         Object       value) throws ValidatorException {
	if (null == context || null == component) {
	    throw new NullPointerException();
	}
        try {
            methodBinding.invoke(context, new Object[] {context, component, 
							value});
        } 
	catch (EvaluationException ee) {
	    Throwable cause = this.getExpectedCause(ValidatorException.class,
						    ee);
	    if (cause instanceof ValidatorException) {
		throw ((ValidatorException) cause);
	    }
	    if (cause instanceof RuntimeException) {
		throw ((RuntimeException) cause);
	    }
	    throw new IllegalStateException(ee);
        }
	
	
    }
829067
public <A extends Annotation, V> ConstraintValidatorContextImpl<A, V> //
      createConstraintValidatorContext(final ConstraintDescriptor<A> descriptor) {
    return new ConstraintValidatorContextImpl<>(PathImpl.createCopy(this.path), descriptor);
  }
591461
@Override
    public boolean isValid(SpaceForm spaceForm,
                           ConstraintValidatorContext context) {
        try {
            // Test validity by attempting to delete a file that does not exist
            ContentStore contentStore =
                contentStoreFactory.create(spaceForm.getCredentialsForm(), false);
            String spaceId = spaceForm.getSpaceId();
            String contentId =
                ".duracloud-dummy-item-" + System.currentTimeMillis();
            contentStore.deleteContent(spaceId, contentId);
            return true;
        } catch (UnauthorizedException e) {
            log.error(e.getMessage(), e);
            context.disableDefaultConstraintViolation();
            context.buildConstraintViolationWithTemplate(constraintAnnotation.message())
                   .addNode("spaceId")
                   .addConstraintViolation();
            return false;
        } catch (NotFoundException ex) {
            return true;
        } catch (Exception ex) {
            throw new RuntimeException("unexpected exception!:" + ex.getMessage(), ex);
        }
    }
321928
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString;
    if (ignoreSeparators) {
      valueAsString =
          Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("-", StringUtils.EMPTY);
    } else {
      valueAsString = Objects.toString(pvalue, null);
    }
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (!StringUtils.isNumeric(valueAsString)) {
      return false;
    }
    if (valueAsString.length() == Isbn10Validator.ISBN10_LENGTH) {
      // we do have 10 digits, lets test the checksum
      return CHECK_ISBN10.isValid(valueAsString);
    }
    if (valueAsString.length() == Isbn13Validator.ISBN13_LENGTH) {
      // we do have 13 digits, lets test the checksum
      return CHECK_ISBN13.isValid(valueAsString);
    }
    // other sizes are wrong, but this is reported by AlternateSize
    return true;
  }
549402
public void checkValidity() throws ACMValidationException {
                if (context == null) {
                        throw new ACMValidationException("Invalid state of AC model: No context assigned");
                }
                if (!getContext().containsActivities()) {
                        return;
                }
                for (String activity : getContext().getActivities()) {
                        try {
                                if (!isExecutable(activity)) {
                                        throw new ACMValidationException("Model contains non-executable transactions: " + activity);
                                }
                        } catch (CompatibilityException e) {
                                throw new ACMValidationException("Error during validation check: " + e.getMessage());
                        }
                }
        }
639706
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    if (pvalue == null) {
      return true;
    }
    try {
      String valueCountry =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCountryCode);
      final String valueIban =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldIban);
      final String valueBic =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldBic);
      final String bicOfIban = IbanUtil.getBicOfIban(valueIban);

      if (StringUtils.isEmpty(valueIban) && StringUtils.isEmpty(valueBic)) {
        return true;
      } else if (StringUtils.isEmpty(valueIban)) {
        pcontext.disableDefaultConstraintViolation();
        pcontext.buildConstraintViolationWithTemplate(NOT_EMPTY_MESSAGE)
            .addPropertyNode(this.fieldIban).addConstraintViolation();
        return false;
      } else if (StringUtils.isEmpty(valueBic)) {
        pcontext.disableDefaultConstraintViolation();
        pcontext.buildConstraintViolationWithTemplate(NOT_EMPTY_MESSAGE)
            .addPropertyNode(this.fieldBic).addConstraintViolation();
        return false;
      } else if (StringUtils.length(valueIban) >= IbanValidator.IBAN_LENGTH_MIN
          && StringUtils.length(valueBic) >= BicValidator.BIC_LENGTH_MIN) {
        String countryIban = valueIban.replaceAll("\\s+", StringUtils.EMPTY).substring(0, 2);
        String countryBic = valueBic.replaceAll("\\s+", StringUtils.EMPTY).substring(4, 6);
        if (StringUtils.length(valueCountry) != 2) {
          // missing country selection, us country of iban
          valueCountry = countryIban;
        }

        if (this.allowLowerCaseCountryCode) {
          valueCountry = StringUtils.upperCase(valueCountry);
          countryIban = StringUtils.upperCase(countryIban);
          countryBic = StringUtils.upperCase(countryIban);
        }

        boolean ibanCodeMatches = false;
        boolean bicCodeMatches = false;
        final boolean bicIbanMatches = bicOfIban == null || StringUtils.equals(bicOfIban, valueBic);
        switch (valueCountry) {
          case "GF": // French Guyana
          case "GP": // Guadeloupe
          case "MQ": // Martinique
          case "RE": // Reunion
          case "PF": // French Polynesia
          case "TF": // French Southern Territories
          case "YT": // Mayotte
          case "NC": // New Caledonia
          case "BL": // Saint Barthelemy
          case "MF": // Saint Martin
          case "PM": // Saint Pierre et Miquelon
          case "WF": // Wallis and Futuna Islands
            // special solution for French oversea teritorials with french registry
            ibanCodeMatches = "FR".equals(countryIban);
            bicCodeMatches = "FR".equals(countryBic);
            break;
          case "JE": // Jersey
          case "GG": // Guernsey
            // they can use GB or FR registry, but iban and bic code must match
            ibanCodeMatches = ("GB".equals(countryIban) || "FR".equals(countryIban))
                && countryBic.equals(countryIban);
            bicCodeMatches = "GB".equals(countryBic) || "FR".equals(countryBic);
            break;
          default:
            ibanCodeMatches = valueCountry.equals(countryIban);
            bicCodeMatches = valueCountry.equals(countryBic);
            break;
        }
        if (ibanCodeMatches && bicCodeMatches && bicIbanMatches) {
          return true;
        }
        pcontext.disableDefaultConstraintViolation();
        if (!ibanCodeMatches) {
          pcontext.buildConstraintViolationWithTemplate(this.message)
              .addPropertyNode(this.fieldIban).addConstraintViolation();
        }
        if (!bicCodeMatches) {
          pcontext.buildConstraintViolationWithTemplate(this.message).addPropertyNode(this.fieldBic)
              .addConstraintViolation();
        }
        if (!bicIbanMatches) {
          pcontext.buildConstraintViolationWithTemplate(this.messageWrongBic)
              .addPropertyNode(this.fieldBic).addConstraintViolation();
        }
        return false;
      } else {
        // wrong format, should be handled by other validators
        return true;
      }
    } catch (final Exception ignore) {
      return false;
    }
  }
1326957
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      return true;
    }
    if (!StringUtils.isNumeric(valueAsString)) {
      // EAN must be numeric, but that's handled by digits annotation
      return true;
    }
    if (valueAsString.length() != Gtin8Validator.GTIN8_LENGTH
        && valueAsString.length() != Gtin13Validator.GTIN13_LENGTH) {
      // EAN size is wrong, but that's handled by alternate size annotation
      return true;
    }
    // calculate and check checksum (GTIN/EAN)
    return CHECK_GTIN.isValid(valueAsString);
  }
1097371
protected void validateModelClass(Object model) {
        final Set<ConstraintViolation<Object>> violations = validator.validate(model);

        // in case of an invalid model, we throw a ConstraintViolationException, containing the violations:
        if (!violations.isEmpty()) {
            throw new ConstraintViolationException(
                    new HashSet<>(violations));
        }
    }
1321708
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    if (valueAsString.length() < IBAN_LENGTH_MIN || valueAsString.length() > IBAN_LENGTH_MAX) {
      // to short or to long, but it's handled by size validator!
      return true;
    }
    final String countryCode = valueAsString.substring(0, 2);
    final IbanLengthDefinition validIbanLength = IBAN_LENGTH_MAP.ibanLengths().get(countryCode);
    if (validIbanLength == null || valueAsString.replaceAll("\\s", StringUtils.EMPTY)
        .length() != validIbanLength.getLength()) {
      // unknown country or wrong length for the country!
      return false;
    }
    if (!valueAsString.matches("^[A-Z]{2}[0-9A-Z]{2} ([0-9A-Z]{4}[ ])+[0-9A-Z]{1,4}$")) {
      // wrong format
      return false;
    }

    return CHECK_IBAN.isValid(IbanUtil.ibanCompress(valueAsString));
  }
1045809
public function isValid($value, $context = null)
    {
        if (! $this->useContext) {
            $context = (array) $value;
        }

        $cleanedValue = $this->cleanSearchValue($value);
        $match        = $this->objectRepository->findOneBy($cleanedValue);

        if (! is_object($match)) {
            return true;
        }

        $expectedIdentifiers = $this->getExpectedIdentifiers($context);
        $foundIdentifiers    = $this->getFoundIdentifiers($match);

        if (count(array_diff_assoc($expectedIdentifiers, $foundIdentifiers)) == 0) {
            return true;
        }

        $this->error(self::ERROR_OBJECT_NOT_UNIQUE, $value);
        return false;
    }
656018
public function isValid($value, $context = null)
    {
        $this->_getValidators();
        $this->messages = array();
        $result         = false;
        foreach ($this->validators as $element) {
            /** @var $validator ValidatorInterface */
            $validator = $element['instance'];
            if (!$validator->isValid($value, $context)) {
                $messages       = $validator->getMessages();
                $this->messages = array_replace_recursive($this->messages, $messages);
                continue;
            }
            $result         = true;
        }
        return $result;
    }
431429
public void validate(final Object record, final CsvBindingErrors bindingErrors, 
            final ValidationContext<Object> validationContext, final Class<?>... groups) {
        Objects.requireNonNull(record);
        Objects.requireNonNull(bindingErrors);
        Objects.requireNonNull(validationContext);
        
        processConstraintViolation(getTargetValidator().validate(record, groups), bindingErrors, validationContext);
    }
966745
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    if (pvalue.length() > LENGTH_MAIL) {
      // Email is to long, but that's handled by size annotation
      return true;
    }
    if (!StringUtils.equals(pvalue, StringUtils.trim(pvalue))) {
      // mail contains leading or trailing space(s), that's not correct
      return false;
    }
    return org.apache.commons.validator.routines.EmailValidator.getInstance().isValid(pvalue);
  }
1210039
public boolean isValid() {

        boolean valid = true;
        for (Component comp : this) {
            if (comp instanceof TextField) {
                valid = valid && ((TextField)comp).isValid();
            }
        }
        return valid;
    }
819923
@Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        List<String> emailAddresses = EmailAddressesParser.parse(value);
        List<String> badAddresses = null;
        for (String ea : emailAddresses) {
            if (!EMAIL_VALIDATOR.isValid(ea, null)) {
                if (badAddresses == null) {
                    badAddresses = new LinkedList<String>();
                }

                badAddresses.add(ea);
            }
        }

        if (badAddresses != null) {
            context.disableDefaultConstraintViolation();
            context.buildConstraintViolationWithTemplate(MessageFormat.format(constraintAnnotation.message(),
                                                                              StringUtils.join(badAddresses, ", ")))
                   .addConstraintViolation();
        }
        return (badAddresses == null);
    }