{@inheritDoc} check if given string is a valid isbn.

@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext)
15238
@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 (valueAsString.length() != ISBN10_LENGTH) {
      // ISBN10 size is wrong, but that's handled by size annotation
      return true;
    }
    // calculate and check checksum (ISBN10)
    return CHECK_ISBN.isValidISBN10(valueAsString);
  }
733276
function isValidTextKey(oControl, sKey) {
			var mTexts = oControl.getTextsToBeHyphenated();

			if (typeof mTexts !== "object") {
				Log.error("[UI5 Hyphenation] The result of getTextsToBeHyphenated method is not a map object.", oControl.getId());
				return false;
			}

			if (Object.keys(mTexts).indexOf(sKey) < 0) {
				Log.error("[UI5 Hyphenation] The key " + sKey + " is not found in the result of getTextsToBeHyphenated method.", oControl.getId());
				return false;
			}

			return true;
		}
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);
  }
83644
public static final boolean isValid(final String value) {
        if (value == null) {
            return true;
        }
        final Locale locale;
        final int p = value.indexOf("__");
        if (p > -1) {
            locale = new Locale(value.substring(0, p), null, value.substring(p + 2));
        } else {
            final StringTokenizer tok = new StringTokenizer(value, "_");
            if (tok.countTokens() == 1) {
                locale = new Locale(value);
            } else if (tok.countTokens() == 2) {
                locale = new Locale(tok.nextToken(), tok.nextToken());
            } else if (tok.countTokens() == 3) {
                locale = new Locale(tok.nextToken(), tok.nextToken(), tok.nextToken());
            } else {
                return false;
            }
        }
        return LocaleConverter.validLocale(locale);
    }
707600
private function validateIsbn10(): bool
    {
        $value = \str_replace(['-', ' '], '', $this->value);
        if (!\preg_match($this->patterns['isbn10-basic'], $value)) {
            $this->setError(self::VALIDATOR_ERROR_ISBN_INCORRECT_FORMAT);
            return false;
        }

        $sum = 0;
        for ($i = 0; $i < 9; $i++) {
            $sum += (10 - $i) * $value{$i};
        }

        $checksum = 11 - ($sum % 11);
        if ($checksum == 11) {
            $checksum = '0';
        } elseif ($checksum == 10) {
            $checksum = 'X';
        }
        $isValid = \substr($value, -1) == $checksum ? true : false;
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_ISBN_INVALID_NUMBER);
        }
        return $isValid;
    }
54095
public static function isValidISBN10($isbn)
    {
        $isbn = self::normalizeISBN($isbn);
        if (strlen($isbn) != 10) {
            return false;
        }
        return substr($isbn, 9) == self::getISBN10CheckDigit(substr($isbn, 0, 9));
    }
456326
private boolean checkChecksumISBN13(final String isbn) {
    int sum = 0;
    for (int i = 0; i < isbn.length() - 1; i++) {
      sum += (isbn.charAt(i) - '0') * (i % 2 == 0 ? 1 : 3);
    }
    final char checkSum = isbn.charAt(12);
    return 10 - sum % 10 == checkSum - '0';
  }
894865
public static boolean checkContainsInvalidCharacter(String text, String invalidCharacters){
		if(text == null || text.trim().length() == 0 || invalidCharacters == null) return false;
		
		for (char c : invalidCharacters.toCharArray()) {
			if(text.indexOf(new String(new char[]{c})) >= 0) return true;
		}
		
		return false;
	}
888490
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString;
    if (ignoreWhitspaces) {
      valueAsString =
          Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("\\s+", StringUtils.EMPTY);
    } else {
      valueAsString = Objects.toString(pvalue, null);
    }
    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    if (valueAsString.length() != BicValidator.BIC_LENGTH_MIN
        && valueAsString.length() != BicValidator.BIC_LENGTH_MAX) {
      // to short or to long, but it's handled by size validator!
      return true;
    }
    if (!valueAsString.matches(BicValidator.BIC_REGEX)) {
      // format is wrong!
      return false;
    }
    // final BicMapConstants BIC_MAP = CreateClass.create(BicMapConstants.class);
    return BIC_MAP.bics().containsKey(valueAsString) || BIC_MAP.bics()
        .containsKey(StringUtils.substring(valueAsString, 0, BicValidator.BIC_LENGTH_MIN));
  }
386530
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    return charsetEncoder.canEncode(pvalue);
  }
756785
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    if (pvalue == null) {
      return true;
    }
    try {
      final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
      final Object field2Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field2Name);
      if ((field1Value == null
          || field1Value instanceof String && StringUtils.isEmpty((String) field1Value))
          && (field2Value == null
              || field2Value instanceof String && StringUtils.isEmpty((String) field2Value))) {
        return true;
      }
      if (Objects.equals(field1Value, field2Value)) {
        switchContext(pcontext);
        return false;
      }
      return true;
    } catch (final Exception ignore) {
      switchContext(pcontext);
      return false;
    }
  }
881805
public function isValidIsbn10(string $isbn) : bool
    {
        if ($this->cleanupBeforeValidate) {
            if (preg_match(Internal\Regexp::ASCII, $isbn) === 0) {
                return false;
            }

            $isbn = preg_replace(Internal\Regexp::NON_ALNUM, '', $isbn);
        }

        $isbn = strtoupper($isbn);

        if (preg_match(Internal\Regexp::ISBN10, $isbn) === 0) {
            return false;
        }

        if ($this->validateCheckDigit) {
            if (! Internal\CheckDigit::validateCheckDigit10($isbn)) {
                return false;
            }
        }

        return true;
    }
167099
public static function isValidISBN13($isbn)
    {
        $isbn = self::normalizeISBN($isbn);
        if (strlen($isbn) != 13) {
            return false;
        }
        return
            substr($isbn, 12) == self::getISBN13CheckDigit(substr($isbn, 0, 12));
    }
319237
@Override
	public boolean isValid(Object obj, ConstraintValidatorContext constraintContext) {
		
		// Si l'Objet est null
		if(obj == null) return acceptNullObject;
		
		// Si l'Objet est un tableau
		if(obj.getClass().isArray()) {
			
			// Taille
			int size = Array.getLength(obj);
			
			// On retourne la comparaison
			return (size >= min && size <= max);
		}
		
		// Si l'objet est une collection
		if(obj instanceof Collection<?>) {
			
			// Taille
			int size = ((Collection<?>) obj).size();
			
			// On retourne la comparaison
			return (size >= min && size <= max);
		}

		// Si l'objet est une map
		if(obj instanceof Map<?, ?>) {
			
			// Taille
			int size = ((Map<?, ?>) obj).size();
			
			// On retourne la comparaison
			return (size >= min && size <= max);
		}
		
		// Si l'Objet est une instance de Chaine
		if(obj instanceof String) {
			
			// Chaine locale
			String localString = ((String) obj);
			
			// Si on doit trimmer
			if(trimString) localString = localString.trim();
			
			// Taille
			int size = localString.length();
			
			// On retourne la comparaison
			return (size >= min && size <= max);
		}
		
		// Si c'est autre chose on retourne false
		return false;
	}
347524
@Override
	public boolean validate(final Problems problems, final String compName, final String text) {
		try {
			final double d = Double.parseDouble(text);
			if (d < 0D) {
				final String problem = ValidationBundle.getMessage(NonNegativeNumberValidator.class, "ERR_NEGATIVE_NUMBER", compName); // NOI18N
				problems.add(problem);
				return false;
			}
		} catch (final NumberFormatException e) {
			// do nothing - if someone wants not-a-number validation, they
			// should
			// chain an IntegerDocumentValidator or similar
		}
		return true;
	}
171036
@Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        try {
            this.duracloudUserService.checkUsername(value);
            return false;
        } catch (InvalidUsernameException ex) {
            return false;
        } catch (UserAlreadyExistsException ex) {
            return true;
        }
    }
1228760
public function isValid($value = null, $context = null)
    {
        if (!is_string($value)) {
            $this->error(self::INVALID);

            return false;
        }

        if (!preg_match($this->pattern, $value, $matches)) {
            $this->error(self::NO_MATCH);

            return false;
        }

        $country = $this->getCountry();

        if ($country !== null) {
            if (array_key_exists($country, $context)) {
                $country = $context[$country];
            }

            if (strcasecmp($matches[2], $country) !== 0) {
                $this->error(self::NO_MATCH);

                return false;
            }
        }

        return true;
    }