<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://gvwiki.greenvulcano.com/gvwiki/index.php?action=history&amp;feed=atom&amp;title=JSONUtils</id>
	<title>JSONUtils - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://gvwiki.greenvulcano.com/gvwiki/index.php?action=history&amp;feed=atom&amp;title=JSONUtils"/>
	<link rel="alternate" type="text/html" href="https://gvwiki.greenvulcano.com/gvwiki/index.php?title=JSONUtils&amp;action=history"/>
	<updated>2026-04-13T08:44:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://gvwiki.greenvulcano.com/gvwiki/index.php?title=JSONUtils&amp;diff=4440&amp;oldid=prev</id>
		<title>G.dimaio at 19:42, 28 October 2015</title>
		<link rel="alternate" type="text/html" href="https://gvwiki.greenvulcano.com/gvwiki/index.php?title=JSONUtils&amp;diff=4440&amp;oldid=prev"/>
		<updated>2015-10-28T19:42:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 19:42, 28 October 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l117&quot; &gt;Line 117:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public static Node jsonToXml_BadgerFish(Object json) throws JSONUtilsException&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public static Node jsonToXml_BadgerFish(Object json) throws JSONUtilsException&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The JSONObject javadoc are [http://www.json.org/javadoc/index.html?org/json/JSONObject.html here].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>G.dimaio</name></author>
		
	</entry>
	<entry>
		<id>https://gvwiki.greenvulcano.com/gvwiki/index.php?title=JSONUtils&amp;diff=4438&amp;oldid=prev</id>
		<title>G.dimaio: Created page with &quot;Class FQN: '''it.greenvulcano.util.json.JSONUtils'''  ==Following the JSONUtils public static methods== * Parsing &amp; Conversion &lt;syntaxhighlight lang=&quot;java5&quot;&gt; /**  * Convert the i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://gvwiki.greenvulcano.com/gvwiki/index.php?title=JSONUtils&amp;diff=4438&amp;oldid=prev"/>
		<updated>2015-10-28T19:36:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Class FQN: &amp;#039;&amp;#039;&amp;#039;it.greenvulcano.util.json.JSONUtils&amp;#039;&amp;#039;&amp;#039;  ==Following the JSONUtils public static methods== * Parsing &amp;amp; Conversion &amp;lt;syntaxhighlight lang=&amp;quot;java5&amp;quot;&amp;gt; /**  * Convert the i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Class FQN: '''it.greenvulcano.util.json.JSONUtils'''&lt;br /&gt;
&lt;br /&gt;
==Following the JSONUtils public static methods==&lt;br /&gt;
* Parsing &amp;amp; Conversion&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java5&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Convert the input XML to a JSONObject.&lt;br /&gt;
 * JSON does not distinguish between elements and attributes.&lt;br /&gt;
 * Sequences of similar elements are represented as JSONArrays.&lt;br /&gt;
 * If an element have attributes, content text/cdata may be placed in a &amp;quot;contentText&amp;quot; member.&lt;br /&gt;
 * Comments and namespaces are ignored.&lt;br /&gt;
 * If the root element is 'DEFAULT_ROOT' then isn't included into JSON output.&lt;br /&gt;
 * &lt;br /&gt;
 * @param xml&lt;br /&gt;
 *        the document to convert&lt;br /&gt;
 * @return a JSONObject representing the JSON document&lt;br /&gt;
 * @throws JSONUtilsException when error occurs&lt;br /&gt;
 */&lt;br /&gt;
public static JSONObject xmlToJson(Object xml) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert the input XML to a JSONObject.&lt;br /&gt;
 * JSON does not distinguish between elements and attributes.&lt;br /&gt;
 * Sequences of similar elements (or elements which local-name are in forceElementsArray)&lt;br /&gt;
 * are represented as JSONArrays. &lt;br /&gt;
 * If an element have attributes, content text/cdata may be placed in a &amp;quot;contentText&amp;quot; member.&lt;br /&gt;
 * Comments and namespaces are ignored.&lt;br /&gt;
 * If the root element is 'DEFAULT_ROOT' then isn't included into JSON output.&lt;br /&gt;
 *&lt;br /&gt;
 * @param xml&lt;br /&gt;
 *        the document to convert&lt;br /&gt;
 * @param forceElementsArray&lt;br /&gt;
 *        a set containing element's local-name to be forced as JSONArray also if in single instance&lt;br /&gt;
 * @param forceStringValue&lt;br /&gt;
 *        a set containing element's local-name to be forced as String values, ignoring type conversions&lt;br /&gt;
 * @return a JSONObject representing the XML document&lt;br /&gt;
 * @throws JSONUtilsException&lt;br /&gt;
 */&lt;br /&gt;
public static JSONObject xmlToJson(Object xml, Set&amp;lt;String&amp;gt; forceElementsArray, Set&amp;lt;String&amp;gt; forceStringValue) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert a JSONObject into an XML structure.&lt;br /&gt;
 * If the JSON to be converted doesn't have a single root element &lt;br /&gt;
 * then is automatically created a 'DEFAULT_ROOT' root element.&lt;br /&gt;
 * &lt;br /&gt;
 * @param json &lt;br /&gt;
 *        a JSONObject&lt;br /&gt;
 * @return a Node representing the JSON document&lt;br /&gt;
 * @throws  JSONException&lt;br /&gt;
 */&lt;br /&gt;
public static Node jsonToXml(Object json) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert a JSONObject into an XML structure.&lt;br /&gt;
 * If the JSON to be converted doesn't have a single root element &lt;br /&gt;
 * then is automatically created a 'DEFAULT_ROOT' root element.&lt;br /&gt;
 * &lt;br /&gt;
 * @param json &lt;br /&gt;
 *        a JSONObject&lt;br /&gt;
 * @param forceAttribute&lt;br /&gt;
 *        a set containing keys name to be set as XML attributes&lt;br /&gt;
 * @return a Node representing the JSON document&lt;br /&gt;
 * @throws  JSONException&lt;br /&gt;
 */&lt;br /&gt;
public static Node jsonToXml(Object json, Set&amp;lt;String&amp;gt; forceAttributes) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert a JSONObject into Node structure.&lt;br /&gt;
 * If not specified a rootName and the JSON to be converted doesn't have&lt;br /&gt;
 * a single root element then is automatically created a 'DEFAULT_ROOT' root element.&lt;br /&gt;
 * &lt;br /&gt;
 * @param json&lt;br /&gt;
 *        a JSONObject&lt;br /&gt;
 * @param rootName&lt;br /&gt;
 *        the optional name of the root element&lt;br /&gt;
 * @return a Node representing the JSON document&lt;br /&gt;
 * @throws JSONUtilsException&lt;br /&gt;
 */&lt;br /&gt;
public static Node jsonToXml(Object json, String rootName) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert a JSONObject into Node structure.&lt;br /&gt;
 * If not specified a rootName and the JSON to be converted doesn't have&lt;br /&gt;
 * a single root element then is automatically created a 'DEFAULT_ROOT' root element.&lt;br /&gt;
 * &lt;br /&gt;
 * @param json&lt;br /&gt;
 *        a JSONObject&lt;br /&gt;
 * @param rootName&lt;br /&gt;
 *        the optional name of the root element&lt;br /&gt;
 * @param forceAttributes&lt;br /&gt;
 *        a set containing keys name to be set as XML attributes&lt;br /&gt;
 * @return a Node representing the JSON document&lt;br /&gt;
 * @throws JSONUtilsException&lt;br /&gt;
 */&lt;br /&gt;
public static Node jsonToXml(Object json, String rootName, Set&amp;lt;String&amp;gt; forceAttributes) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert the input XML to a JSONObject using BadgerFish convention.&lt;br /&gt;
 * See &amp;lt;a href=&amp;quot;http://badgerfish.ning.com&amp;quot;&amp;gt;http://badgerfish.ning.com&amp;lt;/a&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * @param xml&lt;br /&gt;
 *        the document to convert&lt;br /&gt;
 * @return a JSONObject representing the XML document&lt;br /&gt;
 * @throws JSONUtilsException&lt;br /&gt;
 */&lt;br /&gt;
public static JSONObject xmlToJson_BadgerFish(Object xml) throws JSONUtilsException&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Convert a JSONObject in BadgerFish notation into Node structure.&lt;br /&gt;
 * See &amp;lt;a href=&amp;quot;http://badgerfish.ning.com&amp;quot;&amp;gt;http://badgerfish.ning.com&amp;lt;/a&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * @param json&lt;br /&gt;
 *        a JSONObject&lt;br /&gt;
 * @return a Node representing the JSON document&lt;br /&gt;
 * @throws JSONUtilsException&lt;br /&gt;
 */&lt;br /&gt;
public static Node jsonToXml_BadgerFish(Object json) throws JSONUtilsException&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>G.dimaio</name></author>
		
	</entry>
</feed>