Barcode-Lib4J requires Java 9+
Package de.vwsoft.barcodelib4j.oned
Java Class «ImplSSCC18» – Generate SSCC Barcode
java.lang.Object
de.vwsoft.barcodelib4j.oned.Barcode
de.vwsoft.barcodelib4j.oned.ImplCode128
de.vwsoft.barcodelib4j.oned.ImplEAN128
de.vwsoft.barcodelib4j.oned.ImplSSCC18
- All Implemented Interfaces:
Cloneable
Implementation of SSCC (Serial Shipping Container Code) using GS1-128. To generate instances, please use one of the
newInstance
static methods in the Barcode
class.
This convenience class generates a GS1-128 barcode that contains an SSCC as the sole data element. It automatically includes the Application Identifier prefix '00' in both the barcode and the human readable text line, allowing you to specify only the SSCC number itself.
Note: Encoding the same SSCC number with this class and with the
GS1-128
implementation will produce exactly the same barcode.
-
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 SSCC number 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 SSCC number to be encoded in the barcode.The number must be either 18 (with check digit) or 17 (without check digit) in length.
- If the number contains 18 digits, the 18th digit is checked to see if it is a valid check
digit. If the check digit is invalid, a
BarcodeException
is thrown. - If the number contains 17 digits and
autoComplete
is set totrue
, the method calculates the missing check digit and appends it to the specified number. IfautoComplete
is set tofalse
, aBarcodeException
is thrown.
- Overrides:
setContent
in classImplEAN128
- Parameters:
content
- the SSCC number to be encoded in the barcodeautoComplete
- whether to automatically calculate and append a check digit if it is missingappendOptionalChecksum
- has no function, as SSCC uses a fixed check digit which is not optional- Throws:
BarcodeException
- if the content is empty, contains non-numeric characters, is of invalid length, or has an invalid check digit
- If the number contains 18 digits, the 18th digit is checked to see if it is a valid check
digit. If the check digit is invalid, a
-