Stats

10 Contributors: 1 Tuesday, July 25, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap
Download eBook

Fastjson

Download android eBook

Introduction

Fastjson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object.

Fastjson Features:

Provide best performance in server side and android client

Provide simple toJSONString() and parseObject() methods to convert Java objects to JSON and vice-versa

Allow pre-existing unmodifiable objects to be converted to and from JSON

Extensive support of Java Generics

Syntax

  • Object parse(String text)
  • JSONObject parseObject(String text)
  • T parseObject(String text, Class<T> clazz)
  • JSONArray parseArray(String text)
  • <T> List<T> parseArray(String text, Class<T> clazz)
  • String toJSONString(Object object)
  • String toJSONString(Object object, boolean prettyFormat)
  • Object toJSON(Object javaObject)

Related Examples