MCPcopy
hub / github.com/zxing/zxing / MultiFormatWriter

Class MultiFormatWriter

core/src/main/java/com/google/zxing/MultiFormatWriter.java:42–105  ·  view source on GitHub ↗

This is a factory class which finds the appropriate Writer subclass for the BarcodeFormat requested and encodes the barcode with the supplied contents. @author dswitkin@google.com (Daniel Switkin)

Source from the content-addressed store, hash-verified

40 * @author dswitkin@google.com (Daniel Switkin)
41 */
42public final class MultiFormatWriter implements Writer {
43
44 @Override
45 public BitMatrix encode(String contents,
46 BarcodeFormat format,
47 int width,
48 int height) throws WriterException {
49 return encode(contents, format, width, height, null);
50 }
51
52 @Override
53 public BitMatrix encode(String contents,
54 BarcodeFormat format,
55 int width, int height,
56 Map<EncodeHintType,?> hints) throws WriterException {
57
58 Writer writer;
59 switch (format) {
60 case EAN_8:
61 writer = new EAN8Writer();
62 break;
63 case UPC_E:
64 writer = new UPCEWriter();
65 break;
66 case EAN_13:
67 writer = new EAN13Writer();
68 break;
69 case UPC_A:
70 writer = new UPCAWriter();
71 break;
72 case QR_CODE:
73 writer = new QRCodeWriter();
74 break;
75 case CODE_39:
76 writer = new Code39Writer();
77 break;
78 case CODE_93:
79 writer = new Code93Writer();
80 break;
81 case CODE_128:
82 writer = new Code128Writer();
83 break;
84 case ITF:
85 writer = new ITFWriter();
86 break;
87 case PDF_417:
88 writer = new PDF417Writer();
89 break;
90 case CODABAR:
91 writer = new CodaBarWriter();
92 break;
93 case DATA_MATRIX:
94 writer = new DataMatrixWriter();
95 break;
96 case AZTEC:
97 writer = new AztecWriter();
98 break;
99 default:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected