`
dato0123
  • 浏览: 914401 次
文章分类
社区版块
存档分类
最新评论

What is JSON ?

 
阅读更多

What is JSON ?

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.
These properties make JSON an ideal data-interchange language.

Welcome to Json-lib

JSON-lib is a java library for transforming beans, maps, collections, java arrays and XML to JSON and back again to beans and DynaBeans.
It is based on the work by Douglas Crockford in http://www.json.org/java .

The following tables sumarizes the types conversion between java and javascript:

JSON Java
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

The function type from javascript is not part of the JSON format "officially" (please refer to http://www.json.org ) but it is supported as well.

Json-lib comes in two flavors, depending on the jdk compatibility. json-lib-x.x-jdk13 is compatible with JDK 1.3.1 and upwards. json-lib-x.x-jdk15 is compatible with JDK 1.5, includes support for Enums in JSONArray and JSONObject. Please reffer to the appropriate javadoc links available in the project menu.

Json-lib requires (at least) the following dependencies in your classpath:

  • 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

Other dependencies are needed if working with XML andGroovy. Please review the Dependencies report to know more about those extra dependencies.

分享到:
评论

相关推荐

    JSON 的正确用法探讨:Pyhong、MongoDB、JavaScript与Ajax

    关于本文 本文主要总结网站编写以来在传递 JSON 数据方面遇到的一些问题以及目前采用的解决方案。网站数据库采用 MongoDB...1. What is JSON? JSON(JavaScript Object Notation) 是一种由道格拉斯·克罗克福特构想设

    2017_12_Redfish_Introduction_and_Overview.pdf

    2017年12月份DMTF发布的Redfish介绍和综述 主要内容包括: Why REST, HTTP and JSON? What is Redfish? Redfish Resource Map (simplified) 以及发展和相关的接口介绍

    barely_json:用于仅看起来像JSON的数据的Python解析器

    print(parse('[what is this?, , {perhaps, json: no}]')) # Prints ['what is this?', '', {'perhaps': '', 'json': False}] 乍看之下,相当多的数据看起来像JSON,但事实证明它并不完全符合JSON规范-通常是因为...

    JavaScript and JSON Essentials

    JavaScript and JSON Essentials is a step-by-step guide that will introduce you to JSON and help you understand how the lightweight JSON data format can be used in different ways either to store data ...

    json.js_json2.js

    If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. Example: // Parse the text. Values that look like ISO date strings will /...

    JSON Quick Syntax Reference(Apress,2016)

    • What is and how to use the Object Definition Syntax supported in JSON • What comprises a JSON content production workflow • What are the concepts and principles behind the JSON Object ...

    Beginning JSON

    What makes JSON so impactful is that it interacts with the many tools of the developer. For this reason, this book covers a wide range of implementations—from libraries to software.

    json序列化jar包

    What's different about Flexjson is it's control over what gets serialized allowing both deep and shallow copies of objects. Most JSON serializers mimic object serialization libraries and try to ...

    Beginning.JSON.1484202031

    Chapters 3 through 12 will uncover what data is, how to convert that data into a transmittable/storable format, how to use AJAX to send and receive JSON, and, lastly, how to reassemble that data back...

    unity解析json对象

    I came across the need to send structured data to and from a server on one of my projects, and figured it would be worth my while to use... This page assumes that you know what JSON is, and how it works.

    JavaScript.JSON.Cookbook.1785286900

    JSON (JavaScript Object Notation) is a lightweight text-based data interchange format used to create objects to transfer data over the Internet. It's widely used today by common web applications, as ...

    Wrox.Professional.JavaScript.for.Web.Developers.2nd.Edition.Jan.2009.pdf

    Chapter 1: What Is JavaScript? .1 Chapter 2: JavaScript in HTML 13 Chapter 3: Language Basics .23 Chapter 4: Variables, Scope, and Memory 79 Chapter 5: Reference Types 97 Chapter 6: Object-Oriented ...

    Java XML and JSON: Document Processing for Java SE, 2nd Edition

    New in this edition is coverage of Jackson (a JSON processor for Java) and Oracle’s own Java API for JSON processing (JSON-P), which is a JSON processing API for Java EE that also can be used with ...

    Python中json的简单使用

    What is JSON JSON(JavaScript Object Notation,JavaScript物件表示法,读作/ˈdʒeɪsən/)是一種由道格拉斯·克羅克福特構想和設計、輕量級的資料交換語言,该语言以易於讓人閱讀的文字為基礎,用来传输由属性...

    Android代码-GetJSON

    GetJson GetJson is the simplest HTTP library to Receive JSON Data from REST Service....What does GetJson do :- Receives JSON Data from the REST Service with just the url. Does all of this in a backg

    jsonschema:Python的JSON模式的(其他)实现

    &gt;&gt; &gt; # A sample schema, like what we'd get from json.load() &gt;&gt; &gt; schema = { ... "type" : "object" , ... "properties" : { ... "price" : { "type" : "number" }, ... "name" : { "type" : "string" }, ... },...

    json-assert:检查 json 对象是否匹配模板

    JSON 断言 该程序检查一个 javascript 对象是否与另一个匹配。 主要用例用于测试 JSON API。 这与之间的区别在于 json-assert 接受一个将运行的函数,...// we don't care what the value is as long as it exists. ja

    Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON

    Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON is a practical, hands-on guide that provides you with clear and pragmatic information to take advantage of the real power behind ...

    Pro.RESTful.APIs.Design.Build.and.Integrate.with.REST.JSON.XML.and.JAX-RS.pdf

    What You'll Learn Discover the key RESTful APIs, including REST, JSON, XML, JAX, SOAP and more Use these for web services and data exchange, especially in today's big data context Harness XML, JSON, ...

    navigation_json

    执行示例首先,程序询问文件名,然后,如果它看到字典(通常可以从json文件中得到),则它允许用户从NB键之一中进行选择(如果存在非对象列表),它将完全显示它,但如果有词典列表,请进一步查找What is your file ...

Global site tag (gtag.js) - Google Analytics