Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Stores recognized barcode data like SingleDecodeType type, string codetext,
| [getClass()](#getClass--) | |
| [getCodeBytes()](#getCodeBytes--) | Gets the encoded code bytes |
| [getCodeText()](#getCodeText--) | Gets the code text |
| [getCodeText(Charset encoding)](#getCodeText-java.nio.charset.Charset-) | Gets the code text with encoding. |
| [getCodeText(Charset charset)](#getCodeText-java.nio.charset.Charset-) | Gets the code text with encoding. |
| [getCodeType()](#getCodeType--) | Gets the barcode type |
| [getCodeTypeName()](#getCodeTypeName--) | Gets the name of the barcode type |
| [getConfidence()](#getConfidence--) | Gets recognition confidence level of the recognized barcode |
Expand Down Expand Up @@ -131,18 +131,34 @@ Value: The code text of the barcode

**Returns:**
java.lang.String
### getCodeText(Charset encoding) {#getCodeText-java.nio.charset.Charset-}
### getCodeText(Charset charset) {#getCodeText-java.nio.charset.Charset-}
```
public String getCodeText(Charset encoding)
public String getCodeText(Charset charset)
```


Gets the code text with encoding.

--------------------

> ```
> This example shows how to use ```
> GetCodeText
> ```:
>
> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
> gen.setCodeText("\u8eca\u7a2e\u540d", Charset.forName("932"));
> gen.save("barcode.png", BarCodeImageFormat.PNG);
>
> BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.DATA_MATRIX);
> for(BarCodeResult result : reader.readBarCodes())
> System.out.println("BarCode CodeText: " + result.getCodeText(Charset.forName("932")));
> ```

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| encoding | java.nio.charset.Charset | The encoding for codetext. |
| charset | java.nio.charset.Charset | The encoding for codetext. |

**Returns:**
java.lang.String - A string containing recognized code text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,34 @@ public boolean getDetectEncoding()
```


The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true. Example BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); generator.setCodeText("\\u0421\\u043b\\u043e\\u0432\\u043e", Charset.forName("UTF-8")); BufferedImage im = generator.generateBarcodeImage(); //detects encoding for Unicode codesets is enabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(true); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText()); //detect encoding is disabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(false); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText());
The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.

--------------------

> ```
> This sample shows how to detect text encoding on the fly if DetectEncoding is enabled
>
>
> ByteArrayOutputStream ms = new ByteArrayOutputStream();
> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR);
> generator.setCodeText("\u0421\u043b\u043e\u0432\u043e", StandardCharsets.UTF_8);
> generator.save(ms, BarCodeImageFormat.PNG);
>
> BarCodeReader reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR);
> reader.getBarcodeSettings().setDetectEncoding(true);
> for (BarCodeResult result : reader.readBarCodes())
> System.out.println("BarCode CodeText: " + result.getCodeText());
> //detect encoding is disabled
> reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR);
> reader.getBarcodeSettings().setDetectEncoding(false);
> for (BarCodeResult result : reader.readBarCodes())
> System.out.println("BarCode CodeText: " + result.getCodeText());
> ```

Value: The flag which force engine to detect codetext encoding for Unicode codesets

**Returns:**
boolean - The flag which force engine to detect codetext encoding for Unicode codesets
boolean
### getStripFNC() {#getStripFNC--}
```
public boolean getStripFNC()
Expand Down Expand Up @@ -143,7 +167,31 @@ public void setDetectEncoding(boolean value)
```


The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true. Example BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "\\u0421\\u043b\\u043e\\u0432\\u043e")) generator.getParameters().getBarcode().getQR().setCodeTextEncoding(Charset.forName("UTF-8")); BufferedImage im = generator.generateBarcodeImage(); //detects encoding for Unicode codesets is enabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(true); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText()); //detect encoding is disabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(false); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText());
The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.

--------------------

> ```
> This sample shows how to detect text encoding on the fly if DetectEncoding is enabled
>
>
> ByteArrayOutputStream ms = new ByteArrayOutputStream();
> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR);
> generator.setCodeText("\u0421\u043b\u043e\u0432\u043e", StandardCharsets.UTF_8);
> generator.save(ms, BarCodeImageFormat.PNG);
>
> BarCodeReader reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR);
> reader.getBarcodeSettings().setDetectEncoding(true);
> for (BarCodeResult result : reader.readBarCodes())
> System.out.println("BarCode CodeText: " + result.getCodeText());
> //detect encoding is disabled
> reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR);
> reader.getBarcodeSettings().setDetectEncoding(false);
> for (BarCodeResult result : reader.readBarCodes())
> System.out.println("BarCode CodeText: " + result.getCodeText());
> ```

Value: The flag which force engine to detect codetext encoding for Unicode codesets

**Parameters:**
| Parameter | Type | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ Base class for MultyDecodeType and SingleDecodeType.
| Method | Description |
| --- | --- |
| [containsAny(BaseDecodeType[] types)](#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Determines whether any of the given decode types is included into |
| [equals(Object obj)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. |
| [equals(MultyDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. |
| [equals(SingleDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. |
| [equals(Object other)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. |
| [getClass()](#getClass--) | |
| [hashCode()](#hashCode--) | |
| [notify()](#notify--) | |
Expand All @@ -54,9 +56,9 @@ Determines whether any of the given decode types is included into

**Returns:**
boolean - Value is a true if any types are included into.
### equals(Object obj) {#equals-java.lang.Object-}
### equals(MultyDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-}
```
public boolean equals(Object obj)
public boolean equals(MultyDecodeType other)
```


Expand All @@ -65,7 +67,37 @@ Returns a value indicating whether this instance is equal to a specified [BaseDe
**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| obj | java.lang.Object | An System.Object value to compare to this instance. |
| other | [MultyDecodeType](../../com.aspose.barcode.barcoderecognition/multydecodetype) | An java.lang.Object value to compare to this instance. |

**Returns:**
boolean - True if obj has the same value as this instance; otherwise, false.
### equals(SingleDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-}
```
public boolean equals(SingleDecodeType other)
```


Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| other | [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) | An java.lang.Object value to compare to this instance. |

**Returns:**
boolean - True if obj has the same value as this instance; otherwise, false.
### equals(Object other) {#equals-java.lang.Object-}
```
public boolean equals(Object other)
```


Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| other | java.lang.Object | An java.lang.Object value to compare to this instance. |

**Returns:**
boolean - True if obj has the same value as this instance; otherwise, false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ Composite decode type.
| [add(SingleDecodeType singleType)](#add-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Adds one more [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) to the MultyDecodeType. |
| [containsAll(BaseDecodeType[] barcodeTypes)](#containsAll-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Check if this contains all types from barcode types. |
| [containsAny(BaseDecodeType[] decodeTypes)](#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Is contain any of types |
| [equals(MultyDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-) | Returns a value indicating whether this instance is equal to a specified value. |
| [equals(SingleDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Returns a value indicating whether this decode types collection contains only specified value. |
| [equals(Object obj)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified MultyDecodeType value. |
| [exclude(SingleDecodeType singleType)](#exclude-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Excludes SingleDecodeType from the MultyDecodeType and returns new MultyDecodeType instance. |
| [getClass()](#getClass--) | |
| [getGetSingleTypesCount()](#getGetSingleTypesCount--) | Returns a number of single types. |
| [getSingleTypes()](#getSingleTypes--) | Represents a list of single types. |
| [getSingleTypesCount()](#getSingleTypesCount--) | Returns a number of single types. |
| [hashCode()](#hashCode--) | Returns the hash code for this instance. |
| [notify()](#notify--) | |
| [notifyAll()](#notifyAll--) | |
Expand Down Expand Up @@ -119,6 +121,36 @@ Is contain any of types

**Returns:**
boolean - Value is a true if any types are included into
### equals(MultyDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-}
```
public boolean equals(MultyDecodeType other)
```


Returns a value indicating whether this instance is equal to a specified value.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| other | [MultyDecodeType](../../com.aspose.barcode.barcoderecognition/multydecodetype) | An java.lang.Object value to compare to this instance. |

**Returns:**
boolean -
### equals(SingleDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-}
```
public boolean equals(SingleDecodeType other)
```


Returns a value indicating whether this decode types collection contains only specified value.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| other | [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) | An java.lang.Object value to compare to this instance. |

**Returns:**
boolean - if this collection contains only specified decode type; otherwise, **false**.
### equals(Object obj) {#equals-java.lang.Object-}
```
public boolean equals(Object obj)
Expand Down Expand Up @@ -159,26 +191,26 @@ public final native Class<?> getClass()

**Returns:**
java.lang.Class<?>
### getGetSingleTypesCount() {#getGetSingleTypesCount--}
### getSingleTypes() {#getSingleTypes--}
```
public int getGetSingleTypesCount()
public List<SingleDecodeType> getSingleTypes()
```


Returns a number of single types.
Represents a list of single types.

**Returns:**
int
### getSingleTypes() {#getSingleTypes--}
java.util.List<com.aspose.barcode.barcoderecognition.SingleDecodeType> - List of single types
### getSingleTypesCount() {#getSingleTypesCount--}
```
public List<SingleDecodeType> getSingleTypes()
public int getSingleTypesCount()
```


Represents a list of single types.
Returns a number of single types.

**Returns:**
java.util.List<com.aspose.barcode.barcoderecognition.SingleDecodeType> - List of single types
int
### hashCode() {#hashCode--}
```
public int hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ Single decode type. See decode type to get instance.
>
> SingleDecodeType singleType = DecodeType.QR
> ```
## Constructors

| Constructor | Description |
| --- | --- |
| [SingleDecodeType(short typeIndex, String typeName)](#SingleDecodeType-short-java.lang.String-) | Initializes a new instance of [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) class by type index and name |
## Methods

| Method | Description |
| --- | --- |
| [containsAny(BaseDecodeType[] types)](#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Returns a value indicating whether this instance is included into the list specified. |
| [equals(MultyDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-) | |
| [equals(SingleDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | |
| [equals(Object obj)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) value. |
| [getClass()](#getClass--) | |
| [getString()](#getString--) | Converts the instance of SingleDecodeType to its equivalent string representation, using the following format: "Index:-1; Name:None". |
Expand All @@ -48,35 +45,51 @@ Single decode type. See decode type to get instance.
| [wait()](#wait--) | |
| [wait(long arg0)](#wait-long-) | |
| [wait(long arg0, int arg1)](#wait-long-int-) | |
### SingleDecodeType(short typeIndex, String typeName) {#SingleDecodeType-short-java.lang.String-}
### containsAny(BaseDecodeType[] types) {#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-}
```
public SingleDecodeType(short typeIndex, String typeName)
public boolean containsAny(BaseDecodeType[] types)
```


Initializes a new instance of [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) class by type index and name
Returns a value indicating whether this instance is included into the list specified.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| typeIndex | short | Gets an index of decode type |
| typeName | java.lang.String | Gets a name of decode type |
| types | [BaseDecodeType\[\]](../../com.aspose.barcode.barcoderecognition/basedecodetype) | Array of single and multy decode types |

### containsAny(BaseDecodeType[] types) {#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-}
**Returns:**
boolean - Value is a true if any types are included into
### equals(MultyDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-}
```
public boolean containsAny(BaseDecodeType[] types)
public boolean equals(MultyDecodeType other)
```


Returns a value indicating whether this instance is included into the list specified.
Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| types | [BaseDecodeType\[\]](../../com.aspose.barcode.barcoderecognition/basedecodetype) | Array of single and multy decode types |
| other | [MultyDecodeType](../../com.aspose.barcode.barcoderecognition/multydecodetype) | |

**Returns:**
boolean - Value is a true if any types are included into
boolean
### equals(SingleDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-}
```
public boolean equals(SingleDecodeType other)
```


Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| other | [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) | |

**Returns:**
boolean
### equals(Object obj) {#equals-java.lang.Object-}
```
public boolean equals(Object obj)
Expand Down
Loading