25
25
import io .ballerina .runtime .api .utils .JsonUtils ;
26
26
import io .ballerina .runtime .api .values .BArray ;
27
27
import io .ballerina .runtime .api .values .BError ;
28
+ import io .ballerina .runtime .api .values .BMap ;
28
29
import io .ballerina .runtime .api .values .BObject ;
29
30
import io .ballerina .runtime .api .values .BStream ;
30
31
import io .ballerina .runtime .api .values .BString ;
41
42
*/
42
43
public class Native {
43
44
44
- public static Object parseAsType (Object json , Object options , BTypedesc typed ) {
45
+ public static Object parseAsType (Object json , BMap < BString , Object > options , BTypedesc typed ) {
45
46
try {
46
47
return JsonTraverse .traverse (json , options , typed .getDescribingType ());
47
48
} catch (BError e ) {
48
49
return e ;
49
50
}
50
51
}
51
52
52
- public static Object parseString (BString json , Object options , BTypedesc typed ) {
53
+ public static Object parseString (BString json , BMap < BString , Object > options , BTypedesc typed ) {
53
54
try {
54
55
return JsonParser .parse (new StringReader (json .getValue ()), options , typed .getDescribingType ());
55
56
} catch (BError e ) {
56
57
return e ;
57
58
}
58
59
}
59
60
60
- public static Object parseBytes (BArray json , Object options , BTypedesc typed ) {
61
+ public static Object parseBytes (BArray json , BMap < BString , Object > options , BTypedesc typed ) {
61
62
try {
62
63
byte [] bytes = json .getBytes ();
63
64
return JsonParser .parse (new InputStreamReader (new ByteArrayInputStream (bytes )), options ,
@@ -67,7 +68,7 @@ public static Object parseBytes(BArray json, Object options, BTypedesc typed) {
67
68
}
68
69
}
69
70
70
- public static Object parseStream (Environment env , BStream json , Object options , BTypedesc typed ) {
71
+ public static Object parseStream (Environment env , BStream json , BMap < BString , Object > options , BTypedesc typed ) {
71
72
final BObject iteratorObj = json .getIteratorObj ();
72
73
final Future future = env .markAsync ();
73
74
DataReaderTask task = new DataReaderTask (env , iteratorObj , future , typed , options );
0 commit comments