A brief introduction to the--json-lib of the Json experience (i.)

Source: Internet
Author: User

The first part of the basic dependency, the transformation between the data structure to explain.

Json-lib can convert the Beans,maps,collections,java arrays,xml to JSON and then convert the JSON to Beans,dynabeans.

The conversion relationship between Java,javascript and JSON

String <=> Java.lang.String, Java.lang.Character, Char
Number <=> Java.lang.Number, Byte, short, int, long, float, double
True|false <=> Java.lang.Boolean, Boolean
Null <=> Null
function <=> Net.sf.json.JSONFunction
Array <=> Net.sf.json.JSONArray (object, String, number, Boolean, function)
Object <=> Net.sf.json.JSONObject

There are two kinds of json-lib, one is json-lib-x.x-jdk12, need JDK 1.3.1 and above, one is json-lib-x.x-jdk15 need jdk15, and the above version.

Dependent Packages:

    • Jakarta Commons-lang 2.5
    • Jakarta commons-beanutils 1.8.0
    • Jakarta commons-collections 3.2.1
    • Jakarta commons-logging 1.1.1
    • Ezmorph 1.0.6

These dependent packages, not less, such as Ezmorph, a disadvantage of this json-lib is more dependent, easy to lose. and dependent on the version number to the upper, Commons package some high version introduced incompatible, I introduced Lang3 and Beanutils 2 is not, so the version number to the upper.

I put some of my pro-test can be in the jar to share the Baidu network disk, click on the above dependent jar package is, but the version may not be exactly the same, but all can be used.

json-lib-jdk1.5 finally is Json-lib package, convenient for everyone to download, you can also go to the official website to download.

A brief introduction to the--json-lib of the Json experience (i.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.