Skip to content

Commit

Permalink
Merge branch 'Alanscut-fix-adoc'
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Jun 3, 2024
2 parents 4de9af9 + 987707f commit 044b8fc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/guide/src/docs/asciidoc/groovy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ in the same manner as you do now with POJOs. There are other features as well:

[source,groovy]
----
def fromList = [1,true,'json'] as JSONarray
def fromList = [1,true,'json'] as JSONArray
def fromMap = [integer:1, bool: true] as JSONObject
def strAsJson1 = "{integer:1, bool: true}" as JSON
def strAsJson2 = "[1,2,3]" as JSON
Expand All @@ -31,7 +31,7 @@ def strAsFunc = "function(param){ this.param = param; }" as JSONFunction
ll create a JSONArray because it is a List).
** Any other type will be discarded, the object will not be affected nor
an exception will be thrown.
* JSONObject and JSONarray implement java.util.Comparable, which enables the use of
* JSONObject and JSONArray implement java.util.Comparable, which enables the use of
the comparison operators with them (including the spaceship operator).
* JSONObject implements java.util.Map and JSONArray implements java.util.List,
anything you can do with Maps and List can be done with JSONObject and JSONArray.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/src/docs/asciidoc/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ and many others.
These properties make JSON an ideal data-interchange
language.

NOTE: Documentation for older releases can be found at link:json-lib.sourceforge.net/[]
NOTE: Documentation for older releases can be found at link:http://json-lib.sourceforge.net/[]
12 changes: 6 additions & 6 deletions docs/guide/src/docs/asciidoc/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ class MyBean{
private String func1 = "function(i){ return this.options[i]; }";
private JSONFunction func2 = new JSONFunction(new String[]{"i"},"return this.options[i];");
// getters & setters
// getters, setters
...
}
JSONObject jsonObject = JSONObject.fromObject( new MyBean() );
System.out.println( jsonObject );
/* prints
{"name":"json","pojoId":1,"options":["a","f"],
"func1":function(i){ return this.options[i];},
"func1":"function(i){ return this.options[i];}",
"func2":function(i){ return this.options[i];}}
*/
----
Expand Down Expand Up @@ -153,12 +153,12 @@ Example:
----
class MyBean{
private List data;
// getters & setters
// getters, setters
}
class Person{
private String name;
// getters & setters
// getters, setters
}
...
Expand Down Expand Up @@ -206,7 +206,7 @@ with '@' will be treated as an attribute, any property named '#text' will be tre

Please review the javadoc for XMLSerializer to know more about the configurable options.

[cols="l,l"]
[cols="1,1"]
|===
|*Code* | *XML output*

Expand Down Expand Up @@ -246,7 +246,7 @@ JSONFunction needs an additional parameter that specifies that function's params
All xml attributes will have the prefix '@' and text nodes will have the property name '#text'. XMLSerializer supports
the rules outlined at http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html[Converting Between XML and JSON]

[cols="l,l"]
[cols="1,1"]
|===
|*XML input* | *Code*

Expand Down
2 changes: 1 addition & 1 deletion subprojects/json-lib-core/src/site/xdoc/features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<li>skip modifying map keys when transforming form JSON to Java if the key is not a valid JavaIdentifier</li>
<li>register your own JavaIdentifierTransformer strategy</li>
<li>plugin your own strategy for setting properties into a bean when transforming from JSON to Java thanks to PropertySetStrategy</li>
<li>publish events when building a JSONObject or JSONarray. The available events are:
<li>publish events when building a JSONObject or JSONArray. The available events are:
<ul>
<li>object start/end</li>
<li>array start/end</li>
Expand Down
4 changes: 2 additions & 2 deletions subprojects/json-lib-core/src/site/xdoc/groovy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
A String can be transformed into JSON, JSONObject, JSONArray and JSONFunction.
<br/>
<textarea cols="70" rows="4" class="groovy:nocontrols:nogutter" name="srccode">
def fromList = [1,true,'json'] as JSONarray
def fromList = [1,true,'json'] as JSONArray
def fromMap = [integer:1, bool: true] as JSONObject
def strAsJson1 = "{integer:1, bool: true}" as JSON
def strAsJson2 = "[1,2,3]" as JSON
Expand All @@ -46,7 +46,7 @@
<li>Any other type will be discarded, the object will not be affected nor an exception will be thrown.</li>
</ul>
</li>
<li>JSONObject and JSONarray implement java.util.Comparable, which enables the use of the comparison operators with them (including the spaceship operator).</li>
<li>JSONObject and JSONArray implement java.util.Comparable, which enables the use of the comparison operators with them (including the spaceship operator).</li>
<li>JSONObject implements java.util.Map and JSONArray implements java.util.List, anything you can do with Maps and List can be done with JSONObject and JSONArray.</li>
<li>JsonGroovyBuilder behaves like the JsonBuilder found in Grails but it will create a JSONObject/JSONArray instead of writing the built structure into a String.</li>
</ul>
Expand Down

0 comments on commit 044b8fc

Please sign in to comment.