#Fastjson | Apaceh 2.0 | ##https://github.com/alibaba/fastjson |
Gson | Apaceh 2.0 | ## https ://github.com/google/gson |
##JacksonApaceh 2.0 | | #https://github. com /FasterXML/jackson-core |
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.11</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.51.android</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
</dependency>
import com.alibaba.fastjson.*;
JSONObject jsonObj = JSON.parseObject(jsonStr);
import com.alibaba.fastjson.JSON;
Model model = JSON.parseObject(jsonStr, Model.class
import com.alibaba.fastjson.JSON;
Type type = new TypeReference<List<Model>>() {}.getType();
List<Model> list = JSON.parseObject(jsonStr, type);
import com.alibaba.fastjson.JSON;
Model model = ...;
String jsonStr = JSON.toJSONString(model);
import com.alibaba.fastjson.JSON;
Model model = ...;
byte[] jsonBytes = JSON.toJSONBytes(model)
import com.alibaba.fastjson.JSON;
Model model = ...;
OutputStream os;
JSON.writeJSONString(os, model);;
import com.alibaba.fastjson.JSON;
Model model = ...;
Writer writer = ...;
JSON.writeJSONString(writer, model);
############## ###### ####部落格######## ###########關於################################################### ###### ##############