public class QRBill
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
QRBill.BillFormat
The output size of the QR bill
|
static class |
QRBill.GraphicsFormat
Graphics format of generated QR bill.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY_ACCOUNT_IS_CH_LI_IBAN
Validation message key: IBAN must be from bank in Switzerland or Liechtenstein
|
static java.lang.String |
KEY_ACCOUNT_IS_VALID_IBAN
Validation message key: IBAN number must have valid format and check digit
|
static java.lang.String |
KEY_AMOUNT_IS_IN_VALID_RANGE
Validation message key: amount must be between 0.01 and 999999999.99
|
static java.lang.String |
KEY_CURRENCY_IS_CHF_OR_EUR
Validation message key: currency must be "CHF" or "EUR"
|
static java.lang.String |
KEY_FIELD_CLIPPED
Validation message key: Field has been clipped to not exceed the maximum length
|
static java.lang.String |
KEY_FIELD_IS_MANDATORY
Validation message key: Field is mandatory
|
static java.lang.String |
KEY_MANDATORY_FOR_QR_IBAN
Validation message key: Reference number is mandatory for IBANs with QR-IID
|
static java.lang.String |
KEY_REPLACED_UNSUPPORTED_CHARACTERS
Validation message key: Unsupported characters have been replaced
|
static java.lang.String |
KEY_SUPPORTED_CODING_TYPE
Validation message key: Coding type 1 is supported only
|
static java.lang.String |
KEY_SUPPORTED_VERSION
Validation message key: Version 01.00 is supported only
|
static java.lang.String |
KEY_VALID_COUNTRY_CODE
Validation message key: Country code must consist of two letters
|
static java.lang.String |
KEY_VALID_DATA_STRUCTURE
Validation message key: Valid data structure starts with "SPC" and consists of 28 to 30 lines of text
|
static java.lang.String |
KEY_VALID_DATE
Validation message key: Valid date required (YYYY-MM_DD)
|
static java.lang.String |
KEY_VALID_ISO11649_CREDITOR_REF
Validation message key: ISO 11649 reference number must have valid format and check digit
|
static java.lang.String |
KEY_VALID_NUMBER
Validation message key: Valid number required (nnnnn.nn)
|
static java.lang.String |
KEY_VALID_QR_REF_NO
Validation message key: QR reference number must have valid format and check digit
|
| Constructor and Description |
|---|
QRBill() |
| Modifier and Type | Method and Description |
|---|---|
static Bill |
decodeQrCodeText(java.lang.String text)
Decodes the text embedded in the QR code and fills it into a
Bill data structure. |
static java.lang.String |
encodeQrCodeText(Bill bill)
Encodes the text embedded in the QR code from the specified bill data.
|
static byte[] |
generate(Bill bill,
QRBill.BillFormat billFormat,
Canvas canvas)
Generates a QR bill payment part using the specified canvas.
|
static byte[] |
generate(Bill bill,
QRBill.BillFormat billFormat,
QRBill.GraphicsFormat graphicsFormat)
Generates a QR bill payment part.
|
static ValidationResult |
validate(Bill bill)
Validates and cleans the bill data.
|
public static final java.lang.String KEY_CURRENCY_IS_CHF_OR_EUR
public static final java.lang.String KEY_AMOUNT_IS_IN_VALID_RANGE
public static final java.lang.String KEY_ACCOUNT_IS_CH_LI_IBAN
public static final java.lang.String KEY_ACCOUNT_IS_VALID_IBAN
public static final java.lang.String KEY_VALID_ISO11649_CREDITOR_REF
public static final java.lang.String KEY_VALID_QR_REF_NO
public static final java.lang.String KEY_MANDATORY_FOR_QR_IBAN
public static final java.lang.String KEY_FIELD_IS_MANDATORY
public static final java.lang.String KEY_VALID_COUNTRY_CODE
public static final java.lang.String KEY_FIELD_CLIPPED
public static final java.lang.String KEY_REPLACED_UNSUPPORTED_CHARACTERS
public static final java.lang.String KEY_VALID_DATA_STRUCTURE
public static final java.lang.String KEY_SUPPORTED_VERSION
public static final java.lang.String KEY_SUPPORTED_CODING_TYPE
public static final java.lang.String KEY_VALID_NUMBER
public static final java.lang.String KEY_VALID_DATE
public static ValidationResult validate(Bill bill)
The validation result contains the error and warning messages (if any) and the cleaned bill data.
For details about the validation result, see Bill data validation
bill - bill datapublic static byte[] generate(Bill bill, QRBill.BillFormat billFormat, QRBill.GraphicsFormat graphicsFormat)
If the bill data does not validate, a QRBillValidationError is thrown,
which contains the validation result. For details about the validation result, see
Bill data validation
bill - the bill databillFormat - the bill's output sizegraphicsFormat - the bill's output formatQRBillValidationError - thrown if the bill data does not validatepublic static byte[] generate(Bill bill, QRBill.BillFormat billFormat, Canvas canvas)
If the bill data does not validate, a QRBillValidationError is thrown,
which contains the validation result. For details about the validation result, see
Bill data validation
The canvas will be initialized with Canvas#setupPage and it will
be closed before returning the generated QR bill
bill - the bill databillFormat - the bill's output sizecanvas - the canvas to draw toQRBillValidationError - thrown if the bill data does not validatepublic static java.lang.String encodeQrCodeText(Bill bill)
The specified bill data is first validated and cleaned.
If the bill data does not validate, a QRBillValidationError is thrown,
which contains the validation result. For details about the validation result, see
Bill data validation
bill - the bill data to encodeQRBillValidationError - thrown if the bill data does not validatepublic static Bill decodeQrCodeText(java.lang.String text)
Bill data structure.
A subset of the validations related to embedded QR code text is run. It the validation fails,
a QRBillValidationError is thrown, which contains the validation result.
See the error messages marked with a dagger in
Bill data validation.
text - the text to decodeQRBillValidationError - thrown if the bill data does not validate