|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.krysalis.barcode4j.impl.upcean.UPCEANLogicImpl
public abstract class UPCEANLogicImpl
This is an abstract base class for UPC and EAN barcodes.
Field Summary | |
---|---|
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 Summary | |
---|---|
UPCEANLogicImpl(ChecksumMode mode)
Main constructor |
Method Summary | |
---|---|
static char |
calcChecksum(java.lang.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,
java.lang.String supp)
Generates events for a supplemental. |
protected void |
encodeChar(ClassicBarcodeLogicHandler logic,
char c,
int charset)
Encodes a character. |
abstract void |
generateBarcodeLogic(ClassicBarcodeLogicHandler logic,
java.lang.String msg)
Generates the barcode logic. |
ChecksumMode |
getChecksumMode()
Returns the current checksum mode. |
protected static int |
getSupplementalLength(java.lang.String msg)
Returns the length of the supplemental part of a UPC/EAN message. |
protected static java.lang.String |
removeSupplemental(java.lang.String msg)
Removes an optional supplemental (ex. "+20") from the message. |
protected static java.lang.String |
retrieveSupplemental(java.lang.String msg)
Returns the supplemental part of a UPC/EAN message if there is one. |
static void |
validateMessage(java.lang.String msg)
Validates a UPC/EAN message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public UPCEANLogicImpl(ChecksumMode mode)
mode
- the checksum modeMethod Detail |
---|
public ChecksumMode getChecksumMode()
public static void validateMessage(java.lang.String msg)
msg
- the message to validatepublic static char calcChecksum(java.lang.String msg)
msg
- the message
protected 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, java.lang.String supp)
logic
- the logic handler to receive generated eventssupp
- the supplementalprotected static int getSupplementalLength(java.lang.String msg)
msg
- the UPC/EAN message
protected static java.lang.String removeSupplemental(java.lang.String msg)
msg
- a UPC/EAN message
protected static java.lang.String retrieveSupplemental(java.lang.String msg)
msg
- a UPC/EAN message
public abstract void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, java.lang.String msg)
logic
- the logic handler to receive generated eventsmsg
- the message to encode
|
barcode4j 2.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |