Enum Class ChecksumValidation
- All Implemented Interfaces:
Serializable,Comparable<ChecksumValidation>,Constable
Enable checksum validation during recognition for 1D and Postal barcodes.
Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
Checksum always used: Rest symbologies
This sample shows influence of ChecksumValidation on recognition quality and resultsBarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128"); { generator.save("test.png"); } BarCodeReader reader = new BarCodeReader("test.png", DecodeType.EAN_13)) { //checksum disabled reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF); for(BarCodeResult result : reader.readBarCodes()) { System.out.println("BarCode CodeText: " + result.getCodeText()); System.out.println("BarCode Value: " + result.getExtended().getOneD().getValue()); System.out.println("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum()); } } BarCodeReader reader = new BarCodeReader("test.png", DecodeType.EAN_13); //checksum enabled reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON); for(BarCodeResult result : reader.readBarCodes()) { System.out.println("BarCode CodeText: " + result.getCodeText()); System.out.println("BarCode Value: " + result.getExtended().getOneD().getValue()); System.out.println("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum()); }
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()static ChecksumValidationReturns the enum constant of this class with the specified name.static ChecksumValidation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
If checksum is required by the specification - it will be validated. -
ON
Always validate checksum if possible. -
OFF
Do not validate checksum.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
public int getValue()
-