Design notes
Requirements
- The whole barcode package shall be flexible and extensible. New implementations (barcode type or output format) should be easy to add.
- The design shall be done in a way that different barcode types (1D vs. 2D) can be supported.
- The barcodes implementations shall be configured using XML and in a way that the whole package can easily be integrated into a bigger work.
- The barcode logic (checksums, encoding, character sets etc.) shall be separated from the rendering of the barcode so different output formats (SVG, bitmaps etc.) can easily be supported.
Package overview
org.krysalis.barcode4j
This package holds the primary interfaces for generating barcodes.
Main interfaces
- BarcodeGenerator: Main interface for generating barcodes.
- BarcodeClassResolver: Resolves symbolic names to barcode implementation classes.
- BarcodeLogicHandler: Receives barcode events (similar to SAX events for XML) generated by barcode logic implementations.
BarcodeUtil is an very useful helper class. Have a look!
org.krysalis.barcode4j.impl
This package is the home of the standard barcode implementations. Each implementation consist mostly of two classes, a logic implementation and a presentation implementation. The presentation part calls the logic part to generate something similar to SAX events but for barcodes (See BarcodeLogicHandler).
org.krysalis.barcode4j.output (and subpackages)
This is where the various output formats are implemented. To implement a new coordinate-based output format the main task is to create a new CanvasProvider implementation.
org.krysalis.barcode4j.tools
This package contains various helper classes used internally.
org.krysalis.barcode4j.cli
This package contains the command-line interface.
org.krysalis.barcode4j.servlet
This package contains the barcode servlet.
org.krysalis.barcode4j.xalan
This package contains the XSLT extension for Apache Xalan.
org.krysalis.barcode4j.saxon
This package contains the XSLT extension for the SAXON XSLT Processor by Michael Kay.
org.krysalis.barcode4j.playground
This package contains the playground GUI application. It's used to play around with barcodes. Have fun!
by Jeremias Märki