Barcode-Lib4J requires Java 9+
Package de.vwsoft.barcodelib4j.oned
Java Class «ImplCode11» – Generate Code 11 Barcode
java.lang.Object
de.vwsoft.barcodelib4j.oned.Barcode
de.vwsoft.barcodelib4j.oned.LineageTwoWidth
de.vwsoft.barcodelib4j.oned.ImplCode11
- All Implemented Interfaces:
Cloneable
Implementation of Code 11. To generate instances, please use one of the
newInstance
static methods in the Barcode
class.
Code 11 is a numeric barcode format that encodes digits (0-9) and the hyphen (-). It is used primarily in telecommunications.
This class extends the abstract class LineageTwoWidth
, as Code 11 is a type of two-width
barcode. See the linked class description for more information.
Code 11 can be used with an optional checksum. Unlike most other barcode types, the checksum in Code 11 is composed of two characters.
-
Field Summary
Fields inherited from class de.vwsoft.barcodelib4j.oned.LineageTwoWidth
DEFAULT_RATIO
-
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.LineageTwoWidth
getRatio, setRatio
Methods inherited from class de.vwsoft.barcodelib4j.oned.Barcode
clone, draw, draw, draw, getAddOn, getContent, getFont, getText, getTextOffset, isFontSizeAdjusted, isTextOnTop, isTextVisible, newInstance, newInstance, setAddOn, setCustomText, setFont, setFontSizeAdjusted, setTextOffset, setTextOnTop, setTextVisible, supportsAddOn, supportsCustomText, supportsTextOnTop
-
Method Details
-
setContent
public void setContent(String content, boolean autoComplete, boolean appendOptionalChecksum) throws BarcodeException Sets the content to be encoded in the barcode.If the
appendOptionalChecksum
parameter is set totrue
, the method will calculate and append a checksum to the content. The checksum consists of two characters.- Specified by:
setContent
in classBarcode
- Parameters:
content
- the content to be encoded in the Code 11 barcodeautoComplete
- has no function in this method implementationappendOptionalChecksum
- whether to append an optional checksum to the content- Throws:
BarcodeException
- if the content is empty or contains invalid characters
-