code: @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;
    }
docs: {@inheritDoc} check if given string is a valid isbn.
  
  @see javax.validation.ConstraintValidator#isValid(java.lang.Object,
  javax.validation.ConstraintValidatorContext)