Class IsoIecPure97System
java.lang.Object
org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
org.apache.commons.validator.routines.checkdigit.IsoIec7064PureSystem
org.apache.commons.validator.routines.checkdigit.IsoIecPure97System
- All Implemented Interfaces:
Serializable,CheckDigit,IsoIecConstants
- Direct Known Subclasses:
VATidBECheckDigit
Implements ISO/IEC 7064, MOD 97-10 check digit calculation/validation.
MOD 97-10 applies to numeric strings, the check digit is numeric. See Wikipedia - ISO/IEC_7064 (de) for more details.
- Since:
- 1.10.0
- Author:
- EUG https://github.com/homebeaver
- See Also:
-
Field Summary
Fields inherited from interface org.apache.commons.validator.routines.checkdigit.IsoIecConstants
ALPHABETIC, ALPHANUMERIC, ALPHANUMERIC_PLUS_STAR, MODULUS_1271, MODULUS_37, MODULUS_661, MODULUS_97, NUMERIC, NUMERIC_PLUS_X, RADIX_10, RADIX_2, RADIX_26, RADIX_36 -
Method Summary
Modifier and TypeMethodDescriptionCalculate a modulus Check Digit for a code which does not yet have one.protected StringMOD 11-2 check characters are “0” to “9” plus “X” for example.static CheckDigitGets the singleton instance of this validator.protected intgetRadix()Radix is the second number following “MOD” in the ISO/IEC designation, f.i. 2 for "MOD 11-2"Methods inherited from class org.apache.commons.validator.routines.checkdigit.IsoIec7064PureSystem
calculateModulus, getCheckdigitLength, isValid, toCheckDigit, toInt, weightedValueMethods inherited from class org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
getModulus, sumDigits
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the class.
-
getRadix
protected int getRadix()Description copied from class:IsoIec7064PureSystemRadix is the second number following “MOD” in the ISO/IEC designation, f.i. 2 for "MOD 11-2"- Specified by:
getRadixin classIsoIec7064PureSystem- Returns:
- the radix of the Check Digit routine
-
calculate
Calculate a modulus Check Digit for a code which does not yet have one.Overrides with simplified procedure described in ISO/IEC 7064:2003(E).
- Specified by:
calculatein interfaceCheckDigit- Overrides:
calculatein classIsoIec7064PureSystem- Parameters:
code- The code for which to calculate the Check Digit; the check digit should not be included- Returns:
- The calculated Check Digit
- Throws:
CheckDigitException- if an error occurs calculating the check digit
-
getCharacterSet
Description copied from class:IsoIec7064PureSystemMOD 11-2 check characters are “0” to “9” plus “X” for example.- Specified by:
getCharacterSetin classIsoIec7064PureSystem- Returns:
- a String containing characters the check digit is build from.
This can be
IsoIecConstants.NUMERIC,IsoIecConstants.ALPHABETIC,IsoIecConstants.ALPHANUMERIC,IsoIecConstants.NUMERIC_PLUS_X,IsoIecConstants.ALPHANUMERIC_PLUS_STAR
-