public abstract class UPCEANLogicImpl extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static byte |
EVEN_PARITY
Even parity character set
|
protected static byte |
LEFT_HAND_A
Left hand A character set
|
protected static byte |
LEFT_HAND_B
Left hand B character set
|
protected static byte |
ODD_PARITY
Odd parity character set
|
protected static byte |
RIGHT_HAND
Right hand character set
|
| Constructor and Description |
|---|
UPCEANLogicImpl(ChecksumMode mode)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
static char |
calcChecksum(String msg)
Calculates the check character for a given message
|
protected void |
drawCenterGuard(ClassicBarcodeLogicHandler logic)
Generates a center guard.
|
protected void |
drawSideGuard(ClassicBarcodeLogicHandler logic)
Generates a side guard.
|
protected void |
drawSupplemental(ClassicBarcodeLogicHandler logic,
String supp)
Generates events for a supplemental.
|
protected void |
encodeChar(ClassicBarcodeLogicHandler logic,
char c,
int charset)
Encodes a character.
|
abstract void |
generateBarcodeLogic(ClassicBarcodeLogicHandler logic,
String msg)
Generates the barcode logic.
|
ChecksumMode |
getChecksumMode()
Returns the current checksum mode.
|
protected static int |
getSupplementalLength(String msg)
Returns the length of the supplemental part of a UPC/EAN message.
|
protected static String |
removeSupplemental(String msg)
Removes an optional supplemental (ex.
|
protected static String |
retrieveSupplemental(String msg)
Returns the supplemental part of a UPC/EAN message if there is one.
|
static void |
validateMessage(String msg)
Validates a UPC/EAN message.
|
protected static final byte LEFT_HAND_A
protected static final byte LEFT_HAND_B
protected static final byte RIGHT_HAND
protected static final byte ODD_PARITY
protected static final byte EVEN_PARITY
public UPCEANLogicImpl(ChecksumMode mode)
mode - the checksum modepublic ChecksumMode getChecksumMode()
public static void validateMessage(String msg)
msg - the message to validatepublic static char calcChecksum(String msg)
msg - the messageprotected void encodeChar(ClassicBarcodeLogicHandler logic, char c, int charset)
logic - the logic handler to receive generated eventsc - the character to encodecharset - the character set to useprotected void drawSideGuard(ClassicBarcodeLogicHandler logic)
logic - the logic handler to receive generated eventsprotected void drawCenterGuard(ClassicBarcodeLogicHandler logic)
logic - the logic handler to receive generated eventsprotected void drawSupplemental(ClassicBarcodeLogicHandler logic, String supp)
logic - the logic handler to receive generated eventssupp - the supplementalprotected static int getSupplementalLength(String msg)
msg - the UPC/EAN messageprotected static String removeSupplemental(String msg)
msg - a UPC/EAN messageprotected static String retrieveSupplemental(String msg)
msg - a UPC/EAN messagepublic abstract void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
logic - the logic handler to receive generated eventsmsg - the message to encodeCopyright © 2003–2023. All rights reserved.