<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JavaBeat &#187; JSON</title>
	<atom:link href="http://www.javabeat.net/category/json-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javabeat.net</link>
	<description>Java Technology News</description>
	<lastBuildDate>Mon, 13 May 2013 20:10:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Creating JSON document using Java and GSON API</title>
		<link>http://www.javabeat.net/2012/05/creating-json-document-using-java-and-gson-api/</link>
		<comments>http://www.javabeat.net/2012/05/creating-json-document-using-java-and-gson-api/#comments</comments>
		<pubDate>Sat, 05 May 2012 06:00:37 +0000</pubDate>
		<dc:creator>Mohamed Sanaulla</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[gson]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JavaScript Object Notation (JSON)]]></category>

		<guid isPermaLink="false">http://www.javabeat.net/examples/?p=1383</guid>
		<description><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><p>We saw how to parse JSON using GSON API, in this post we would take a look at how the same GSON API can be used to create JSON from the Java objects. Please read this to get an idea of what GSON is. Diving right into the topic of this example, we would make use [...]</p>]]></description>
				<content:encoded><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Rect */
google_ad_slot = "9976259118";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><a id="dd_start"></a><p>We saw how to <a title="Parsing JSON using Java and GSON library" href="http://www.javabeat.net/examples/2012/04/30/parsing-json-using-java-and-gson-library/">parse JSON</a> using GSON API, in this post we would take a look at how the same GSON API can be used to create JSON from the Java objects. Please read <a title="Parsing JSON using Java and GSON library" href="http://www.javabeat.net/examples/2012/04/30/parsing-json-using-java-and-gson-library/">this</a> to get an idea of what GSON is. Diving right into the topic of this example, we would make use of the toJson method of <strong>com.google.gson.Gson</strong> class. One of the overloaded versions of toJson() takes in an source of type Object and the type information which is of class java.lang.reflect.Type.</p>
<p>Lets define the model which would hold the data:</p>
<pre class="brush: java; title: ; notranslate">
class Book{

  @SerializedName(&quot;isbn&quot;)
  String isbn;

  @SerializedName(&quot;title&quot;)
  String title;

  @SerializedName(&quot;publication&quot;)
  String publication;

  @SerializedName(&quot;authors&quot;)
  String authors;

  public Book ( String isbn,
                String title,
                String publication,
                String authors)
  {
    this.isbn = isbn;
    this.title = title;
    this.publication = publication;
    this.authors = authors;
  }

}
</pre>
<p>We populate a list with some values for this model bean and this list would be converted to JSON output. Note the use of <strong>@SerializedName</strong> annotation in the model class. This indicates the name used for the attribute in the json output. We populate the list of books using:</p>
<pre class="brush: java; title: ; notranslate">
private static List&lt;Book&gt; populateBooks(){

  List&lt;Book&gt; myBooks = new ArrayList&lt;Book&gt;();
  Book book = new Book(&quot;007163360X&quot;,
                       &quot;Java Programming&quot;,
                       &quot;McGraw-Hill Osborne&quot;,
                       &quot;Dr (Poornachandra) Sarang&quot;);
  myBooks.add(book);

  book = new Book(&quot;1849516626&quot;,
                  &quot;Apache Tomcat 7 Essentials&quot;,
                  &quot;Tanuj Khare&quot;,
                  &quot;Packt Press&quot;);
  myBooks.add(book);

  book = new Book(&quot;007179431X&quot;,
                  &quot;Web Developer's Cookbook&quot;,
                  &quot;Robin Nixon&quot;,
                  &quot;McGraw-Hill Osborne&quot;);
  myBooks.add(book);

  book = new Book(&quot;9781935182962&quot;,
                  &quot;Practical Unit Testing&quot;,
                  &quot;Ken Rimple &amp; Srini Penchikala&quot;,
                  &quot;Manning&quot;);
  myBooks.add(book);

  return myBooks;
}
</pre>
<p>Once we have a list, we need to serialize it to JSON, for that we need to setup a Type information for generic List, this is not possible out of the box in Java and hence we would make use of <strong>com.google.gson.reflect.TypeToken</strong> class in the GSON API, to create the type information like:</p><div class="wpInsert wpInsertInPostAd wpInsertMiddle" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Middle-Med-Rect */
google_ad_slot = "7805667846";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<pre class="brush: java; title: ; notranslate">
// Get the type information for the List&lt;Book&gt;
Type listType = new TypeToken&lt;List&lt;Book&gt;&gt;(){}.getType();
</pre>
<p>Next up is to use this type information along with the list of books and pass it to the toJson method to obtain the JSON output.</p>
<p>The complete code:</p>
<pre class="brush: java; title: ; notranslate">
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class JsonCreatorDemo {

  /**
  * Populate the Books information into a List
  * @return
  */
  private static List&lt;Book&gt; populateBooks(){

    List&lt;Book&gt; myBooks = new ArrayList&lt;Book&gt;();
    Book book = new Book(&quot;007163360X&quot;,
                         &quot;Java Programming&quot;,
                         &quot;McGraw-Hill Osborne&quot;,
                         &quot;Dr (Poornachandra) Sarang&quot;);
    myBooks.add(book);

    book = new Book(&quot;1849516626&quot;,
                    &quot;Apache Tomcat 7 Essentials&quot;,
                    &quot;Tanuj Khare&quot;,
                    &quot;Packt Press&quot;);
    myBooks.add(book);

    book = new Book(&quot;007179431X&quot;,
                    &quot;Web Developer's Cookbook&quot;,
                    &quot;Robin Nixon&quot;,
                    &quot;McGraw-Hill Osborne&quot;);
    myBooks.add(book);

    book = new Book(&quot;9781935182962&quot;,
                    &quot;Practical Unit Testing&quot;,
                    &quot;Ken Rimple &amp; Srini Penchikala&quot;,
                    &quot;Manning&quot;);
    myBooks.add(book);

    return myBooks;
  }

  public static void main(String [] args){

    List&lt;Book&gt; myBooks = populateBooks();

    Gson myGson = new Gson();

    // Get the type information for the List&lt;Book&gt;
    Type listType = new TypeToken&lt;List&lt;Book&gt;&gt;(){}.getType();

    // Serialize the List of books into JSON
    System.out.println(myGson.toJson(myBooks,listType));

  }
}

class Book{

  @SerializedName(&quot;isbn&quot;)
  String isbn;

  @SerializedName(&quot;title&quot;)
  String title;

  @SerializedName(&quot;publication&quot;)
  String publication;

  @SerializedName(&quot;authors&quot;)
  String authors;

  public Book ( String isbn,
                String title,
                String publication,
                String authors)
  {
    this.isbn = isbn;
    this.title = title;
    this.publication = publication;
    this.authors = authors;
  }

}
</pre>
<p>JSON Output:</p>
<pre class="brush: jscript; title: ; notranslate">
[
  {
    &quot;isbn&quot;:&quot;007163360X&quot;,
    &quot;title&quot;:&quot;Java Programming&quot;,
    &quot;publication&quot;:&quot;McGraw-Hill Osborne&quot;,
    &quot;authors&quot;:&quot;Dr (Poornachandra) Sarang&quot;
  },
  {
    &quot;isbn&quot;:&quot;1849516626&quot;,
    &quot;title&quot;:&quot;Apache Tomcat 7 Essentials&quot;,
    &quot;publication&quot;:&quot;Tanuj Khare&quot;,
    &quot;authors&quot;:&quot;Packt Press&quot;
  },
  {
    &quot;isbn&quot;:&quot;007179431X&quot;,
    &quot;title&quot;:&quot;Web Developeru0027s Cookbook&quot;,
    &quot;publication&quot;:&quot;Robin Nixon&quot;,
    &quot;authors&quot;:&quot;McGraw-Hill Osborne&quot;
  },
  {
    &quot;isbn&quot;:&quot;9781935182962&quot;,
    &quot;title&quot;:&quot;Practical Unit Testing&quot;,
    &quot;publication&quot;:&quot;Ken Rimple u0026 Srini Penchikala&quot;,
    &quot;authors&quot;:&quot;Manning&quot;
  }
]
</pre>
<div class='dd_outer'><div class='dd_inner'><div id='dd_ajax_float'><div class='dd_button_v'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Fwww.javabeat.net%2Fcategory%2Fjson-2%2Ffeed%2F" send="false" show_faces="false"  layout="box_count" width="50"  ></fb:like></div><div style='clear:left'></div><div class='dd_button_v'><script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script><g:plusone size='tall' href='http://www.javabeat.net/category/json-2/feed/'></g:plusone></div><div style='clear:left'></div><div class='dd_button_v'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.javabeat.net/category/json-2/feed/" data-count="vertical" data-text="JSON" data-via="javabeat" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style='clear:left'></div><div class='dd_button_extra_v'><script type="text/javascript">jQuery(document).load(function(){ stLight.options({publisher:'bab47279-62c9-46af-addc-79fd1fe8fee0'}); });</script><div class="st_email_custom"><span id='dd_email_text'>email</span></div></div><div style='clear:left'></div><div class='dd_button_extra_v'><div id='dd_print_button'><span id='dd_print_text'><a href='javascript:window:print()'>print</a></span></div></div><div style='clear:left'></div></div></div></div><script type="text/javascript">var dd_offset_from_content = 44; var dd_top_offset_from_content = 0;</script><script type="text/javascript" src="http://www.javabeat.net/wp-content/plugins/digg-digg//js/diggdigg-floating-bar.js?ver=5.3.0"></script><div class="wpInsert wpInsertInPostAd wpInsertBelow" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* JB-Footer-LU 468x15 */
google_ad_slot = "8789107210";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.javabeat.net/2012/05/creating-json-document-using-java-and-gson-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Invoking RESTful Web Service using API in java.net and GSON</title>
		<link>http://www.javabeat.net/2012/05/invoking-restful-web-service-using-api-in-java-net-and-gson/</link>
		<comments>http://www.javabeat.net/2012/05/invoking-restful-web-service-using-api-in-java-net-and-gson/#comments</comments>
		<pubDate>Tue, 01 May 2012 06:00:14 +0000</pubDate>
		<dc:creator>Mohamed Sanaulla</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[gson]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JavaScript Object Notation (JSON)]]></category>

		<guid isPermaLink="false">http://www.javabeat.net/examples/?p=1204</guid>
		<description><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><p>In our previous post, we wrote about parsing JSON using Java and GSON library. Moving further, in this article we will look at how to use classes in java.net package to invoke a RESTful Web Service and then parse the JSON response using GSON library. For this we make use of the Twitter REST API [...]</p>]]></description>
				<content:encoded><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Rect */
google_ad_slot = "9976259118";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p style="text-align: justify;">In our <a title="Parsing JSON using Java and GSON library" href="http://www.javabeat.net/examples/2012/04/30/parsing-json-using-java-and-gson-library/">previous post</a>, we wrote about parsing JSON using Java and <a href="http://code.google.com/p/google-gson/" target="_blank">GSON library</a>. Moving further, in this article we will look at how to use classes in java.net package to invoke a <strong>RESTful Web Service</strong> and then parse the <strong>JSON</strong> response using GSON library. For this we make use of the <a href="https://dev.twitter.com/" target="_blank">Twitter REST API</a> and more specifically <a href="https://dev.twitter.com/docs/api/1/get/statuses/user_timeline" target="_blank">statuses/user_timeline</a> API. A bit about the API:</p>
<p style="text-align: justify;"><strong>GET status/user_timeline</strong>: Returns the 20 most recent statuses posted by the authenticating user. It is also possible to request another user&#8217;s timeline by using the screen_name or user_id parameter. The other users timeline will only be visible if they are not protected, or if the authenticating user&#8217;s follow request was accepted by the protected user.</p>
<p style="text-align: justify;">The resource URL is: http://api.twitter.com/1/statuses/user_timeline.format</p>
<p>The API returns lot of data, but we are interested in only the status text and the created date. Keeping that in mind, our model class will be:</p>
<pre class="brush: java; title: ; notranslate">
class Tweet{
  public String text;
  public String created_at;
  public String toString(){
    return &quot;Posted &quot;+text+&quot; at &quot;+created_at;
  }
}
</pre>
<p>The example can be divided into:</p>
<ol>
<li>Take screen name input from the user and construct the URL for the API which we call as the fetchURL.</li>
<li>Use URLConnection class and its connect() and getInputSteam() APIs to connect to the fetchURL and then obtain the input stream.</li>
<li>The input stream obtained above is used to construct the JsonReader object( from the GSON library).</li>
<li>Then parse the JSON as explained <a title="Parsing JSON using Java and GSON library" href="http://www.javabeat.net/examples/2012/04/30/parsing-json-using-java-and-gson-library/">here</a>.</li>
</ol>
<p><strong>Invoking the REST API:</strong></p>
<pre class="brush: java; title: ; notranslate">String fetchUrl =
  &quot;http://api.twitter.com/1/statuses/user_timeline.json?screen_name=&quot;;
//this.screenName is obtained as a user input
fetchUrl = fetchUrl+this.screenName;
URLConnection urlConnection =  new URL(fetchUrl).openConnection();
urlConnection.connect();</pre>
<p style="text-align: justify;">One can see that to invoke a REST web service, we need not have to use any other APIs then then ones provided in the java.net package. There are a lot of libraries available for invoking and creating REST APIs. But in this example we stick with java.net package. This simplicity is due to the fact that REST APIs are based on top of HTTP related protocols and uses GET, POST, PUT, DELETE and other methods supported by HTTP.</p><div class="wpInsert wpInsertInPostAd wpInsertMiddle" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Middle-Med-Rect */
google_ad_slot = "7805667846";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p><strong>Parsing the JSON response:</strong></p>
<pre class="brush: java; title: ; notranslate">JsonReader reader = new JsonReader(
      new InputStreamReader(urlConnection.getInputStream()));
JsonParser parser = new JsonParser();
JsonElement rootElement = parser.parse(reader);
JsonArray tweetsJson = rootElement.getAsJsonArray();</pre>
<p><strong>Populate the required model instances and add them to the List of tweets (or List&lt;Tweet&gt;).</strong></p>
<pre class="brush: java; title: ; notranslate">List timeline = new ArrayList();
Gson myGson = new Gson();
for ( JsonElement tweetElement : tweetsJson){
  Tweet myTweet = myGson.fromJson(tweetElement, Tweet.class);
  timeline.add(myTweet);
}</pre>
<p>Read <a title="Parsing JSON using Java and GSON library" href="http://www.javabeat.net/examples/2012/04/30/parsing-json-using-java-and-gson-library/">here</a> for details on parsing the JSON using Java and GSON API.</p>
<p>Here is the complete code:</p>
<pre class="brush: java; title: ; notranslate">
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;

import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class RestfulDemo {
  public static void main(String [] args) throws IOException{
    Scanner commandlineReader = new Scanner(System.in);
    System.out.println(&quot;Enter the screen name&quot;);
    String screenName = commandlineReader.nextLine();
    TwitterTimeline myTimeline = new TwitterTimeline(screenName);
    myTimeline.fetchTimeline();
    for ( Tweet myTweet : myTimeline.timeline){
      System.out.println(myTweet);
    }
  }
}

class TwitterTimeline {
  public String screenName;
  public List timeline;
  private String fetchUrl =
  &quot;http://api.twitter.com/1/statuses/user_timeline.json?screen_name=&quot;;
  TwitterTimeline( String screenName) {
    this.screenName = screenName;
  }

  public void fetchTimeline() throws IOException {
    fetchUrl = fetchUrl+this.screenName;
    URLConnection urlConnection =  new URL(fetchUrl).openConnection();
    urlConnection.connect();
    JsonReader reader = new JsonReader(
         new InputStreamReader(urlConnection.getInputStream()));
    JsonParser parser = new JsonParser();
    JsonElement rootElement = parser.parse(reader);
    JsonArray tweetsJson = rootElement.getAsJsonArray();
    timeline = new ArrayList();
    Gson myGson = new Gson();
    for ( JsonElement tweetElement : tweetsJson){
      Tweet myTweet = myGson.fromJson(tweetElement, Tweet.class);
      timeline.add(myTweet);
     }
  }
}
/*
 * Model class for a Tweet
 */
class Tweet {
  public String text;
  public String created_at;
  public String toString(){
    return &quot;Posted &quot;+text+&quot; at &quot;+created_at;
  }
}
</pre>
<p>Note: Make sure you have GSON library in the classpath.</p>
<p>Also if you have any issues while trying out this example, do drop a comment here and we will get back to you at the earliest.</p>
<div class="wpInsert wpInsertInPostAd wpInsertBelow" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* JB-Footer-LU 468x15 */
google_ad_slot = "8789107210";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.javabeat.net/2012/05/invoking-restful-web-service-using-api-in-java-net-and-gson/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Parsing JSON using Groovy</title>
		<link>http://www.javabeat.net/2012/04/parsing-json-using-groovy/</link>
		<comments>http://www.javabeat.net/2012/04/parsing-json-using-groovy/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 09:33:02 +0000</pubDate>
		<dc:creator>Mohamed Sanaulla</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.javabeat.net/examples/?p=1171</guid>
		<description><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><p>In our previous post we saw how we used Gson API to parse the Json using Java. Not spending too much time on the introduction, I would want to straight away dive into the same parsing which can be done using Groovy language. Groovy is a scripting language which runs on the JVM. It can [...]</p>]]></description>
				<content:encoded><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Rect */
google_ad_slot = "9976259118";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p style="text-align: justify">In our previous post we saw how we used Gson API to parse the Json using Java. Not spending too much time on the introduction, I would want to straight away dive into the same parsing which can be done using <a href="http://en.wikipedia.org/wiki/Groovy_%28programming_language%29" target="_blank">Groovy</a> language. <a href="http://en.wikipedia.org/wiki/Groovy_%28programming_language%29" target="_blank">Groovy</a> is a scripting language which runs on the JVM. It can inter-operate with the Java APIs and compiles down into byte code which can then be executed on the JVM.</p>
<p style="text-align: justify">In this example as well we would make use of the same json document described here.</p>
<p style="text-align: justify">Groovy support for Json was added in the 1.8 version when a new groovy.json package was added. So you dont have to use an external API for parsing the json documents. <a href="http://groovy.codehaus.org/api/groovy/json/JsonSlurper.html" target="_blank">JsonSlurper</a> parses the given json document into a data structure of lists and maps. Due to this conversion the name=value pairs in the json document can be accessed by object.name notation where object represents the json object and name represents the name of the attribute.</p>
<p>The model bean in this case is defined as:</p>
<pre class="brush: groovy; title: ; notranslate">
class GroovyUser{
  def id
  def screenName
  def name
  def url
  def followersCount
  def friendsCount
  def favouritesCount
  def statusesCount

  GroovyUser(id,
        screenName,
        name,
        url,
        followersCount,
        friendsCount,
        favouritesCount,
        statusesCount){
    this.id = id
    this.screenName = screenName
    this.name = name
    this.url = url
    this.followersCount = followersCount
    this.friendsCount = friendsCount
    this.favouritesCount = favouritesCount
    this.statusesCount = statusesCount

  }

  def String toString(){
    return &quot;Name: &quot;+this.name+&quot;n&quot;+
    &quot;ScreenName:&quot;+this.screenName+&quot;n&quot;+
    &quot;Followers: &quot;+this.followersCount+&quot;n&quot;+
    &quot;Friends: &quot;+this.friendsCount+&quot;n&quot;+
    &quot;Favourites: &quot;+this.favouritesCount+&quot;n&quot;+
    &quot;Statuses: &quot;+this.statusesCount+&quot;n&quot;
  }
}
</pre>
<p>As Groovy can be used a scripting language, the following code need not be compiled instead one could directly run the code by:</p><div class="wpInsert wpInsertInPostAd wpInsertMiddle" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Middle-Med-Rect */
google_ad_slot = "7805667846";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<pre class="brush: bash; title: ; notranslate">$ groovy filename.groovy</pre>
<p>You would have to download and install the required binaries and libraries for running the groovy programs. More can be found at the <a href="http://groovy.codehaus.org/" target="_blank">official site</a>.</p>
<pre class="brush: groovy; title: ; notranslate">
import groovy.json.JsonSlurper

def jsonSlurper = new JsonSlurper();

/*
Read the JSON from the file system
*/
def reader = new BufferedReader(
              new FileReader(&quot;/home/mohamed/twitterUser.json&quot;))
def parsedData = jsonSlurper.parse(reader)
def usersList = new ArrayList&lt;GroovyUser&gt;()
parsedData.each {
  aUser -&gt;
    def user = new GroovyUser(aUser.id,
    aUser.screen_name,
    aUser.name,
    aUser.url,
    aUser.followers_count,
    aUser.friends_count,
    aUser.favourites_count,
    aUser.statuses_count)
    usersList.add(user)
}

usersList.each {aUser -&gt; println aUser}
</pre>
<p>There are few new things to note here:</p>
<ul>
<li>As Groovy supports closures, we are making use of the methods like &#8220;each&#8221; which is provided by the Groovy API on collections. The each method would for each element in the collection, execute the block of code provided with the each method. Something like-myCollection.each{ aData -&gt; println aData }</li>
<li>Semi colons are optional</li>
<li>Type details for the variables are optional, so you can see that the variables have been declared by using &#8220;def&#8221; keyword but no type is declared.</li>
<li>Look at the tremendous decrease in the number of lines of code written above. Parsing Json in Groovy is such a pleasure.</li>
</ul>
<p style="text-align: justify">On a closing note, the difference in the lines of code in Java and Groovy might tempt few of them to learn the syntax of the language. I am sure learning groovy is pretty easy as it has a short learning curve. Over the last few years there has been a transition to polyglot programming and with the advent of new languages which run on the JVM, they can inter-operate with an existing java application with no additional overhead.</p>
<p>We would over the coming days try to provide a few getting started like tutorials for Groovy and other JVM languages like Scala.</p>
<div class="wpInsert wpInsertInPostAd wpInsertBelow" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* JB-Footer-LU 468x15 */
google_ad_slot = "8789107210";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.javabeat.net/2012/04/parsing-json-using-groovy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Parsing JSON using Java and GSON library</title>
		<link>http://www.javabeat.net/2012/04/parsing-json-using-java-and-gson-library/</link>
		<comments>http://www.javabeat.net/2012/04/parsing-json-using-java-and-gson-library/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 09:28:50 +0000</pubDate>
		<dc:creator>Mohamed Sanaulla</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[gson]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JavaScript Object Notation (JSON)]]></category>

		<guid isPermaLink="false">http://www.javabeat.net/examples/?p=1078</guid>
		<description><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><p>In my previous post here, I gave a brief overview of JavaScript Object Notation (JSON). In this post I would go a bit further and show how one can parse the JSON documents into Java objects using the GSON library. The JSON data for this tutorial was obtained from: &#8220;https://api.twitter.com/1/users/show.json?screen_name=&#8221; where screen_name was TwitterAPI and [...]</p>]]></description>
				<content:encoded><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Rect */
google_ad_slot = "9976259118";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>In my previous post <a href="http://www.javabeat.net/examples/2012/04/28/what-is-javascript-object-notation-json/">here</a>, I gave a brief overview of JavaScript Object Notation (JSON). In this post I would go a bit further and show how one can parse the JSON documents into Java objects using the <strong><a href="http://code.google.com/p/google-gson/" target="_blank">GSON</a></strong> library. The JSON data for this tutorial was obtained from: &#8220;<a href="https://api.twitter.com/1/users/show.json?screen_name=" target="_blank">https://api.twitter.com/1/users/show.json?screen_name=&#8221;</a> where screen_name was TwitterAPI and sanaulla. So I condensed the data into the following:</p>
<pre class="brush: jscript; title: ; notranslate">[
  {
    &quot;id&quot;:&quot;6253282&quot;,
    &quot;name&quot;:&quot;Twitter API&quot;,
    &quot;screen_name&quot;:&quot;twitterapi&quot;,
    &quot;url&quot;:&quot;http://dev.twitter.com&quot;,
    &quot;followers_count&quot;:1004641,
    &quot;friends_count&quot;:33,
    &quot;favourites_count&quot;:24,
    &quot;statuses_count&quot;:3277
  },
  {
    &quot;id&quot;:&quot;15082387&quot;,
    &quot;name&quot;:&quot;Sanaulla&quot;,
    &quot;screen_name&quot;:&quot;sanaulla&quot;,
    &quot;url&quot;:&quot;http://blog.sanaulla.info&quot;,
    &quot;followers_count&quot;:241,
    &quot;friends_count&quot;:302,
    &quot;favourites_count&quot;:41,
    &quot;statuses_count&quot;:1876
  }
]</pre>
<p>Let me call this file as <strong>twitterUser.json</strong>. It is an array of user profile data where each user profile contains: name, id, screen_name, url, followers_count, friends_count, favourites_count and statuses_count. In order to run the following code, you need to download the <strong>GSON API</strong> jar from <a href="http://code.google.com/p/google-gson/downloads/detail?name=google-gson-2.1-release.zip" target="_blank">here</a> and add it to your classpath. Moving further, we need to create a Model class which would hold the data obtained from JSON document.</p>
<pre class="brush: java; title: ; notranslate">
/**
* Model class for storing the selected few attributes
* for a Twitter User profile.
*/
class TwitterUser{
  private String id;
  private String name;
  private String screen_name;
  private String url;
  private int friends_count;
  private int followers_count;
  private int favourites_count;
  private int statuses_count;
  public TwitterUser(){
  }
  @Override
  public String toString(){
    return &quot;Name: &quot;+this.name+&quot;n&quot; +
    &quot;Screen Name: &quot;+this.screen_name+&quot;n&quot; +
    &quot;Number of Friends: &quot;+ this.friends_count + &quot;n&quot; +
    &quot;Number of Followers: &quot;+ this.followers_count +&quot;n&quot; +
    &quot;Number of Status updates: &quot;+this.statuses_count +&quot;n&quot; +
    &quot;Number of favorites: &quot;+this.favourites_count +&quot;n&quot;;
  }
}</pre>
<p>Before putting forth the code, let me brief about the classes where are used for parsing the Json:</p>
<ul>
<li><strong><a href="http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/Gson.html" target="_blank">com.google.gson.Gson</a></strong>:<br />
<em>This is the main class for using Gson. Gson is typically used by first constructing a Gson instance and then invoking toJson(Object) or fromJson(String, Class) methods on it.</em></li>
<li><strong><a href="google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/JsonParser.html" target="_blank">com.google.gson.JsonParser</a></strong>:<br />
A parser to parse Json into a parse tree of JsonElements</li>
<li><strong><a href="http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html" target="_blank">com.google.gson.stream.JsonReader</a></strong>:<br />
Reads a JSON encoded value as a stream of tokens. This stream includes both literal values (strings, numbers, booleans, and nulls) as well as the begin and end delimiters of objects and arrays.</li>
<li><strong><a href="http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/JsonArray.html" target="_blank">com.google.gson.JsonArray</a></strong>:<br />
A class representing an array type in Json. An array is a list of JsonElements each of which can be of a different type.</li>
<li><strong><a href="http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/JsonElement.html" target="_blank">com.google.gson.JsonElement: </a></strong><br />
A class representing an element of Json. It could either be a JsonObject, a JsonArray, a JsonPrimitive or a JsonNull.</li>
</ul>
<p>Reading the JSON document using JsonReader, assuming the document is present in the file systems:</p>
<pre class="brush: java; title: ; notranslate">JsonReader reader = new JsonReader(
        new InputStreamReader(new FileInputStream(this.jsonSource)));</pre>
<p style="text-align: justify">JsonReader has a constructor which takes in an instance of a Reader, in our case we use the InputStreamReader and pipe it to a FileInputStream.</p>
<p style="text-align: justify">Once we are able to read the json data, we go ahead and use JsonParser to parse the contents and obtain the array of objects which the json document stores. There is an another way to do this with out using the JsonParser explicitly, but lets stick to this as its more clearer.</p>
<pre class="brush: java; title: ; notranslate">
JsonParser jsonParser = new JsonParser();
JsonArray userarray= jsonParser.parse(jsonReader).getAsJsonArray();
</pre>
<p style="text-align: justify">parse(JsonReader) method of the JsonParser, parses the given Json and creates a parse tree of JsonElements. And the method getAsJsonArray() returns the parsed Json as an array of json objects. In our document we are sure that the document is an array of json objects (recall, the [ ] stands for representing the arrays in json). Suppose you were not sure if those are arrays, then you can use isJsonArray() method of the JsonElement class.</p><div class="wpInsert wpInsertInPostAd wpInsertMiddle" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Middle-Med-Rect */
google_ad_slot = "7805667846";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>Next up, is to traverse through the array and populate the data from the json object in to our model bean TwitterUser which we had defined at the beginning.</p>
<pre class="brush: java; title: ; notranslate">List twitterUsers = new ArrayList&lt;&gt;();
for ( JsonElement aUser : userArray ) {
TwitterUser aTwitterUser = myGson.fromJson(aUser, TwitterUser.class);
twitterUsers.add(aTwitterUser);
}</pre>
<p style="text-align: justify">For each element in the <strong>JsonArray</strong> we use <strong>Gson.fromJson()</strong> to populate the data in the json object into the type defined by TwitterUser.class. How it works behind the scene is:</p>
<ul style="text-align: justify">
<li>It creates a new instance of TwitterUser, by invoking the default constructor.</li>
<li>Sets the values of the attributes in the TwitterUser class with those obtained from the json array element. If you closely look at the names of the attributes in the TwitterUser class and the ones in the Json document- they are exactly similar- something like- screen_name, friends_count, followerr_count and so on.</li>
</ul>
<p style="text-align: justify">The fromJson method in Gson has been overloaded to support multiple types of parameters, and from that we are using the fromJson(JsonElement json, Class&lt;T&gt; classOfT) version.</p>
<p>Now just to confirm we have parsed the correct data, iterate through the user list:</p>
<pre class="brush: java; title: ; notranslate">for ( TwitterUser tUser : twitterUsers)
{
  System.out.println(tUser);
}</pre>
<p>The complete source for the code is given below:</p>
<pre class="brush: java; title: ; notranslate">import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class JsonParserDemo {

  private String jsonSource;
  private boolean sourceFromFile;
  public JsonParserDemo(String jsonSource, boolean sourceFromFile){
    this.jsonSource = jsonSource;
    this.sourceFromFile = sourceFromFile;
  }
  public static void main(String[] args){
    JsonParserDemo jsonParserDemo =
     new JsonParserDemo(&quot;/home/mohamed/twitterUser.json&quot;, true);
    try(JsonReader jsonReader = jsonParserDemo.getJsonReader()){
      Gson myGson = new Gson();
      JsonParser jsonParser = new JsonParser();
      JsonArray userArray =  jsonParser.parse(jsonReader).getAsJsonArray();
      List twitterUsers = new ArrayList&lt;&gt;();
      for ( JsonElement aUser : userArray ){
        TwitterUser aTwitterUser = myGson.fromJson(aUser, TwitterUser.class);
        twitterUsers.add(aTwitterUser);
      }
      for ( TwitterUser tUser : twitterUsers){
        System.out.println(tUser);
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  /**
  * Obtain the JsonReader for the given source details.
  * @return the JsonReader instance
  * @throws FileNotFoundException
  */
  private JsonReader getJsonReader () throws FileNotFoundException{
    JsonReader reader = null;
    if (sourceFromFile){
      reader = new JsonReader(
        new InputStreamReader(new FileInputStream(this.jsonSource)));
    }
    return reader;
  }
}

/**
* Model class for storing the selected few attributes
* for a Twitter User profile.
*/
class TwitterUser{
  private String id;
  private String name;
  private String screen_name;
  private String url;
  private int friends_count;
  private int followers_count;
  private int favourites_count;
  private int statuses_count;

  public TwitterUser(){
  }

  @Override
  public String toString(){
    return &quot;Name: &quot;+this.name+&quot;n&quot; +
      &quot;Screen Name: &quot;+this.screen_name+&quot;n&quot; +
      &quot;Number of Friends: &quot;+ this.friends_count + &quot;n&quot; +
      &quot;Number of Followers: &quot;+ this.followers_count +&quot;n&quot; +
      &quot;Number of Status updates: &quot;+this.statuses_count +&quot;n&quot; +
      &quot;Number of favorites: &quot;+this.favourites_count +&quot;n&quot;;
  }
}</pre>
<div class="wpInsert wpInsertInPostAd wpInsertBelow" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* JB-Footer-LU 468x15 */
google_ad_slot = "8789107210";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.javabeat.net/2012/04/parsing-json-using-java-and-gson-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is JavaScript Object Notation (JSON)?</title>
		<link>http://www.javabeat.net/2012/04/what-is-javascript-object-notation-json/</link>
		<comments>http://www.javabeat.net/2012/04/what-is-javascript-object-notation-json/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 02:30:54 +0000</pubDate>
		<dc:creator>Mohamed Sanaulla</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[JavaScript Object Notation (JSON)]]></category>

		<guid isPermaLink="false">http://www.javabeat.net/examples/?p=1058</guid>
		<description><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><p>A quick JSON search on Google would yield plenty of results and more specifically the JSON homepage. None the less we wanted to share something brief and something good about JSON. Lot of you are familiar with XML and XML had been the defacto data-transfer language in the area of RESTful webservices, but off late [...]</p>]]></description>
				<content:encoded><![CDATA[<p>Connect to us ( <a href="https://twitter.com/javabeat">@twitter</a> | <a href="https://www.facebook.com/javabeat.net">@facebook )</p><div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Rect */
google_ad_slot = "9976259118";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p style="text-align: justify">A quick <strong>JSON</strong> <a href="https://www.google.co.in/search?q=json" target="_blank">search</a> on Google would yield plenty of results and more specifically the <strong>JSON</strong> <a href="http://www.json.org/" target="_blank">homepage</a>. None the less we wanted to share something brief and something good about <strong>JSON</strong>. Lot of you are familiar with XML and XML had been the defacto data-transfer language in the area of <strong>RESTful webservices</strong>, but off late <strong>JSON</strong> has been gaining popularity for reasons which I would explain a bit further. Before going further into XML versus JSON, let me give a brief overview of the structure of JSON documents. And for those not aware of what <strong>JSON</strong> stands for, its JavaScript Object Notation. I know the use of &#8220;JavaScript&#8221; term has more relevance and is not like the use of &#8220;Java&#8221; in the term &#8220;JavaScript&#8221;.</p>
<p style="text-align: justify"><span id="more-3319"></span>A <strong>JSON</strong> structure consists of name-value pairs where a collection of such name-value pairs is called an Object, and each value could be an object themselves or be some primitives like Strings, Numbers and so on. Also values can be arrays of objects or primitive values. Sounds confusing right, let me explain with an example, consider a <strong>JSON</strong> document retrieved from <a href="http://api.twitter.com/1/trends/available.json" target="_blank">http://api.twitter.com/1/trends/available.json</a> which shows the available twitter trends and their location information. Let me get a small excerpt from that document:</p>
<pre class="brush: jscript; title: ; notranslate">[
 {
   &quot;parentid&quot;: 23424900,
   &quot;name&quot;: &quot;Mexico City&quot;,
   &quot;url&quot;: &quot;http://where.yahooapis.com/v1/place/116545&quot;,
   &quot;country&quot;: &quot;Mexico&quot;,
   &quot;countryCode&quot;: &quot;MX&quot;,
   &quot;placeType&quot;: {
     &quot;name&quot;: &quot;Town&quot;,
     &quot;code&quot;: 7
   },
   &quot;woeid&quot;: 116545
 },
 {
   &quot;name&quot;: &quot;Jackson&quot;,
   &quot;url&quot;: &quot;http://where.yahooapis.com/v1/place/2428184&quot;,
   &quot;country&quot;: &quot;United States&quot;,
   &quot;countryCode&quot;: &quot;US&quot;,
   &quot;placeType&quot;: {
     &quot;name&quot;: &quot;Town&quot;,
     &quot;code&quot;: 7
   },
   &quot;parentid&quot;: 23424977,
   &quot;woeid&quot;: 2428184
 }
]</pre>
<p style="text-align: justify">In the above example, the notation <strong>[ ]</strong> is used to represent the Arrays and anything within <strong>{ }</strong> is considered to be an object literal/ or an object. We can observe that we have an array of two objects where each object represents some twitter trend details. Digging further we can observe that objects have a &#8220;name&#8221;:value pattern, this is somewhat closer to our Map representations. The &#8220;placeType&#8221; attribute has another object as its value, similarly attributes like &#8220;code&#8221;, &#8220;woeid&#8221; have Numbers as their values.</p>
<p style="text-align: justify">Just in case you want to learn more about this structure/syntax, you can visit JSON.org for a beautiful diagrammatic explanation.</p>
<p style="text-align: justify"><strong>Origin and Use of JSON: </strong></p><div class="wpInsert wpInsertInPostAd wpInsertMiddle" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* Article-Middle-Med-Rect */
google_ad_slot = "7805667846";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p style="text-align: justify"><a href="http://en.wikipedia.org/wiki/Douglas_Crockford" target="_blank">Douglas Crockford</a> of <a href="http://www.flipkart.com/javascript-8184045220/p/itmczzj4cafppxym?pid=9788184045222&amp;_l=d7izwEFQZLoDqctmJtMgDw--&amp;_r=qNcsGfroVfguAZKYslLaDQ--&amp;ref=6751de83-5318-4fa5-920a-a5ffdca8ead1" target="_blank">JavaScript Good Parts</a> fame was the earliest promoters of <strong>JSON</strong> notation and it was named so because  it mimics the object notation used in JavaScript. It doesn&#8217;t require JavaScript to use but its fairly easy to create JavaScript objects using the <strong>JSON</strong> data. There are lot of APIs in almost all languages which provide support for parsing and creating <strong>JSON</strong> documents and languages like Groovy provide such support within their standard APIs. NoSQL databases like CouchDB, MongoDB extensively use JSON for representing the data.</p>
<p style="text-align: justify">Lot of RESTful Webservice APIs out there support both XML and JSON data formats. And with JavaScript frameworks like Backbone.js it becomes really easy to consume the JSON documents provided by these RESTful APIs and create model objects. An advantage of JSON over XML is that, its really less verbose than XML. And also the JSON representation is more closer to the Object/Key-value kind of notation which lot of us Java programmers are familiar with.</p>
<p style="text-align: justify">In the coming posts, we would be writing on how one can parse JSON in Java and other JVM languages and also how to use it in parsing the data from a RESTful API. So before that, we thought of giving a brief overview of JSON.</p>
<p style="text-align: justify">Any of you have more to share about JSON, any good/bad experiences of using JSON, do leave them here as comments, we would be more than happy to update the post to add your comments.</p>
<p style="text-align: justify">
<div class="wpInsert wpInsertInPostAd wpInsertBelow" style="margin: 5px; padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-1490953723360528";
/* JB-Footer-LU 468x15 */
google_ad_slot = "8789107210";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.javabeat.net/2012/04/what-is-javascript-object-notation-json/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
