Json Simple

JSON Simple(also written as json-simple or json.simple) is a pure Java library for encoding and decoding of JSON text. This simple, easy and flexible library is compliance with JSON specification RFC4627 and have no dependency on external libraries. The library is quoted in various publications and Java Development projects. The parser use Lexical analysis for encoding and decoding data.

This first version of library, 1.1, was released on 1st Feb, 2009 and widely adopted. In 2012, the update version, 1.1.1, was released.

Structure

The library consists of two packages:

  1. org.json.simple: This package consists of main object classes like JSONArray, JSONAware, JSONObject, JSONStreamAware, JSONValue, ItemList.
  2. org.json.simple.parser: This package contains classes related to parsing of JSON like ContainerFactory, ContentHandler, JSONParser, ParseException, Yylex and Yyyoken.

Type mapping

JSON.simple uses following mapping of JSON types to Java types:

  • string -> java.lang.String
  • number -> java.lang.Number
  • true|false -> java.lang.Boolean
  • null -> null
  • array -> java.util.List
  • object -> java.util.Map