ChecksumValidation

Inheritance: java.lang.Object, java.lang.Enum

public enum ChecksumValidation extends Enum<ChecksumValidation>

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 results
 
 BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
 {
     generator.save("c:\\test.png");
 }
 BarCodeReader reader = new BarCodeReader("c:\\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("c:\\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());
 }

Fields

FieldDescription
DEFAULTIf checksum is required by the specification - it will be validated.
OFFDo not validate checksum.
ONAlways validate checksum if possible.

Methods

MethodDescription
valueOf(Class arg0, String arg1)
compareTo(E arg0)
equals(Object arg0)
getClass()
getDeclaringClass()
getValue()
hashCode()
name()
notify()
notifyAll()
ordinal()
toString()
valueOf(String name)
values()
wait()
wait(long arg0)
wait(long arg0, int arg1)

DEFAULT

public static final ChecksumValidation DEFAULT

If checksum is required by the specification - it will be validated.

OFF

public static final ChecksumValidation OFF

Do not validate checksum.

ON

public static final ChecksumValidation ON

Always validate checksum if possible.

valueOf(Class arg0, String arg1)

public static T <T>valueOf(Class<T> arg0, String arg1)

Parameters:

ParameterTypeDescription
arg0java.lang.Class
arg1java.lang.String

Returns: T

compareTo(E arg0)

public final int compareTo(E arg0)

Parameters:

ParameterTypeDescription
arg0E

Returns: int

equals(Object arg0)

public final boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDeclaringClass()

public final Class<E> getDeclaringClass()

Returns: java.lang.Class

getValue()

public int getValue()

Returns: int

hashCode()

public final int hashCode()

Returns: int

name()

public final String name()

Returns: java.lang.String

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

ordinal()

public final int ordinal()

Returns: int

toString()

public String toString()

Returns: java.lang.String

valueOf(String name)

public static ChecksumValidation valueOf(String name)

Parameters:

ParameterTypeDescription
namejava.lang.String

Returns: ChecksumValidation

values()

public static ChecksumValidation[] values()

Returns: com.aspose.barcode.barcoderecognition.ChecksumValidation[]

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int