public class Code39LogicImpl extends Object
| Constructor and Description |
|---|
Code39LogicImpl()
As a convenience this nullary constructor has been added to use the default values
|
Code39LogicImpl(ChecksumMode mode,
boolean displayStartStop,
boolean displayChecksum,
boolean extendedCharSet)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
static char |
calcChecksum(String msg)
Calculates the checksum for a message to be encoded as an
Code39 barcode.
|
protected void |
encodeChar(ClassicBarcodeLogicHandler logic,
char c)
Encodes a single character.
|
static StringBuffer |
escapeExtended(String msg,
StringBuffer sb)
Escapes US-ASCII characters as required for the extended character set for Code 39.
|
void |
generateBarcodeLogic(ClassicBarcodeLogicHandler logic,
String msg)
Generates the barcode logic
|
ChecksumMode |
getChecksumMode()
Returns the currently active checksum mode.
|
static boolean |
validateChecksum(String msg)
Verifies the checksum for a message.
|
public Code39LogicImpl()
public Code39LogicImpl(ChecksumMode mode, boolean displayStartStop, boolean displayChecksum, boolean extendedCharSet)
mode - checksum mode. By default, is set to ChecksumMode.CP_AUTO.displayStartStop - Controls whether to display start and stop characters in the human-readable message. By default, is set to false.displayChecksum - Controls whether to display checksum in the human-readable message. By default, is set to false.extendedCharSet - Controls whether to use extended character set. By default, is set to false.public ChecksumMode getChecksumMode()
public static StringBuffer escapeExtended(String msg, StringBuffer sb)
msg - the original messagesb - the StringBuffer to write the escaped message to (or null)public static char calcChecksum(String msg)
msg - message to calculate the check digit forpublic static boolean validateChecksum(String msg)
msg - message (check digit included)protected void encodeChar(ClassicBarcodeLogicHandler logic, char c)
logic - the logic handler to receive generated eventsc - the character to encodepublic void generateBarcodeLogic(ClassicBarcodeLogicHandler logic, String msg)
logic - the logic handler to receive generated eventsmsg - the message to encodeCopyright © 2003–2023. All rights reserved.