<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments on: JSON</title>
	<atom:link href="http://blog.stringtree.org/2006/08/12/json/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stringtree.org/2006/08/12/json/</link>
	<description>Stringtree Development News</description>
	<pubDate>Wed, 07 Jan 2009 13:09:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: musachy</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-1216</link>
		<dc:creator>musachy</dc:creator>
		<pubDate>Wed, 28 Feb 2007 19:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-1216</guid>
		<description>It didn't make it into Struts 2 core, but it is a plugin:

http://cwiki.apache.org/S2PLUGINS/json-plugin.html

I'm using your reader/writer with some mods, and it works pretty nice :)

hosted here:

http://code.google.com/p/jsonplugin/</description>
		<content:encoded><![CDATA[<p>It didn&#8217;t make it into Struts 2 core, but it is a plugin:</p>
<p><a href="http://cwiki.apache.org/S2PLUGINS/json-plugin.html" rel="nofollow">http://cwiki.apache.org/S2PLUGINS/json-plugin.html</a></p>
<p>I&#8217;m using your reader/writer with some mods, and it works pretty nice <img src='http://blog.stringtree.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>hosted here:</p>
<p><a href="http://code.google.com/p/jsonplugin/" rel="nofollow">http://code.google.com/p/jsonplugin/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stringtree</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-472</link>
		<dc:creator>Stringtree</dc:creator>
		<pubDate>Mon, 29 Jan 2007 13:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-472</guid>
		<description>&lt;b&gt;musachy&lt;/b&gt;: The default licences for all the Stringtree code are Apache or LGPL ( see http://sourceforge.net/projects/stringtree ). Drop me an email if you want more details.

&lt;b&gt;jlist&lt;/b&gt;: I'm back to looking at this again now, so I'll try out your suggestion. Thanks.</description>
		<content:encoded><![CDATA[<p><b>musachy</b>: The default licences for all the Stringtree code are Apache or LGPL ( see <a href="http://sourceforge.net/projects/stringtree" rel="nofollow">http://sourceforge.net/projects/stringtree</a> ). Drop me an email if you want more details.</p>
<p><b>jlist</b>: I&#8217;m back to looking at this again now, so I&#8217;ll try out your suggestion. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jlist</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-339</link>
		<dc:creator>jlist</dc:creator>
		<pubDate>Thu, 18 Jan 2007 01:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-339</guid>
		<description>The parser stops when hitting "null" in the json string. The same problem happens for "true" and "false".

With these changes (see /// in code) the problem seems to be fixed:
&lt;code&gt;
        } else if (c == 't' &#38;&#38; next() == 'r' &#38;&#38; next() == 'u' &#38;&#38; next() == 'e') {
            ret = Boolean.TRUE;
            next();///
        } else if (c == 'f' &#38;&#38; next() == 'a' &#38;&#38; next() == 'l' &#38;&#38; next() == 's' &#38;&#38; next() == 'e') {
            ret = Boolean.FALSE;
            next();///
        } else if (c == 'n' &#38;&#38; next() == 'u' &#38;&#38; next() == 'l' &#38;&#38; next() == 'l') {
            ret = null;
            next();///
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The parser stops when hitting &#8220;null&#8221; in the json string. The same problem happens for &#8220;true&#8221; and &#8220;false&#8221;.</p>
<p>With these changes (see /// in code) the problem seems to be fixed:<br />
<code><br />
        } else if (c == 't' &amp;&amp; next() == 'r' &amp;&amp; next() == 'u' &amp;&amp; next() == 'e') {<br />
            ret = Boolean.TRUE;<br />
            next();///<br />
        } else if (c == 'f' &amp;&amp; next() == 'a' &amp;&amp; next() == 'l' &amp;&amp; next() == 's' &amp;&amp; next() == 'e') {<br />
            ret = Boolean.FALSE;<br />
            next();///<br />
        } else if (c == 'n' &amp;&amp; next() == 'u' &amp;&amp; next() == 'l' &amp;&amp; next() == 'l') {<br />
            ret = null;<br />
            next();///<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: musachy</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-254</link>
		<dc:creator>musachy</dc:creator>
		<pubDate>Fri, 05 Jan 2007 21:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-254</guid>
		<description>Hi,

What is the license for this cool class? We need a JSON serializer at Struts 2, and I like this one :)

regards

musachy</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>What is the license for this cool class? We need a JSON serializer at Struts 2, and I like this one <img src='http://blog.stringtree.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>regards</p>
<p>musachy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janos</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-174</link>
		<dc:creator>Janos</dc:creator>
		<pubDate>Fri, 15 Dec 2006 03:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-174</guid>
		<description>How do I JSON objects that have Java 5 enums in them? For example:

public class Color {

    public enum ColorType { EXTERIOR, INTERIOR }
..
Any help will be appreciated.
Janos</description>
		<content:encoded><![CDATA[<p>How do I JSON objects that have Java 5 enums in them? For example:</p>
<p>public class Color {</p>
<p>    public enum ColorType { EXTERIOR, INTERIOR }<br />
..<br />
Any help will be appreciated.<br />
Janos</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blog.caelum.com.br &#187; Ajax no VRaptor: JSON da maneira fÃ¡cil</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-49</link>
		<dc:creator>blog.caelum.com.br &#187; Ajax no VRaptor: JSON da maneira fÃ¡cil</dc:creator>
		<pubDate>Thu, 09 Nov 2006 03:11:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-49</guid>
		<description>[...] O Fabio Kung deu a idÃ©ia de usar JSON para fazer a estrutura bÃ¡sica de Ajax do VRaptor. O Paulo, que detesta(va) trabalhar com JavaScript e interfaces com o usuÃ¡rio, gostou bastante da maneira simples de se representar objetos com JSON. Ele correu atrÃ¡s de diversas bibliotecas como a JSON-tools e a JSON-lib mas achou que uma dependÃªncia apenas para isso seria muita coisa, jÃ¡ que nÃ£o haveria a necessidade de consumir JSON como Java, apenas produzir. Ele encontrou um cÃ³digo na internet bem simples, mas quando foi usar descobriu uma sÃ©rie de testes que falhariam, entÃ£o ele, juntamente com o Nico Steppat, mexeu e criou o prÃ³prio JSONWriter do VRaptor, junto com um longo test case. [...]</description>
		<content:encoded><![CDATA[<p>[...] O Fabio Kung deu a idÃ©ia de usar JSON para fazer a estrutura bÃ¡sica de Ajax do VRaptor. O Paulo, que detesta(va) trabalhar com JavaScript e interfaces com o usuÃ¡rio, gostou bastante da maneira simples de se representar objetos com JSON. Ele correu atrÃ¡s de diversas bibliotecas como a JSON-tools e a JSON-lib mas achou que uma dependÃªncia apenas para isso seria muita coisa, jÃ¡ que nÃ£o haveria a necessidade de consumir JSON como Java, apenas produzir. Ele encontrou um cÃ³digo na internet bem simples, mas quando foi usar descobriu uma sÃ©rie de testes que falhariam, entÃ£o ele, juntamente com o Nico Steppat, mexeu e criou o prÃ³prio JSONWriter do VRaptor, junto com um longo test case. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sonny Gill</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-41</link>
		<dc:creator>Sonny Gill</dc:creator>
		<pubDate>Thu, 26 Oct 2006 08:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-41</guid>
		<description>Hi Frank,

I tried the code from the latest rev. in the sourceforge repository.

The following causes an infinite loop -
&lt;code&gt;
String js = "{\"prop\":null}";
new JSONReader().read(js);
&lt;/code&gt;

The code enters an infinite loop if a value is null, true or false.
I fixed this by adding a call to next() in the following conditional blocks (Otherwise, the token is never equal to OBJECT_END) -

&lt;code&gt;
        } else if (c == 't' &#38;&#38; next() == 'r' &#38;&#38; next() == 'u' &#38;&#38; next() == 'e') {
            ret = Boolean.TRUE;
            next();
        } else if (c == 'f' &#38;&#38; next() == 'a' &#38;&#38; next() == 'l' &#38;&#38; next() == 's' &#38;&#38; next() == 'e') {
            ret = Boolean.FALSE;
            next();
        } else if (c == 'n' &#38;&#38; next() == 'u' &#38;&#38; next() == 'l' &#38;&#38; next() == 'l') {
            ret = null;
            next();
        } else if (Character.isDigit(c) &#124;&#124; c == '-') {
&lt;/code&gt;


Thanks for the code :)</description>
		<content:encoded><![CDATA[<p>Hi Frank,</p>
<p>I tried the code from the latest rev. in the sourceforge repository.</p>
<p>The following causes an infinite loop -<br />
<code><br />
String js = "{\"prop\":null}";<br />
new JSONReader().read(js);<br />
</code></p>
<p>The code enters an infinite loop if a value is null, true or false.<br />
I fixed this by adding a call to next() in the following conditional blocks (Otherwise, the token is never equal to OBJECT_END) -</p>
<p><code><br />
        } else if (c == 't' &amp;&amp; next() == 'r' &amp;&amp; next() == 'u' &amp;&amp; next() == 'e') {<br />
            ret = Boolean.TRUE;<br />
            next();<br />
        } else if (c == 'f' &amp;&amp; next() == 'a' &amp;&amp; next() == 'l' &amp;&amp; next() == 's' &amp;&amp; next() == 'e') {<br />
            ret = Boolean.FALSE;<br />
            next();<br />
        } else if (c == 'n' &amp;&amp; next() == 'u' &amp;&amp; next() == 'l' &amp;&amp; next() == 'l') {<br />
            ret = null;<br />
            next();<br />
        } else if (Character.isDigit(c) || c == '-') {<br />
</code></p>
<p>Thanks for the code <img src='http://blog.stringtree.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-39</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Tue, 17 Oct 2006 11:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-39</guid>
		<description>Eventually I found some time to do this. The JSON source in subversion at Sourceforge now includes
the fix for the initial Map problem, and the conversion to returning java.util.List instead of Object[] from arrays.

The suggested System.out.println is present, but commented out.

I didn't change the names of the constants, though. I'd prefer to leave them matching the names in the JSON spec.

These changes will be included in the Stringtree 2.0.4 release, due October 31,2006

Thanks again guys.</description>
		<content:encoded><![CDATA[<p>Eventually I found some time to do this. The JSON source in subversion at Sourceforge now includes<br />
the fix for the initial Map problem, and the conversion to returning java.util.List instead of Object[] from arrays.</p>
<p>The suggested System.out.println is present, but commented out.</p>
<p>I didn&#8217;t change the names of the constants, though. I&#8217;d prefer to leave them matching the names in the JSON spec.</p>
<p>These changes will be included in the Stringtree 2.0.4 release, due October 31,2006</p>
<p>Thanks again guys.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-33</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Tue, 19 Sep 2006 10:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-33</guid>
		<description>Thanks for the patch(es) guys. I'll update the version in sourceforge and post a new link soon.</description>
		<content:encoded><![CDATA[<p>Thanks for the patch(es) guys. I&#8217;ll update the version in sourceforge and post a new link soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manni Wood</title>
		<link>http://blog.stringtree.org/2006/08/12/json/comment-page-1/#comment-31</link>
		<dc:creator>Manni Wood</dc:creator>
		<pubDate>Thu, 07 Sep 2006 19:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stringtree.org/?p=4#comment-31</guid>
		<description>Sorry to post that twice, esp. seeing as it did not work.

Final note:

In my own copy of JSONReader, I changed OBJECT_END to HASHMAP_END and ARRAY_END to ARRAYLIST_END, to match the code's internal representation of the JSON (rather than the JavaScript view of the JSON).

I also replaced "return ret.toArray();" with "return ret;" in "array()" (which I renamed "arrayList()") because I actually prefer dealing with List objects rather than arrays. (I also renamed "obejct()" "hashMap()".)

Switching from array to ArrayList actually has a nifty side-effect: if you add 

System.out.println("token: " + ret);

just before

token = ret;

in read(), JDK 1.4 actually pretty-prints the contents of the tokens as they are parsed! (For whatever reason, it did not do the same with arrays --- go figure.)</description>
		<content:encoded><![CDATA[<p>Sorry to post that twice, esp. seeing as it did not work.</p>
<p>Final note:</p>
<p>In my own copy of JSONReader, I changed OBJECT_END to HASHMAP_END and ARRAY_END to ARRAYLIST_END, to match the code&#8217;s internal representation of the JSON (rather than the JavaScript view of the JSON).</p>
<p>I also replaced &#8220;return ret.toArray();&#8221; with &#8220;return ret;&#8221; in &#8220;array()&#8221; (which I renamed &#8220;arrayList()&#8221;) because I actually prefer dealing with List objects rather than arrays. (I also renamed &#8220;obejct()&#8221; &#8220;hashMap()&#8221;.)</p>
<p>Switching from array to ArrayList actually has a nifty side-effect: if you add </p>
<p>System.out.println(&#8221;token: &#8221; + ret);</p>
<p>just before</p>
<p>token = ret;</p>
<p>in read(), JDK 1.4 actually pretty-prints the contents of the tokens as they are parsed! (For whatever reason, it did not do the same with arrays &#8212; go figure.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
