barcode4j 2.1.0

org.krysalis.barcode4j.impl
Class ConfigurableBarcodeGenerator

java.lang.Object
  extended by org.krysalis.barcode4j.impl.ConfigurableBarcodeGenerator
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, BarcodeGenerator
Direct Known Subclasses:
Codabar, Code128, Code39, DataMatrix, Interleaved2Of5, PDF417, POSTNET, QRCode, RoyalMailCBC, UPCEAN, USPSIntelligentMail

public abstract class ConfigurableBarcodeGenerator
extends java.lang.Object
implements BarcodeGenerator, org.apache.avalon.framework.configuration.Configurable

Base class for most Avalon-Configurable barcode implementation proxies.

Version:
$Id: ConfigurableBarcodeGenerator.java,v 1.13 2009/02/19 10:14:54 jmaerki Exp $

Field Summary
static java.lang.String[] BARCODE_ELEMENTS
          Contains all possible element names that may appear in barcode XML.
protected  AbstractBarcodeBean bean
          Proxy target.
 
Constructor Summary
ConfigurableBarcodeGenerator()
           
 
Method Summary
 BarcodeDimension calcDimensions(java.lang.String msg)
          Calculates the dimension of a barcode with the given message.
 void configure(org.apache.avalon.framework.configuration.Configuration cfg)
          
 void generateBarcode(CanvasProvider canvas, java.lang.String msg)
          Generates a barcode using the given Canvas to render the barcode to its output format.
 AbstractBarcodeBean getBean()
          Provides access to the underlying barcode bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BARCODE_ELEMENTS

public static final java.lang.String[] BARCODE_ELEMENTS
Contains all possible element names that may appear in barcode XML.


bean

protected AbstractBarcodeBean bean
Proxy target. Barcode bean to configure.

Constructor Detail

ConfigurableBarcodeGenerator

public ConfigurableBarcodeGenerator()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration cfg)
               throws org.apache.avalon.framework.configuration.ConfigurationException

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

getBean

public AbstractBarcodeBean getBean()
Provides access to the underlying barcode bean.

Returns:
the underlying barcode bean

generateBarcode

public void generateBarcode(CanvasProvider canvas,
                            java.lang.String msg)
Generates a barcode using the given Canvas to render the barcode to its output format.

Specified by:
generateBarcode in interface BarcodeGenerator
Parameters:
canvas - CanvasProvider that the barcode is to be rendered on.
msg - message to encode

calcDimensions

public BarcodeDimension calcDimensions(java.lang.String msg)
Calculates the dimension of a barcode with the given message. The dimensions are dependant on the configuration of the barcode generator.

Specified by:
calcDimensions in interface BarcodeGenerator
Parameters:
msg - message to use for calculation.
Returns:
BarcodeDimension a BarcodeDimension object containing the barcode's dimensions

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.