As Available as of Camel 2.14
The barcode data format is based on the zxing library. The goal of this component is to create a barcode image from a String (marshal) and a String from a barcode image (unmarshal). You're free to use all features that zxing offers.
Dependencies
To use Bindy the barcode data format in your camel routes you need to add the a dependency on camel-barcode which implements this data format.
...
Code Block |
---|
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-barcode</artifactId> <version>x.x.x</version> </dependency> |
Using the Java DSL
First you have to initialize the barcode data fomat class. You can use the default constructor, or one of parameterized (see JavaDoc). The default values are:
...
Code Block |
---|
// QR-Code default DataFormat code = new BarcodeDataFormat(); |
If you want to use zxing hints, you can use the 'addToHintMap' method of your BarcodeDataFormat instance:
Code Block |
---|
code.addToHintMap(DecodeHintType.TRY_HARDER, Boolean.true);
|
For possible hints, please consult the xzing documentation.
Marshalling
Code Block |
---|
from("direct://code") .marshal(code) .to("file://barcode_out"); |
...