mirror of
https://github.com/fangyidong/json-simple.git
synced 2025-12-06 23:40:52 +03:00
Updated Home (markdown)
46
Home.md
46
Home.md
@@ -1,45 +1,39 @@
|
||||
### Features
|
||||
* Full compliance with [JSON specification](http://www.ietf.org/rfc/rfc4627.txt) (RFC4627) and reliable (see [[compliance testing|ComplianceTesting]])
|
||||
|
||||
* Provides multiple functionalities such as encode, decode/parse and escape JSON text while keeping the library lightweight
|
||||
|
||||
* Flexible, simple and easy to use by reusing Map and List interfaces
|
||||
|
||||
* Supports streaming output of JSON text
|
||||
|
||||
* Stoppable SAX-like interface for streaming input of JSON text (learn [http://code.google.com/p/json-simple/wiki/DecodingExamples#Example_5_-_Stoppable_SAX-like_content_handler more])
|
||||
|
||||
* Stoppable SAX-like interface for streaming input of JSON text (learn [[more|DecodingExamples#Example_5_-_Stoppable_SAX-like_content_handler]])
|
||||
* Heap based parser
|
||||
|
||||
* High performance (see [PerformanceTesting performance testing])
|
||||
|
||||
* No dependency on external libraries
|
||||
|
||||
* Both of the source code and the binary are JDK1.2 compatible
|
||||
|
||||
### Getting Started
|
||||
Note: You need to put the latest [http://json-simple.googlecode.com/files/json-simple-1.1.1.jar json-simple-1.1.1.jar] in your CLASSPATH before compiling and running the example codes.
|
||||
Note: You need to put the latest json-simple-version.jar in your CLASSPATH before compiling and running the example codes.
|
||||
|
||||
* [EncodingExamples Encoding Examples]
|
||||
* [DecodingExamples Decoding Examples]
|
||||
* [EscapingExamples Escaping Examples]
|
||||
* [JSPAndAJAXExamples JSP and AJAX Examples]
|
||||
* [[Encoding Examples|EncodingExamples]]
|
||||
* [[Decoding Examples|DecodingExamples]]
|
||||
* [[Escaping Examples|EscapingExamples]]
|
||||
* [[JSP and AJAX Examples|JSPAndAJAXExamples]]
|
||||
|
||||
### Mapping Between JSON and Java Entities
|
||||
|| *JSON* || *Java* ||
|
||||
|| string || java.lang.String ||
|
||||
|| number || java.lang.Number ||
|
||||
|| true|false || java.lang.Boolean ||
|
||||
|| null || null ||
|
||||
|| array || java.util.List ||
|
||||
|| object || java.util.Map ||
|
||||
|
||||
JSON.simple maps entities from the left side to the right side while decoding or parsing, and maps entities from the right to the left while encoding. While decoding, default concrete class of java.util.List is org.json.simple.JSONArray and default concrete class of java.util.Map is org.json.simple.JSONObject. While encoding, other classes that are not listed on the right side of the table need to implement [http://code.google.com/p/json-simple/source/browse/trunk/src/org/json/simple/JSONAware.java JSONAware] or [http://code.google.com/p/json-simple/source/browse/trunk/src/org/json/simple/JSONStreamAware.java JSONStreamAware] (streaming only) to [http://code.google.com/p/json-simple/wiki/EncodingExamples#Example_6-1_-_Customize_JSON_outputs customize] JSON outputs. In such cases, JSON.simple calls JSONAware.toJSONString() or JSONStreamAware.writeJSONString() to determine the resulting JSON text.
|
||||
| JSON | Java |
|
||||
| ------------- |:----------------:|
|
||||
| string | java.lang.String |
|
||||
| number | java.lang.Number |
|
||||
| true|false | java.lang.Boolean|
|
||||
| null | null |
|
||||
| array | java.util.List |
|
||||
| object | java.util.Map |
|
||||
|
||||
JSON.simple maps entities from the left side to the right side while decoding or parsing, and maps entities from the right to the left while encoding. While decoding, default concrete class of java.util.List is org.json.simple.JSONArray and default concrete class of java.util.Map is org.json.simple.JSONObject. While encoding, other classes that are not listed on the right side of the table need to implement [JSONAware](https://github.com/fangyidong/json-simple/blob/master/src/main/java/org/json/simple/JSONAware.java) or [JSONStreamAware](https://github.com/fangyidong/json-simple/blob/master/src/main/java/org/json/simple/JSONStreamAware.java) (streaming only) to [[customize|EncodingExamples#Example_6-1_-_Customize_JSON_outputs]] JSON outputs. In such cases, JSON.simple calls JSONAware.toJSONString() or JSONStreamAware.writeJSONString() to determine the resulting JSON text.
|
||||
|
||||
### Maven Repository
|
||||
* [JSONSimpleInCentralMavenRepository JSON.simple in central maven repository]
|
||||
* [[JSON.simple in central maven repository|JSONSimpleInCentralMavenRepository]]
|
||||
|
||||
### Developer's Guide
|
||||
* [BuildWithAnt Build With Ant]
|
||||
* [BuildWithEclipse Build With Eclipse]
|
||||
* [Lexer The JSON Lexer]
|
||||
* [[Build With Ant|BuildWithAnt]]
|
||||
* [[Build With Eclipse|BuildWithEclipse]]
|
||||
* [[The JSON Lexer|Lexer]]
|
||||
|
||||
Reference in New Issue
Block a user