Barcode-Lib4J requires Java 9+
Package de.vwsoft.barcodelib4j.oned
Java Class «ImplCode128A» – Generate Code 128 A Barcode
java.lang.Object
de.vwsoft.barcodelib4j.oned.Barcode
de.vwsoft.barcodelib4j.oned.ImplCode128
de.vwsoft.barcodelib4j.oned.ImplCode128A
- All Implemented Interfaces:
Cloneable
Implementation of Code 128 A. To generate instances, please use one of the
newInstance
static methods in the Barcode
class.
Code 128 A is a subset of Code 128, capable of encoding ASCII characters with values from 0 to 95, covering:
- Control characters (ASCII 0-31), such as NUL, SOH, STX, etc.
- Digits (0-9)
- Upper case letters (A-Z)
- Space character
- Punctuation and special characters:
!"#$%&'()*+,-./:;<=>?@[\]^_
Code 128 A uses an internal checksum included within the barcode symbol but not displayed in plaintext representation.
-
Field Summary
Fields inherited from class de.vwsoft.barcodelib4j.oned.ImplCode128
FNC1, FNC2, FNC3, FNC4
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setContent
(String content, boolean autoComplete, boolean appendOptionalChecksum) Sets the content to be encoded in the barcode.Methods inherited from class de.vwsoft.barcodelib4j.oned.Barcode
clone, draw, draw, draw, getAddOn, getContent, getFont, getRatio, getText, getTextOffset, isFontSizeAdjusted, isOptionalChecksumVisible, isTextOnTop, isTextVisible, newInstance, newInstance, setAddOn, setCustomText, setFont, setFontSizeAdjusted, setOptionalChecksumVisible, setRatio, setTextOffset, setTextOnTop, setTextVisible, supportsAddOn, supportsCustomText, supportsOptionalChecksum, supportsRatio, supportsTextOnTop
-
Method Details
-
setContent
public void setContent(String content, boolean autoComplete, boolean appendOptionalChecksum) throws BarcodeException Sets the content to be encoded in the barcode.Validates the provided content to ensure that it contains only ASCII characters with values between 0 and 95, and throws a
BarcodeException
if it does not.The provided content can also include Function Codes
FNC1
toFNC4
for specific application needs.- Overrides:
setContent
in classImplCode128
- Parameters:
content
- the content to be encoded in the Code 128 A barcodeautoComplete
- whether to automatically convert lowercase letters in the content to uppercase lettersappendOptionalChecksum
- has no function, as Code 128 A uses a fixed internal checksum which is not optional- Throws:
BarcodeException
- if the content is empty, or contains characters outside ASCII range 0-95
-