`

simple json lib for java

阅读更多

有时候为了需要将一个对象或数组转成json string 给前台需要用开json util 类,为了这个类我们又必须加入一大堆的其他类(jdk1.3),其实可以用simple json这个类库:

 

Featured downloads:
json_simple-1.1-all.zip

json_simple-1.1.jar

Overview

JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text.

Features

  • 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 more )
  • Heap based parser
  • 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 json_simple-1.1.jar in your CLASSPATH before compiling and running the example codes.

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 JSONAware or JSONStreamAware (streaming only) to customize JSON outputs. In such cases, JSON.simple calls JSONAware.toJSONString() or JSONStreamAware.writeJSONString() to determine the resulting JSON text.

Developer's Guide

JSON.simple in Projects

JSON.simple in Publications

Next Steps

Links

分享到:
评论

相关推荐

    各种lib for Java

    json_simple-1.1.jar jsoup-1.7.2.jar jstl-1.2.jar jxl.jar kaptcha-2.3.2-jdk14.jar kaptcha-2.3.2.jar lib.txt log4j-1.2.16.jar mysql-connector-java-5.1.17-bin.jar ojdbc14.jar org.json.jar ...

    json-simple-1.1.1.jar_java_JSONSimple_

    a lib for parsing JSON.

    json所需JAR包合集

    commons-beanutils.jar不加这个包 java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean ...json-lib-2.3-jdk15.jar不加这个包 java.lang.NoClassDefFoundError: net/sf/json/JSONObject

    java-webservice-json需要相关jar包(commons-beanutils,commons-lang-r,ezmorph

    使用java编写webservice时,使用了json参数,则调用jar包,包括:commons-beanutils-1.7.0.jar,commons-lang-2.2.jar,ezmorph-1.0.5.jar,json_simple.jar,org.json.jar

    org.json.JSONObject jar包

    org.json.JSONObject的6个jar包 commons-beanutils;commons-collections;commons-lang;commons-logging;ezmorph;json-lib

    JAVA上百实例源码以及开源项目

     Java局域网通信——飞鸽传书源代码,大家都知道VB版、VC版还有Delphi版的飞鸽传书软件,但是Java版的确实不多,因此这个Java文件传输实例不可错过,Java网络编程技能的提升很有帮助。 Java聊天程序,包括服务端和...

    JAVA上百实例源码以及开源项目源代码

    Java 源码包 Applet钢琴模拟程序java源码 2个目标文件,提供基本的音乐编辑功能。编辑音乐软件的朋友,这款实例会对你有所帮助。 Calendar万年历 1个目标文件 EJB 模拟银行ATM流程及操作源代码 6个目标文件,EJB来...

    java开源包4

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包101

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包11

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包6

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包9

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包8

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包5

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包10

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包1

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包3

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    json-schema-md-doc:生成JSON模式的降价文档

    json-schema-md-doc生成JSON模式... Java脚本 // simple schema for the exampleconst colors_schema = {"description" : "Choose a color" ,"type" : "string" ,"enum" : [ "red" , "amber" , "green" ]}// create an

    java开源包2

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

    java开源包7

    fat32-lib 是一个用来读写 FAT 16/32 格式文件系统的纯 Java 类库(纯的)。 Eclipse的HTML格式化插件 Eclipse Tidy Eclipse HTML Tidy 是一款 Eclipse 的插件,用来对 HTML 文件内容进行清洗和格式化处理。它采用...

Global site tag (gtag.js) - Google Analytics