Class Encoder
- java.lang.Object
-
- zext.plantuml.com.google.zxing.qrcode.encoder.Encoder
-
public final class Encoder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ModechooseMode(java.lang.String content)static ModechooseMode(java.lang.String content, java.lang.String encoding)Choose the best mode by examining the content.static voidencode(java.lang.String content, ErrorCorrectionLevel ecLevel, java.util.Hashtable hints, QRCode qrCode)static voidencode(java.lang.String content, ErrorCorrectionLevel ecLevel, QRCode qrCode)Encode "bytes" with the error correction level "ecLevel".
-
-
-
Method Detail
-
encode
public static void encode(java.lang.String content, ErrorCorrectionLevel ecLevel, QRCode qrCode) throws WriterExceptionEncode "bytes" with the error correction level "ecLevel". The encoding mode will be chosen internally by chooseMode(). On success, store the result in "qrCode". We recommend you to use QRCode.EC_LEVEL_L (the lowest level) for "getECLevel" since our primary use is to show QR code on desktop screens. We don't need very strong error correction for this purpose. Note that there is no way to encode bytes in MODE_KANJI. We might want to add EncodeWithMode() with which clients can specify the encoding mode. For now, we don't need the functionality.- Throws:
WriterException
-
encode
public static void encode(java.lang.String content, ErrorCorrectionLevel ecLevel, java.util.Hashtable hints, QRCode qrCode) throws WriterException- Throws:
WriterException
-
chooseMode
public static Mode chooseMode(java.lang.String content)
-
chooseMode
public static Mode chooseMode(java.lang.String content, java.lang.String encoding)
Choose the best mode by examining the content. Note that 'encoding' is used as a hint; if it is Shift_JIS, and the input is only double-byte Kanji, then we returnMode.KANJI.
-
-