C:\Projects\Barcode\src\com\barcodelib\barcode\BarcodeJasperFactory.java

package com.barcodelib.barcode; 
 
public class BarcodeJasperFactory { 
 
    public static IJasperRenderer createLinear(int type, String data) 
    { 
        Linear barcode = new Linear(); 
        barcode.setData(data); 
        barcode.setType(type); 
        return barcode; 
    } 
 
    public static IJasperRenderer createLinear(int type, String data, boolean addCheckSum) 
    { 
        Linear barcode = new Linear(); 
        barcode.setData(data); 
        barcode.setType(type); 
        barcode.setAddCheckSum(addCheckSum); 
        return barcode; 
    } 
 
    public static IJasperRenderer createLinear(int type, String data, String sData) 
    { 
        Linear barcode = new Linear(); 
        barcode.setData(data); 
        barcode.setType(type); 
        barcode.setSData(sData); 
        return barcode; 
    } 
 
    public static IJasperRenderer createLinear(int type, String data, String sData, boolean addCheckSum) 
    { 
        Linear barcode = new Linear(); 
        barcode.setData(data); 
        barcode.setType(type); 
        barcode.setSData(sData); 
        barcode.setAddCheckSum(addCheckSum); 
        return barcode; 
    } 
     
    public static IJasperRenderer createLinear(int type, String data, String sData, 
                                       float X, float Y, 
                                       float leftMargin, float rightMargin, 
                                       float topMargin, float bottomMargin, 
                                       int resolution, boolean showText, 
                                       boolean addCheckSum) 
    { 
        Linear barcode = new Linear(); 
        barcode.setData(data); 
        barcode.setType(type); 
        barcode.setSData(sData); 
        barcode.setY(Y); 
        barcode.setX(X); 
        barcode.setLeftMargin(leftMargin); 
        barcode.setRightMargin(rightMargin); 
        barcode.setTopMargin(topMargin); 
        barcode.setBottomMargin(bottomMargin); 
        barcode.setResolution(resolution); 
        barcode.setShowText(showText); 
        barcode.setAddCheckSum(addCheckSum); 
 
        return barcode; 
    } 
 
    public static IJasperRenderer createDataMatrix(String data, int dataMode, int format) 
    { 
        DataMatrix barcode = new DataMatrix(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setFormatMode(format); 
        return barcode; 
    } 
 
    public static IJasperRenderer createDataMatrix(String data, int dataMode, int format, float moduleSize) 
    { 
        DataMatrix barcode = new DataMatrix(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setFormatMode(format); 
        barcode.setModuleSize(moduleSize); 
        return barcode; 
    } 
 
    public static IJasperRenderer createDataMatrix(String data, int dataMode, int format, 
                               int resolution, float moduleSize, boolean processTilde, float margin) 
    { 
        DataMatrix barcode = new DataMatrix(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setFormatMode(format); 
        barcode.setResolution(resolution); 
        barcode.setModuleSize(moduleSize); 
        barcode.setProcessTilde(processTilde); 
        barcode.setLeftMargin(margin); 
        barcode.setRightMargin(margin); 
        barcode.setTopMargin(margin); 
        barcode.setBottomMargin(margin); 
        return barcode; 
    } 
 
 
 
 
    public static IJasperRenderer createPDF417(String data, int dataMode) 
    { 
        PDF417 barcode = new PDF417(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        return barcode; 
    } 
 
 
    public static IJasperRenderer createPDF417(String data, int dataMode, 
              int rowCount, int columnCount, float X, int barRatio, 
              float leftMargin, float rightMargin, float topMargin, float bottomMargin) 
    { 
        PDF417 barcode = new PDF417(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setRowCount(rowCount); 
        barcode.setColumnCount(columnCount); 
        barcode.setX(X); 
        barcode.setBarRatio(barRatio); 
        barcode.setLeftMargin(leftMargin); 
        barcode.setRightMargin(rightMargin); 
        barcode.setTopMargin(topMargin); 
        barcode.setBottomMargin(bottomMargin); 
        return barcode; 
    } 
 
    public static IJasperRenderer createPDF417(String data, int dataMode, 
              int rowCount, int columnCount, float X, int barRatio, 
              float leftMargin, float rightMargin, float topMargin, float bottomMargin, 
              int ecl, boolean truncated) 
    { 
        PDF417 barcode = new PDF417(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setRowCount(rowCount); 
        barcode.setColumnCount(columnCount); 
        barcode.setX(X); 
        barcode.setBarRatio(barRatio); 
        barcode.setLeftMargin(leftMargin); 
        barcode.setRightMargin(rightMargin); 
        barcode.setTopMargin(topMargin); 
        barcode.setBottomMargin(bottomMargin); 
        barcode.setEcl(ecl); 
        barcode.setTruncated(truncated); 
        return barcode; 
    } 
 
    public static IJasperRenderer createPDF417(String data, int dataMode, 
              int rowCount, int columnCount, float X, int barRatio, 
              float leftMargin, float rightMargin, float topMargin, float bottomMargin, 
              int ecl, boolean truncated, 
              boolean isMacro, int macroFileIndex, int macroSegmentIndex, int macroSegmentCount) 
    { 
        PDF417 barcode = new PDF417(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setRowCount(rowCount); 
        barcode.setColumnCount(columnCount); 
        barcode.setX(X); 
        barcode.setBarRatio(barRatio); 
        barcode.setLeftMargin(leftMargin); 
        barcode.setRightMargin(rightMargin); 
        barcode.setTopMargin(topMargin); 
        barcode.setBottomMargin(bottomMargin); 
        barcode.setEcl(ecl); 
        barcode.setTruncated(truncated); 
        barcode.setMacro(isMacro); 
        barcode.setMacroFileIndex(macroFileIndex); 
        barcode.setMacroSegmentIndex(macroSegmentIndex); 
        barcode.setMacroSegmentCount(macroSegmentCount); 
        return barcode; 
    } 
 
    public static IJasperRenderer createQRCode(String data, int dataMode, int version) 
    { 
        QRCode barcode = new QRCode(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setVersion(version); 
        return barcode; 
    } 
 
    public static IJasperRenderer createQRCode(String data, int dataMode, int version, int ecl) 
    { 
        QRCode barcode = new QRCode(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setVersion(version); 
        barcode.setEcl(ecl); 
        barcode.setEcl(ecl); 
        return barcode; 
    } 
 
    public static IJasperRenderer createQRCode(String data, int dataMode, int version, int ecl, 
                             float moduleSize, float margin) 
    { 
        QRCode barcode = new QRCode(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setVersion(version); 
        barcode.setEcl(ecl); 
        barcode.setModuleSize(moduleSize); 
        barcode.setLeftMargin(margin); 
        barcode.setRightMargin(margin); 
        barcode.setTopMargin(margin); 
        barcode.setBottomMargin(margin); 
        return barcode; 
    } 
 
    public static IJasperRenderer createQRCode(String data, int dataMode, int version, int ecl, 
              boolean supportStructuredAppend, int appendCount, int appendIndex) 
    { 
        QRCode barcode = new QRCode(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setVersion(version); 
        barcode.setEcl(ecl); 
        barcode.setStructuredAppend(supportStructuredAppend); 
        barcode.setSymbolCount(appendCount); 
        barcode.setSymbolIndex(appendIndex); 
        return barcode; 
    } 
 
    public static IJasperRenderer createQRCode(String data, int dataMode, int version, int ecl, 
              int fnc1Mode, byte applicationIndicator) 
    { 
        QRCode barcode = new QRCode(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setVersion(version); 
        barcode.setEcl(ecl); 
        barcode.setFnc1Mode(fnc1Mode); 
        barcode.setApplicationIndicator(applicationIndicator); 
        return barcode; 
    } 
 
    public static IJasperRenderer createQRCode(String data, int dataMode, int version, int ecl, 
              boolean supportStructuredAppend, int appendCount, int appendIndex, 
              int fnc1Mode, byte applicationIndicator, 
              int eci, boolean processTilde, 
              float moduleSize, float margin) 
    { 
        QRCode barcode = new QRCode(); 
        barcode.setData(data); 
        barcode.setDataMode(dataMode); 
        barcode.setVersion(version); 
        barcode.setEcl(ecl); 
        barcode.setStructuredAppend(supportStructuredAppend); 
        barcode.setSymbolCount(appendCount); 
        barcode.setSymbolIndex(appendIndex); 
        barcode.setFnc1Mode(fnc1Mode); 
        barcode.setApplicationIndicator(applicationIndicator); 
        barcode.setEci(eci); 
        barcode.setProcessTilde(processTilde); 
        barcode.setModuleSize(moduleSize); 
        barcode.setLeftMargin(margin); 
        barcode.setRightMargin(margin); 
        barcode.setTopMargin(margin); 
        barcode.setBottomMargin(margin); 
 
        return barcode; 
    } 
 
 
 
}