congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CheckDigitException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
org.apache.commons.validator.routines.checkdigit.CheckDigitException

Best Java code snippets using org.apache.commons.validator.routines.checkdigit.CheckDigitException.getMessage (Showing top 5 results out of 315)

origin: commons-validator/commons-validator

/**
 * Convert an ISBN-10 code to an ISBN-13 code.
 * <p>
 * This method requires a valid ISBN-10 with NO formatting
 * characters.
 *
 * @param isbn10 The ISBN-10 code to convert
 * @return A converted ISBN-13 code or <code>null</code>
 * if the ISBN-10 code is not valid
 */
public String convertToISBN13(String isbn10) {
  if (isbn10 == null) {
    return null;
  }
  String input = isbn10.trim();
  if (input.length() != ISBN_10_LEN) {
    throw new IllegalArgumentException("Invalid length " + input.length() + " for '" + input + "'");
  }
  // Calculate the new ISBN-13 code (drop the original checkdigit)
  String isbn13 = "978" + input.substring(0, ISBN_10_LEN - 1);
  try {
    String checkDigit = isbn13Validator.getCheckDigit().calculate(isbn13);
    isbn13 += checkDigit;
    return isbn13;
  } catch (CheckDigitException e) {
    throw new IllegalArgumentException("Check digit error for '" + input + "' - " + e.getMessage());
  }
}
origin: commons-validator/commons-validator

  return ean13;
} catch (CheckDigitException e) { // Should not happen
  throw new IllegalArgumentException("Check digit error for '" + ean13 + "' - " + e.getMessage());
origin: commons-validator/commons-validator

assertTrue("Invalid Character[" +i +"]=" +  e.getMessage(), e.getMessage().startsWith("Invalid "));
origin: de.knightsoft-net/gwt-commons-validator

/**
 * Convert an ISBN-10 code to an ISBN-13 code.
 * <p>
 * This method requires a valid ISBN-10 with NO formatting
 * characters.
 *
 * @param isbn10 The ISBN-10 code to convert
 * @return A converted ISBN-13 code or <code>null</code>
 * if the ISBN-10 code is not valid
 */
public String convertToISBN13(String isbn10) {
  if (isbn10 == null) {
    return null;
  }
  String input = isbn10.trim();
  if (input.length() != ISBN_10_LEN) {
    throw new IllegalArgumentException("Invalid length " + input.length() + " for '" + input + "'");
  }
  // Calculate the new ISBN-13 code (drop the original checkdigit)
  String isbn13 = "978" + input.substring(0, ISBN_10_LEN - 1);
  try {
    String checkDigit = isbn13Validator.getCheckDigit().calculate(isbn13);
    isbn13 += checkDigit;
    return isbn13;
  } catch (CheckDigitException e) {
    throw new IllegalArgumentException("Check digit error for '" + input + "' - " + e.getMessage());
  }
}
origin: de.knightsoft-net/gwt-commons-validator

  return ean13;
} catch (CheckDigitException e) { // Should not happen
  throw new IllegalArgumentException("Check digit error for '" + ean13 + "' - " + e.getMessage());
org.apache.commons.validator.routines.checkdigitCheckDigitExceptiongetMessage

Popular methods of CheckDigitException

  • <init>
    Construct an Exception with a message and the underlying cause.

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • startActivity (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now