Class VATidFICheckDigit
java.lang.Object
org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
org.apache.commons.validator.routines.checkdigit.IsoIec7064PureSystem
org.apache.commons.validator.routines.checkdigit.IsoIecPure11System
org.apache.commons.validator.routines.checkdigit.VATidFICheckDigit
- All Implemented Interfaces:
Serializable
,CheckDigit
,IsoIecConstants
Finnish VAT identification number (VATIN) Check Digit calculation/validation.
Arvonlisâverorekisterointi-numero (ALV-NRO)
See calculating checkdigits (fi) for more details.
- Since:
- 1.10.0
- 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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculate a modulus Check Digit for a code which does not yet have one.protected String
MOD 11-2 check characters are “0” to “9” plus “X” for example.static CheckDigit
Gets the singleton instance of this validator.boolean
Validate a modulus check digit for a code.Methods inherited from class org.apache.commons.validator.routines.checkdigit.IsoIecPure11System
getRadix, toInt
Methods inherited from class org.apache.commons.validator.routines.checkdigit.IsoIec7064PureSystem
calculateModulus, getCheckdigitLength, toCheckDigit, weightedValue
Methods inherited from class org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
getModulus, sumDigits
-
Constructor Details
-
VATidFICheckDigit
public VATidFICheckDigit()
-
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the class.
-
getCharacterSet
Description copied from class:IsoIec7064PureSystem
MOD 11-2 check characters are “0” to “9” plus “X” for example.- Overrides:
getCharacterSet
in classIsoIecPure11System
- 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
-
calculate
Calculate a modulus Check Digit for a code which does not yet have one.- Specified by:
calculate
in interfaceCheckDigit
- Overrides:
calculate
in 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
-
isValid
Validate a modulus check digit for a code.- Specified by:
isValid
in interfaceCheckDigit
- Overrides:
isValid
in classIsoIec7064PureSystem
- Parameters:
code
- The code to validate- Returns:
true
if the check digit is valid, otherwisefalse
-