public interface BarcodeStrategy
Modifier and Type | Field and Description |
---|---|
static int |
MANDATORY_CHECKSUM
When returned by
requiresChecksum() , indicates that this type of
barcode always has a checksum. |
static int |
NO_CHECKSUM
When returned by
requiresChecksum() , indicates that this type of
barcode does not support a checksum. |
static int |
OPTIONAL_CHECKSUM
When returned by
requiresChecksum() , indicates that this type of
barcode may have an optional checksum. |
Modifier and Type | Method and Description |
---|---|
EncodedBarcode |
encode(java.lang.String text,
boolean checked)
Subclasses implement this method to encode some text into a barcode.
|
int |
requiresChecksum()
Subclasses implement this method to determine whether this type of barcode
has a mandatory, optional or no checksum.
|
static final int NO_CHECKSUM
requiresChecksum()
, indicates that this type of
barcode does not support a checksum.static final int MANDATORY_CHECKSUM
requiresChecksum()
, indicates that this type of
barcode always has a checksum.static final int OPTIONAL_CHECKSUM
requiresChecksum()
, indicates that this type of
barcode may have an optional checksum.EncodedBarcode encode(java.lang.String text, boolean checked) throws BarcodeException
text
- The raw text to encode.checked
- true if a checksum is to be calculated, false if not.EncodedBarcode
object.BarcodeException
- Typically caused by passing in
a String containing illegal characters (characters that cannot be encoded in
this type of barcode).int requiresChecksum()
Copyright ? 2022. All Rights Reserved.