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
39 changes: 39 additions & 0 deletions programming/java/api-reference/code-parser-module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: default-layout
title: CodeParserModule Class - Dynamsoft Code Parser Module Java Edition API Reference
description: Definition of the CodeParserModule class in Dynamsoft Code Parser Module Java Edition.
keywords: CodeParserModule, api reference, java
needAutoGenerateSidebar: true
---

# CodeParserModule Class

The `CodeParserModule` class defines general functions in the code parser module.

## Definition

*Package:* com.dynamsoft.dcp

```java
public final class CodeParserModule
```

## Methods

| Method | Description |
|----------------------|-------------|
| [`getVersion`](#getversion) | Returns the version of the code parser module.|


### getVersion

Returns the version of the code parser module.

```java
public static String getVersion()
```

**Return Value**

Returns a string representing the version of the code parser module.

147 changes: 147 additions & 0 deletions programming/java/api-reference/code-parser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
layout: default-layout
title: CodeParser Class - Dynamsoft Code Parser Module Java Edition API Reference
description: Definition of the CodeParser class in Dynamsoft Code Parser Module Java Edition.
keywords: CodeParser, api reference, java
needAutoGenerateSidebar: true
---

# CodeParser Class

The `CodeParser` class provides functionality for parsing codes from byte data.

## Definition

*Package:* com.dynamsoft.dcp

```java
public class CodeParser
```

## Constructors

| Constructor | Description |
|---------------------------|-------------|
| [`CodeParser`](#codeparser) | Constructor to create a new CodeParser instance.|

## Methods

| Method | Description |
|----------------------|-------------|
| [`Parse`](#parse) | Parses code from byte data. |
| [`InitSettings`](#initsettings) | Initializes the code parser with JSON settings. |
| [`InitSettingsFromFile`](#initsettingsfromfile) | Initializes the code parser with settings from a file. |
| [`ResetSettings`](#resetsettings) | Resets the code parser settings to default. |

### CodeParser

Constructor to create a new CodeParser instance.

```java
public CodeParser()
```

### Parse

Parses code from byte data.

```java
public ParsedResultItem Parse(byte[] data) throws CodeParserException
```

**Parameters**

`data` The byte array containing the data to parse.

**Return Value**

Returns a `ParsedResultItem` object containing the parsed result.

**Exceptions**

`CodeParserException` Thrown when an error occurs during parsing.

**See Also**

[ParsedResultItem]({{ site.dcp_java_api }}parsed-result-item.html)
[CodeParserException]({{ site.dcp_java_api }}code-parser-exception.html)

---

```java
public ParsedResultItem Parse(byte[] data, String taskSettingName) throws CodeParserException
```

**Parameters**

`data` The byte array containing the data to parse.
`taskSettingName` The name of the task setting to use for parsing.

**Return Value**

Returns a `ParsedResultItem` object containing the parsed result.

**Exceptions**

`CodeParserException` Thrown when an error occurs during parsing.

**See Also**

[ParsedResultItem]({{ site.dcp_java_api }}parsed-result-item.html)
[CodeParserException]({{ site.dcp_java_api }}code-parser-exception.html)

### InitSettings

Initializes the code parser with JSON settings.

```java
public void InitSettings(String content) throws CodeParserException
```

**Parameters**

`content` A JSON string containing the settings.

**Exceptions**

`CodeParserException` Thrown when an error occurs during initialization.

**See Also**

[CodeParserException]({{ site.dcp_java_api }}code-parser-exception.html)

### InitSettingsFromFile

Initializes the code parser with settings from a file.

```java
public void InitSettingsFromFile(String filePath) throws CodeParserException
```

**Parameters**

`filePath` The path to the file containing the settings.

**Exceptions**

`CodeParserException` Thrown when an error occurs during initialization.

**See Also**

[CodeParserException]({{ site.dcp_java_api }}code-parser-exception.html)

### ResetSettings

Resets the code parser settings to default.

```java
public void ResetSettings() throws CodeParserException
```

**Exceptions**

`CodeParserException` Thrown when an error occurs during reset.

**See Also**

[CodeParserException]({{ site.dcp_java_api }}code-parser-exception.html)
39 changes: 39 additions & 0 deletions programming/java/api-reference/enum-code-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: default-layout
title: CodeType - Dynamsoft Code Parser Java Enumerations
description: The enumeration CodeType of Dynamsoft Code Parser represents all supported code type strings.
keywords: code type, java
---

# CodeType

The `CodeType` class enumerates all supported code type strings.

```java
public @interface EnumCodeType {
//The code type string is "MRTD_TD1_ID"
String CT_MRTD_TD1_ID = "MRTD_TD1_ID";
//The code type string is "MRTD_TD2_ID"
String CT_MRTD_TD2_ID = "MRTD_TD2_ID";
//The code type string is "MRTD_TD2_VISA"
String CT_MRTD_TD2_VISA = "MRTD_TD2_VISA";
//The code type string is "MRTD_TD3_PASSPORT"
String CT_MRTD_TD3_PASSPORT = "MRTD_TD3_PASSPORT";
//The code type string is "MRTD_TD3_VISA"
String CT_MRTD_TD3_VISA = "MRTD_TD3_VISA";
//The code type string is "MRTD_TD2_FRENCH_ID"
String CT_MRTD_TD2_FRENCH_ID = "MRTD_TD2_FRENCH_ID";
//The code type string is "AAMVA_DL_ID"
String CT_AAMVA_DL_ID = "AAMVA_DL_ID";
//The code type string is "AAMVA_DL_ID_WITH_MAG_STRIPE"
String CT_AAMVA_DL_ID_WITH_MAG_STRIPE = "AAMVA_DL_ID_WITH_MAG_STRIPE";
//The code type string is "SOUTH_AFRICA_DL"
String CT_SOUTH_AFRICA_DL = "SOUTH_AFRICA_DL";
//The code type string is "AADHAAR"
String CT_AADHAAR = "AADHAAR";
//The code type string is "VIN"
String CT_VIN = "VIN";
//The code type string is "GS1_AI"
String CT_GS1_AI = "GS1_AI";
}
```
22 changes: 22 additions & 0 deletions programming/java/api-reference/enum-mapping-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: default-layout
title: MappingStatus - Dynamsoft Code Parser Java Enumerations
description: The enumeration MappingStatus of Dynamsoft Code Parser represents the outcome of a mapping operation on a field.
keywords: Mapping status
---

# Enumeration MappingStatus

`MappingStatus` represents the outcome of a mapping operation on a field.

```java
@Retention(RetentionPolicy.CLASS)
public @interface EnumMappingStatus {
//The field has no mapping specified.
int MS_NONE = 0;
//Find a mapping for the field value.
int MS_SUCCEEDED = 1;
//Failed to find a mapping for the field value.
int MS_FAILED = 2;
}
```
22 changes: 22 additions & 0 deletions programming/java/api-reference/enum-validation-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
layout: default-layout
title: ValidationStatus - Dynamsoft Code Parser Java Enumerations
description: The enumeration ValidationStatus of Dynamsoft Code Parser describes the outcome of a validation process on a field.
keywords: Validation status
---

# Enumeration ValidationStatus

`ValidationStatus` describes the outcome of a validation process on a field.

```java
@Retention(RetentionPolicy.CLASS)
public @interface EnumValidationStatus {
//The field has no validation specified.
int VS_NONE = 0;
//The validation for the field has been succeeded.
int VS_SUCCEEDED = 1;
//The validation for the field has been failed.
int VS_FAILED = 2;
}
```
Loading