Skip to content

Commit 3a7c691

Browse files
committed
upgrade java-json-api to v1.2.0
1 parent 99cada0 commit 3a7c691

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ To install the library add:
1414
maven { url "https://jitpack.io" }
1515
}
1616
dependencies {
17-
compile 'com.github.webee:fastjson-json-api-android:v1.1.0'
17+
compile 'com.github.webee:fastjson-json-api-android:v1.2.0'
1818
}
1919
```

fastjson-json-api-android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
})
3333
compile 'com.android.support:appcompat-v7:24.2.1'
3434
compile 'com.alibaba:fastjson:1.1.55.android'
35-
compile 'com.github.webee:java-json-api:v1.1.0'
35+
compile 'com.github.webee:java-json-api:v1.2.0'
3636
testCompile 'junit:junit:4.12'
3737
}
3838

fastjson-json-api-android/src/main/java/com/github/webee/fastjson/fastjsonJSON.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.github.webee.fastjson;
22

3+
import java.util.Arrays;
4+
import java.util.Map;
5+
36
/**
47
* Created by webee on 16/11/25.
58
*/
@@ -10,11 +13,21 @@ public com.github.webee.json.JSONObject newObject() {
1013
return new JSONObject(new com.alibaba.fastjson.JSONObject());
1114
}
1215

16+
@Override
17+
public com.github.webee.json.JSONObject newObject(Map<String, Object> map) {
18+
return new JSONObject(new com.alibaba.fastjson.JSONObject(map));
19+
}
20+
1321
@Override
1422
public com.github.webee.json.JSONArray newArray() {
1523
return new JSONArray(new com.alibaba.fastjson.JSONArray());
1624
}
1725

26+
@Override
27+
public com.github.webee.json.JSONArray newArray(Object[] array) {
28+
return new JSONArray(new com.alibaba.fastjson.JSONArray(Arrays.asList(array)));
29+
}
30+
1831
@Override
1932
public Object parse(String text) {
2033
return com.alibaba.fastjson.JSON.parse(text);

0 commit comments

Comments
 (0)