QRCodeEPCOptionsBuilder Class
Builds a QRCodeEPCOptions object. Chain builder methods to configure barcode settings, then call the build() method to create the options object.
Declaration
public class QRCodeEPCOptionsBuilder extends BarcodeOptionsBuilder<QRCodeEPCOptions,QRCodeEPCOptionsBuilder>
Remarks
Refer to the following help topic for additional information: EPC QR Code.
The following code snippet creates an EPC QR Code barcode and customizes its encoding parameters with the Fluent API:
import com.devexpress.drawing.*;
import com.devexpress.docs.barcode.*;
import com.devexpress.system.drawing.*;
import com.devexpress.docs.Padding;
import java.io.*;
import java.nio.file.*;
public class Main {
public static void main(String[] args) throws Exception {
QRCodeEPCOptions options = QRCodeEPCOptionsBuilder.create()
.withTransferAmount(100.50)
.withEPCVersion(EPCVersion.VERSION_1)
.withEPCEncoding(EPCEncoding.UTF_8)
.withBackColor(Color.getLightGray())
.withBIC("BFSWDE33MUC")
.withBeneficiaryName("John Doe")
.withIBAN("DE89370400440532013000")
.withPaymentReference("RF18539007547034")
.withTransferPurpose("CHAR")
.withPadding(new Padding(10))
.withShowText(true)
.withWidth(400)
.build();
Path outputDir = Path.of("output");
Files.createDirectories(outputDir);
try (FileOutputStream fileStream = new FileOutputStream(
outputDir.resolve("qrcodeEPC.png").toFile());
BarcodeGenerator barcodeGenerator = new BarcodeGenerator(options)) {
barcodeGenerator.export(
options.getStringData(),
fileStream,
DXImageFormat.getPng());
}
}
}
Inherited Members
Inheritance
QRCodeEPCOptionsBuilder()
Initializes a new instance of the QRCodeEPCOptionsBuilder class.
Declaration
public QRCodeEPCOptionsBuilder()
Methods
create() Method
Creates a new QRCodeEPCOptionsBuilder instance.
Declaration
public static QRCodeEPCOptionsBuilder create()
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The current |
withBeneficiaryName(String beneficiaryName) Method
Sets the beneficiary name and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withBeneficiaryName(String beneficiaryName)
Parameters
| Name | Type | Description |
|---|---|---|
| beneficiaryName | String | The beneficiary name. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withBIC(String bic) Method
Sets the BIC (Bank Identifier Code) for the QR code. Returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withBIC(String bic)
Parameters
| Name | Type | Description |
|---|---|---|
| bic | String | The BIC to be set for the QR code. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withEPCEncoding(EPCEncoding epcEncoding) Method
Sets the EPC encoding and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withEPCEncoding(EPCEncoding epcEncoding)
Parameters
| Name | Type | Description |
|---|---|---|
| epcEncoding | EPCEncoding | An enumeration value that indicates the EPC encoding. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withEPCVersion(EPCVersion epcVersion) Method
Sets the EPC version and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withEPCVersion(EPCVersion epcVersion)
Parameters
| Name | Type | Description |
|---|---|---|
| epcVersion | EPCVersion | An enumeration value that indicates the EPC version. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withFrameOptions(QRFrameOptions options) Method
Specifies frame options and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withFrameOptions(QRFrameOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
| options | QRFrameOptions | An object that contains frame options. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withIBAN(String iban) Method
Sets the IBAN (International Bank Account Number) and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withIBAN(String iban)
Parameters
| Name | Type | Description |
|---|---|---|
| iban | String | The IBAN to be set for the QR code. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withIncludeQuietZone(boolean includeQuietZone) Method
Specifies whether to include a quiet zone (blank space surrounding the code) around the code. Returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withIncludeQuietZone(boolean includeQuietZone)
Parameters
| Name | Type | Description |
|---|---|---|
| includeQuietZone | boolean |
|
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withInformation(String information) Method
Sets the additional payment information and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withInformation(String information)
Parameters
| Name | Type | Description |
|---|---|---|
| information | String | The additional payment information. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withLogo(DXImage logo) Method
Specifies the logo image and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withLogo(DXImage logo)
Parameters
| Name | Type | Description |
|---|---|---|
| logo | DXImage | The logo image. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withPaymentReference(String paymentReference) Method
Sets the payment reference for the QR code and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withPaymentReference(String paymentReference)
Parameters
| Name | Type | Description |
|---|---|---|
| paymentReference | String | The payment reference. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withRemittanceInformation(String remittanceInformation) Method
Sets the remittance information for the QR code and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withRemittanceInformation(String remittanceInformation)
Parameters
| Name | Type | Description |
|---|---|---|
| remittanceInformation | String | The remittance information. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withTransferAmount(@Nullable Double transferAmount) Method
Specifies the transfer amount to be encoded in the QR code and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withTransferAmount(@Nullable Double transferAmount)
Parameters
| Name | Type | Description |
|---|---|---|
| transferAmount | The transfer amount. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The current |
withTransferPurpose(String transferPurpose) Method
Sets the transfer purpose for the QR code and returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withTransferPurpose(String transferPurpose)
Parameters
| Name | Type | Description |
|---|---|---|
| transferPurpose | String | The transfer purpose. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |
withVersion(QRCodeVersion version) Method
Specifies the EPC QR Code version. Returns the builder instance for method chaining.
Declaration
public QRCodeEPCOptionsBuilder withVersion(QRCodeVersion version)
Parameters
| Name | Type | Description |
|---|---|---|
| version | QRCodeVersion | Indicates the EPC QR Code version. |
Returns
| Type | Description |
|---|---|
QRCodeEPCOptionsBuilder |
The builder instance for method chaining. |