Java Reference
In-Depth Information
Java API for JSON Processing 1.0
The Java API for JSON Processing 1.0 was developed under JSR 353. This section
gives you only an overview of the API. The complete document specification (for more
information) can be downloaded from http://jcp.org/aboutJava/communityprocess/fi-
nal/jsr353/index.html .
What is JSON?
JavaScript Object Notation ( JSON ) is a lightweight data-interchange text format. It
is based on a subset of JavaScript, but it is completely language independent. JSON
format is often used for data exchanges between web client and web server or web
service. But, it can be used whenever you need to store or transmit relatively small
amounts of data that can easily be represented as a combination of name-value pairs.
JSON is built on two structures, which are: a collection of name-value pairs and an
ordered list of values. These structures are made from three data types: object , ar-
ray , and value .
Object
An object is an unordered set of name:value pairs within braces ( {} ). After each
name, there is a colon ( : ) and the name-value pairs are separated by a comma ( , ).
The name is string type while the type of the value can be string , object and
so on The following text gives an example of a JSON object, which contains some
information about a student:
{"name":"Malinda","gender":"F","birthday":"14/03/
1976","weight":78.5}
Array
An array is an ordered collection of values separated by a comma ( , ) within brackets
( [] ). The following text gives an example of a JSON array, which contains a list of
students with their score in alphabetical order.
Search WWH ::




Custom Search