Skip to content

Commit d77bea8

Browse files
update to internal commit 116e9e9a
1 parent 46a19dd commit d77bea8

File tree

4 files changed

+363
-0
lines changed

4 files changed

+363
-0
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
layout: default-layout
3+
title: ParsedResultItem Class - Dynamsoft Code Parser SDK Android Edition API Reference
4+
description: This page shows ParsedResultItem Class of Dynamsoft Code Parser SDK Android Edition.
5+
keywords: ParsedResultItem, api reference, Android
6+
needAutoGenerateSidebar: true
7+
---
8+
9+
# ParsedResultItem Class
10+
11+
`ParsedResultItem` is the basic unit of a parsed result. It stores the field name, value and additional information.
12+
13+
## Definition
14+
15+
*Namespace:* com.dynamsoft.dcp
16+
17+
*Assembly:* DynamsoftCodeParser.aar
18+
19+
```java
20+
class ParsedResultItem extends CapturedResultItem
21+
```
22+
23+
| Method | Description |
24+
|----------------------|-------------|
25+
| [`getCodeType`](#getcodetype) | Gets the code type of the parsed result. |
26+
| [`getFieldMappingStatus`](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
27+
| [`getFieldValidationStatus`](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. |
28+
| [`getFieldValue`](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
29+
| [`getJsonString`](#getjsonstring) | Gets the parsed result as a JSON formatted string. |
30+
31+
## getCodeType
32+
33+
Gets the code type of the parsed result.
34+
35+
```java
36+
String getCodeType();
37+
```
38+
39+
**Return Value**
40+
41+
Returns a string value representing the code type. It can be one of the following:
42+
43+
- "AADHAAR"
44+
- "AAMVA_DL_ID"
45+
- "AAMVA_DL_ID_WITH_MAG_STRIPE"
46+
- "MRTD_TD1_ID"
47+
- "MRTD_TD2_ID"
48+
- "MRTD_TD2_VISA"
49+
- "MRTD_TD3_PASSPORT"
50+
- "MRTD_TD3_VISA"
51+
- "MRTD_TD2_FRENCH_ID"
52+
- "SOUTH_AFRICA_DL"
53+
- "VIN"
54+
55+
## getJsonString
56+
57+
Gets the parsed result as a JSON formatted string.
58+
59+
```java
60+
String getJsonString();
61+
```
62+
63+
**Return Value**
64+
65+
Returns a JSON formatted string representing the parsed result.
66+
67+
## getFieldValue
68+
69+
Gets the value of a specified field from the parsed result.
70+
71+
```java
72+
String getFieldValue(String fieldName);
73+
```
74+
75+
**Parameters**
76+
77+
`[in] fieldName`: The name of the field.
78+
79+
**Return Value**
80+
81+
Returns a string representing the specified field value.
82+
83+
## getFieldMappingStatus
84+
85+
Gets the mapping status of a specified field from the parsed result. Certain fields in the parsed result, such as the residing province or state, are abbreviated (e.g. BC standing for British Columbia). The library takes such fields and maps them to their full form. If the mapping is successful, the `MappingStatus` will be `MS_SUCCEEDED`. To learn of the other options of `MappingStatus`, please refer to the link below.
86+
87+
```java
88+
EnumMappingStatus getFieldMappingStatus(String fieldName);
89+
```
90+
91+
**Parameters**
92+
93+
`[in] fieldName`: The name of the field.
94+
95+
**Return Value**
96+
97+
Returns a [MappingStatus]({{ site.dcv_enumerations }}code-parser/mapping-status.html?lang=android) enumeration value representing the mapping status of a specified field.
98+
99+
**See Also**
100+
101+
[MappingStatus]({{ site.dcv_enumerations }}code-parser/mapping-status.html?lang=android)
102+
103+
## getFieldValidationStatus
104+
105+
Gets the validation status of a specified field from the parsed result. Certain fields can be validated with one of four possible validation methods: certification, checksum, length, and regex. Whether a field is validated or not, as well as the validation method, is determined by the code specification e.g. AAMVA specification.
106+
107+
```java
108+
EnumValidationStatus getFieldValidationStatus(String fieldName);
109+
```
110+
111+
**Parameters**
112+
113+
`[in] fieldName`: The name of the field.
114+
115+
**Return Value**
116+
117+
Returns a [ValidationStatus]({{ site.dcv_enumerations }}code-parser/validation-status.html?lang=android) enumeration value saying whether the validation of a specified field was successful, failed, or if it did not require validation.
118+
119+
**See Also**
120+
121+
[ValidationStatus]({{ site.dcv_enumerations }}code-parser/validation-status.html?lang=android)
122+
123+
## getParsedFields
124+
125+
Get the field names and values of the parsed fields as a `HashMap`. The field names are stored as the key of the HashMap while the field values are stored as the value.
126+
127+
```java
128+
HashMap<String, String> getParsedFields();
129+
```
130+
131+
**Return Value**
132+
133+
A HashMap that contains the names and values of the parsed fields.

programming/android/api-reference/parsed-result-item.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ParsedResultItem extends CapturedResultItem
2525
| [`getCodeType`](#getcodetype) | Gets the code type of the parsed result. |
2626
| [`getFieldMappingStatus`](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
2727
| [`getFieldValidationStatus`](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. |
28+
| [`getFieldRawValue`](#getfieldrawvalue) | Gets the raw value of the specified field. |
2829
| [`getFieldValue`](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
2930
| [`getJsonString`](#getjsonstring) | Gets the parsed result as a JSON formatted string. |
3031

@@ -64,6 +65,22 @@ String getJsonString();
6465

6566
Returns a JSON formatted string representing the parsed result.
6667

68+
## getFieldRawValue
69+
70+
Gets the raw value of the specified field.
71+
72+
```java
73+
String getFieldRawValue(String fieldName);
74+
```
75+
76+
**Parameters**
77+
78+
`[in] fieldName`: The name of the field.
79+
80+
**Return Value**
81+
82+
Returns a string representing the specified field raw value.
83+
6784
## getFieldValue
6885

6986
Gets the value of a specified field from the parsed result.
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
---
2+
layout: default-layout
3+
title: DSParsedResultItem Class - Dynamsoft Code Parser SDK iOS Edition API Reference
4+
description: This page shows DSParsedResultItem Class of Dynamsoft Code Parser SDK iOS Edition.
5+
keywords: DSParsedResultItem, api reference, iOS
6+
needAutoGenerateSidebar: true
7+
---
8+
9+
10+
# DSParsedResultItem Class
11+
12+
`ParsedResultItem` it the basic unit of a parsed result. It stores the field name, value and additional information.
13+
14+
## Definition
15+
16+
*Assembly:* DynamsoftCodeParser.xcframework
17+
18+
<div class="sample-code-prefix"></div>
19+
>- Objective-C
20+
>- Swift
21+
>
22+
>1.
23+
```objc
24+
@interface DSParsedResultItem: DSCapturedResultItem
25+
```
26+
2.
27+
```swift
28+
class ParsedResultItem : CapturedResultItem
29+
```
30+
31+
## Method Summary
32+
33+
| Method | Description |
34+
| ------ | ----------- |
35+
| [`getFieldMappingStatus`](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
36+
| [`getFieldValidationStatus`](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. |
37+
| [`getFieldValue`](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
38+
39+
## Property Summary
40+
41+
| Property | Type | Description |
42+
| -------- | ---- | ----------- |
43+
| [`codeType`](#codetype) | *NSString* | Gets the code type of the parsed result. |
44+
| [`jsonString`](#jsonstring) | *NSString* | Gets the parsed result as a JSON formatted string. |
45+
| [`parsedFields`](#parsedfields) | *NSDictionary* | A `NSDictionary` object stores the field names and values of the parsed fields. |
46+
47+
## Method Detail
48+
49+
### getFieldMappingStatus
50+
51+
Gets the mapping status of a specified field from the parsed result. Certain fields in the parsed result, such as the residing province or state, are abbreviated (e.g. BC standing for British Columbia). The library takes such fields and maps them to their full form. If the mapping is successful, the `MappingStatus` will be `DSMappingStatusSucceeded`. To learn of the other options of `MappingStatus`, please refer to the link below.
52+
53+
<div class="sample-code-prefix"></div>
54+
>- Objective-C
55+
>- Swift
56+
>
57+
>1.
58+
```objc
59+
- (DSMappingStatus *)getFieldMappingStatus(NSString *)fieldName;
60+
```
61+
2.
62+
```swift
63+
func getFieldMappingStatus(_ fieldName:String) -> MappingStatus
64+
```
65+
66+
**Parameters**
67+
68+
`fieldName`: The name of the field.
69+
70+
**Return Value**
71+
72+
Returns a [MappingStatus]({{ site.dcv_enumerations }}code-parser/mapping-status.html?lang=objc,swift) enumeration value representing the mapping status of a specified field.
73+
74+
### getFieldValidationStatus
75+
76+
Gets the validation status of a specified field from the parsed result. Certain fields can be validated with one of four possible validation methods: certification, checksum, length, and regex. Whether a field is validated or not, as well as the validation method, is determined by the code specification e.g. AAMVA specification.
77+
78+
<div class="sample-code-prefix"></div>
79+
>- Objective-C
80+
>- Swift
81+
>
82+
>1.
83+
```objc
84+
- (DSValidationStatus *)getFieldValidationStatus(NSString *)fieldName;
85+
```
86+
2.
87+
```swift
88+
func getFieldValidationStatus(_ fieldName:String) -> ValidationStatus
89+
```
90+
91+
**Parameters**
92+
93+
`fieldName`: The name of the field.
94+
95+
**Return Value**
96+
97+
Returns a [ValidationStatus]({{ site.dcv_enumerations }}code-parser/validation-status.html?lang=objc,swift) enumeration value saying whether the validation of a specified field was successful, failed, or if it did not require validation..
98+
99+
### getFieldValue
100+
101+
Gets the value of a specified field from the parsed result.
102+
103+
<div class="sample-code-prefix"></div>
104+
>- Objective-C
105+
>- Swift
106+
>
107+
>1.
108+
```objc
109+
- (NSString *)getFieldValue(NSString *)fieldName;
110+
```
111+
2.
112+
```swift
113+
func getFieldValue(_ fieldName:String) -> String
114+
```
115+
116+
**Parameters**
117+
118+
`fieldName`: The name of the field.
119+
120+
**Return Value**
121+
122+
Returns a string representing the specified field value.
123+
124+
## Property Detail
125+
126+
### codeType
127+
128+
Returns the code type of the parsed result. It can be one of the following:
129+
130+
- "AADHAAR"
131+
- "AAMVA_DL_ID"
132+
- "AAMVA_DL_ID_WITH_MAG_STRIPE"
133+
- "MRTD_TD1_ID"
134+
- "MRTD_TD2_ID"
135+
- "MRTD_TD2_VISA"
136+
- "MRTD_TD3_PASSPORT"
137+
- "MRTD_TD3_VISA"
138+
- "MRTD_TD2_FRENCH_ID"
139+
- "SOUTH_AFRICA_DL"
140+
- "VIN"
141+
142+
<div class="sample-code-prefix"></div>
143+
>- Objective-C
144+
>- Swift
145+
>
146+
>1.
147+
```objc
148+
@property (nonatomic, readonly) NSString * codeType;
149+
```
150+
2.
151+
```swift
152+
var codeType: String? { get }
153+
```
154+
155+
### jsonString
156+
157+
The parsed result as a JSON formatted string.
158+
159+
<div class="sample-code-prefix"></div>
160+
>- Objective-C
161+
>- Swift
162+
>
163+
>1.
164+
```objc
165+
@property (nonatomic, readonly) NSString * jsonString;
166+
```
167+
2.
168+
```swift
169+
var jsonString: String? { get }
170+
```
171+
172+
### parsedFields
173+
174+
A `NSDictionary` object stores the field names and values of the parsed fields. The field names are stored as the key of the HashMap while the field values are stored as the value.
175+
176+
<div class="sample-code-prefix"></div>
177+
>- Objective-C
178+
>- Swift
179+
>
180+
>1.
181+
```objc
182+
@property (nonatomic, readonly) NSDictionary<NSString *, NSString *> * parsedFields;
183+
```
184+
2.
185+
```swift
186+
var parsedFields: NSDictionary { get }
187+
```

programming/ios/api-reference/parsed-result-item.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class ParsedResultItem : CapturedResultItem
3434
| ------ | ----------- |
3535
| [`getFieldMappingStatus`](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
3636
| [`getFieldValidationStatus`](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. |
37+
| [`getFieldRawValue`](#getfieldrawvalue) | Gets the raw value of the specified field. |
3738
| [`getFieldValue`](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
3839

3940
## Property Summary
@@ -96,6 +97,31 @@ func getFieldValidationStatus(_ fieldName:String) -> ValidationStatus
9697

9798
Returns a [ValidationStatus]({{ site.dcv_enumerations }}code-parser/validation-status.html?lang=objc,swift) enumeration value saying whether the validation of a specified field was successful, failed, or if it did not require validation..
9899

100+
### getFieldRawValue
101+
102+
Gets the raw value of the specified field.
103+
104+
<div class="sample-code-prefix"></div>
105+
>- Objective-C
106+
>- Swift
107+
>
108+
>1.
109+
```objc
110+
- (NSString *)getFieldRawValue(NSString *)fieldName;
111+
```
112+
2.
113+
```swift
114+
func getFieldRawValue(_ fieldName:String) -> String
115+
```
116+
117+
**Parameters**
118+
119+
`fieldName`: The name of the field.
120+
121+
**Return Value**
122+
123+
Returns a string representing the specified field raw value.
124+
99125
### getFieldValue
100126

101127
Gets the value of a specified field from the parsed result.

0 commit comments

Comments
 (0)