diff --git a/programming/java/api-reference/code-parser-module.md b/programming/java/api-reference/code-parser-module.md new file mode 100644 index 0000000..dd0726a --- /dev/null +++ b/programming/java/api-reference/code-parser-module.md @@ -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. + diff --git a/programming/java/api-reference/code-parser.md b/programming/java/api-reference/code-parser.md new file mode 100644 index 0000000..995bc96 --- /dev/null +++ b/programming/java/api-reference/code-parser.md @@ -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) diff --git a/programming/java/api-reference/enum-code-type.md b/programming/java/api-reference/enum-code-type.md new file mode 100644 index 0000000..1afe87d --- /dev/null +++ b/programming/java/api-reference/enum-code-type.md @@ -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"; +} +``` diff --git a/programming/java/api-reference/enum-mapping-status.md b/programming/java/api-reference/enum-mapping-status.md new file mode 100644 index 0000000..3a91aad --- /dev/null +++ b/programming/java/api-reference/enum-mapping-status.md @@ -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; +} +``` diff --git a/programming/java/api-reference/enum-validation-status.md b/programming/java/api-reference/enum-validation-status.md new file mode 100644 index 0000000..a0ed0df --- /dev/null +++ b/programming/java/api-reference/enum-validation-status.md @@ -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; +} +``` diff --git a/programming/java/api-reference/parsed-result-item.md b/programming/java/api-reference/parsed-result-item.md new file mode 100644 index 0000000..6125446 --- /dev/null +++ b/programming/java/api-reference/parsed-result-item.md @@ -0,0 +1,160 @@ +--- +layout: default-layout +title: ParsedResultItem Class - Dynamsoft Code Parser Module Java Edition API Reference +description: Definition of the ParsedResultItem class in Dynamsoft Code Parser Module Java Edition. +keywords: ParsedResultItem, api reference, java +needAutoGenerateSidebar: true +--- + +# ParsedResultItem Class + +The `ParsedResultItem` class represents a parsed result item generated by code parser engine. + +## Definition + +*Package:* com.dynamsoft.dcp + +*Inheritance:* [CapturedResultItem]({{ site.dcvb_java_api }}core/basic-classes/captured-result-item.html) -> ParsedResultItem + +```java +public class ParsedResultItem extends CapturedResultItem +``` + +## Methods + +| Method | Description | +|----------------------|-------------| +| [`getCodeType`](#getcodetype) | Gets the code type of the parsed result. | +| [`getFieldValue`](#getfieldvalue) | Gets the value of a specified field from the parsed result. | +| [`getFieldMappingStatus`](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. | +| [`getFieldValidationStatus`](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. | +| [`getJsonString`](#getjsonstring) | Gets the parsed result as a JSON formatted string. | +| [`getFieldRawValue`](#getfieldrawvalue) | Gets the raw string of a specified field from the parsed result. | +| [`getFieldCount`](#getfieldcount) | Gets the count of parsed fields. | +| [`getFieldName`](#getfieldname) | Gets the name of a field at the specified index. | + +### getCodeType + +Gets the code type of the parsed result. + +```java +public String getCodeType() +``` + +**Return Value** + +Returns a string value representing the code type. + +### getFieldValue + +Gets the value of a specified field from the parsed result. + +```java +public String getFieldValue(String fieldName) +``` + +**Parameters** + +`fieldName` The name of the field. + +**Return Value** + +Returns a string representing the specified field value. + +### getFieldMappingStatus + +Gets the mapping status of a specified field from the parsed result. + +```java +public @EnumMappingStatus int getFieldMappingStatus(String fieldName) +``` + +**Parameters** + +`fieldName` The name of the field. + +**Return Value** + +Returns an `EnumMappingStatus` value representing the mapping status of a specified field. + +**See Also** + +[EnumMappingStatus]({{ site.dcp_java_api }}enum-mapping-status.html) + +### getFieldValidationStatus + +Gets the validation status of a specified field from the parsed result. + +```java +public @EnumValidationStatus int getFieldValidationStatus(String fieldName) +``` + +**Parameters** + +`fieldName` The name of the field. + +**Return Value** + +Returns an `EnumValidationStatus` value representing the validation status of a specified field. + +**See Also** + +[EnumValidationStatus]({{ site.dcp_java_api }}enum-validation-status.html) + +### getJsonString + +Gets the parsed result as a JSON formatted string. + +```java +public String getJsonString() +``` + +**Return Value** + +Returns a JSON formatted string representing the full parsed result. + +### getFieldRawValue + +Gets the raw string of a specified field from the parsed result. + +```java +public String getFieldRawValue(String fieldName) +``` + +**Parameters** + +`fieldName` The name of the field. + +**Return Value** + +Returns a string representing the specified field raw string. + +### getFieldCount + +Gets the count of parsed fields. + +```java +public int getFieldCount() +``` + +**Return Value** + +Returns an integer representing the count of parsed fields. + +### getFieldName + +Gets the name of a field at the specified index. + +```java +public String getFieldName(int index) +``` + +**Parameters** + +`index` The index of the field. + +**Return Value** + +Returns a string representing the field name at the specified index. + +If the field is nested, the name includes all parent fields, separated by a dot (.). The format follows this pattern: [.[....]] diff --git a/programming/java/api-reference/parsed-result.md b/programming/java/api-reference/parsed-result.md new file mode 100644 index 0000000..8846123 --- /dev/null +++ b/programming/java/api-reference/parsed-result.md @@ -0,0 +1,75 @@ +--- +layout: default-layout +title: ParsedResult Class - Dynamsoft Code Parser Module Java Edition API Reference +description: Definition of the ParsedResult class in Dynamsoft Code Parser Module Java Edition. +keywords: ParsedResult, api reference, java +--- + +# ParsedResult Class + +The `ParsedResult` class represents the results of a code parser process. + +## Definition + +*Package:* com.dynamsoft.dcp + +```java +public class ParsedResult extends CapturedResultBase +``` + +## Methods + +| Method | Description | +|----------------------|-------------| +| [`getItemsCount`](#getitemscount) | Gets the count of parsed result items. | +| [`getItem`](#getitem) | Gets a parsed result item at the specified index. | +| [`getItems`](#getitems) | Gets all the parsed result items. | + +### getItemsCount + +Gets the count of parsed result items. + +```java +public int getItemsCount() +``` + +**Return Value** + +Returns the number of parsed result items. + +### getItem + +Gets a parsed result item at the specified index. + +```java +public ParsedResultItem getItem(int index) +``` + +**Parameters** + +`index` The index of the parsed result item. + +**Return Value** + +Returns a `ParsedResultItem` object at the specified index. + +**See Also** + +[ParsedResultItem]({{ site.dcp_java_api }}parsed-result-item.html) + +### getItems + +Gets all the parsed result items. + +```java +public ParsedResultItem[] getItems() +``` + +**Return Value** + +Returns an array of `ParsedResultItem` objects. + +**See Also** + +[ParsedResultItem]({{ site.dcp_java_api }}parsed-result-item.html) +