# Uses of Class
org.apache.sling.commons.json.JSONObject

Packages that use JSONObject
Package
Description
org.apache.sling.commons.json
org.apache.sling.commons.json.http
org.apache.sling.commons.json.io
org.apache.sling.commons.json.jcr
org.apache.sling.commons.json.sling
org.apache.sling.commons.json.util
org.apache.sling.commons.json.xml

## Uses of JSONObject in org.apache.sling.commons.json

Methods in org.apache.sling.commons.json that return JSONObject
Modifier and Type
Method
Description
`JSONObject`
JSONObject.`accumulate(String key, Object value)`
Deprecated.
Accumulate values under a key.
`JSONObject`
JSONObject.`append(String key, Object value)`
Deprecated.
Append values to the array under a key.
`JSONObject`
JSONArray.`getJSONObject(int index)`
Deprecated.
Get the JSONObject associated with an index.
`JSONObject`
JSONObject.`getJSONObject(String key)`
Deprecated.
Get the JSONObject value associated with a key.
`JSONObject`
JSONObject.`increment(String key)`
Deprecated.
Increment a property of a JSONObject.
`JSONObject`
JSONArray.`optJSONObject(int index)`
Deprecated.
Get the optional JSONObject associated with an index.
`JSONObject`
JSONArray.`optJSONObject(int index, JSONObject defaultValue)`
Deprecated.
Get the optional JSONObject associated with an index.
`JSONObject`
JSONObject.`optJSONObject(String key)`
Deprecated.
Get an optional JSONObject associated with a key.
`JSONObject`
JSONObject.`optJSONObject(String key, JSONObject defaultValue)`
Deprecated.
Get an optional JSONObject associated with a key, or the default if there is no such key or if the value is not a JSONObject.
`JSONObject`
JSONObject.`put(String key, boolean value)`
Deprecated.
Put a key/boolean pair in the JSONObject.
`JSONObject`
JSONObject.`put(String key, double value)`
Deprecated.
Put a key/double pair in the JSONObject.
`JSONObject`
JSONObject.`put(String key, float value)`
Deprecated.
Put a key/float pair in the JSONObject.
`JSONObject`
JSONObject.`put(String key, int value)`
Deprecated.
Put a key/int pair in the JSONObject.
`JSONObject`
JSONObject.`put(String key, long value)`
Deprecated.
Put a key/long pair in the JSONObject.
`JSONObject`
JSONObject.`put(String key, Object value)`
Deprecated.
Put a key/value pair in the JSONObject.
`JSONObject`
JSONObject.`put(String key, Collection<?> value)`
Deprecated.
Put a key/value pair in the JSONObject, where the value will be a JSONArray which is produced from a Collection.
`JSONObject`
JSONObject.`put(String key, Map<?,?> value)`
Deprecated.
Put a key/value pair in the JSONObject, where the value will be a JSONObject which is produced from a Map.
`JSONObject`
JSONObject.`putOnce(String key, Object value)`
Deprecated.
Put a key/value pair in the JSONObject, but only if the key and the value are both non-null, and only if there is not already a member with that name.
`JSONObject`
JSONObject.`putOpt(String key, Object value)`
Deprecated.
Put a key/value pair in the JSONObject, but only if the key and the value are both non-null.
`JSONObject`
JSONArray.`toJSONObject(JSONArray names)`
Deprecated.
Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.
Methods in org.apache.sling.commons.json with parameters of type JSONObject
Modifier and Type
Method
Description
`static String[]`
JSONObject.`getNames(JSONObject jo)`
Deprecated.
Get an array of field names from a JSONObject.
`JSONObject`
JSONArray.`optJSONObject(int index, JSONObject defaultValue)`
Deprecated.
Get the optional JSONObject associated with an index.
`JSONObject`
JSONObject.`optJSONObject(String key, JSONObject defaultValue)`
Deprecated.
Get an optional JSONObject associated with a key, or the default if there is no such key or if the value is not a JSONObject.
Constructors in org.apache.sling.commons.json with parameters of type JSONObject
Modifier
Constructor
Description
``
`JSONObject(JSONObject jo, String... names)`
Deprecated.
Construct a JSONObject from a subset of another JSONObject.

## Uses of JSONObject in org.apache.sling.commons.json.http

Methods in org.apache.sling.commons.json.http that return JSONObject
Modifier and Type
Method
Description
`static JSONObject`
Cookie.`toJSONObject(String string)`
Deprecated.
Convert a cookie specification string into a JSONObject.
`static JSONObject`
CookieList.`toJSONObject(String string)`
Deprecated.
Convert a cookie list into a JSONObject.
`static JSONObject`
HTTP.`toJSONObject(String string)`
Deprecated.
Convert an HTTP header string into a JSONObject.
Methods in org.apache.sling.commons.json.http with parameters of type JSONObject
Modifier and Type
Method
Description
`static String`
Cookie.`toString(JSONObject jo)`
Deprecated.
Convert a JSONObject into a cookie specification string.
`static String`
CookieList.`toString(JSONObject jo)`
Deprecated.
Convert a JSONObject into a cookie list.
`static String`
HTTP.`toString(JSONObject jo)`
Deprecated.
Convert a JSONObject into an HTTP header.

## Uses of JSONObject in org.apache.sling.commons.json.io

Methods in org.apache.sling.commons.json.io with parameters of type JSONObject
Modifier and Type
Method
Description
`String`
JSONRenderer.`prettyPrint(JSONObject jo, JSONRenderer.Options opt)`
Deprecated.
Make a prettyprinted JSON text of this JSONObject.
`String`
JSONRenderer.`toString(JSONObject jo)`
Deprecated.
Render the supplied JSONObject to a String, in the simplest possible way.
`Writer`
JSONRenderer.`write(Writer writer, JSONObject jo)`
Deprecated.
Write the contents of the supplied JSONObject as JSON text to a writer.
`JSONWriter`
JSONWriter.`writeObject(JSONObject o)`
Deprecated.
Append a JSON Object

## Uses of JSONObject in org.apache.sling.commons.json.jcr

Subclasses of JSONObject in org.apache.sling.commons.json.jcr
Modifier and Type
Class
Description
`class`
`JsonJcrNode`
Deprecated.

## Uses of JSONObject in org.apache.sling.commons.json.sling

Fields in org.apache.sling.commons.json.sling declared as JSONObject
Modifier and Type
Field
Description
`final JSONObject`
ResourceTraversor.Entry.`json`
Methods in org.apache.sling.commons.json.sling that return JSONObject
Modifier and Type
Method
Description
`static JSONObject`
JsonObjectCreator.`create(org.apache.sling.api.resource.Resource resource, int maxRecursionLevels)`
Deprecated.
Dump given resource in JSON, optionally recursing into its objects
`JSONObject`
ResourceTraversor.`getJSONObject()`
Deprecated.
Constructors in org.apache.sling.commons.json.sling with parameters of type JSONObject
Modifier
Constructor
Description
``
`Entry(org.apache.sling.api.resource.Resource r, JSONObject o)`

## Uses of JSONObject in org.apache.sling.commons.json.util

Methods in org.apache.sling.commons.json.util that return JSONObject
Modifier and Type
Method
Description
`static JSONObject`
CDL.`rowToJSONObject(JSONArray names, JSONTokener x)`
Deprecated.
Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.
`static JSONObject`
CDL.`rowToJSONObject(JSONArray names, JSONTokener x, char delimiter)`
Deprecated.
Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.

## Uses of JSONObject in org.apache.sling.commons.json.xml

Methods in org.apache.sling.commons.json.xml that return JSONObject
Modifier and Type
Method
Description
`static JSONObject`
XML.`toJSONObject(Reader reader)`
Deprecated.
Convert a well-formed (but not necessarily valid) XML into a JSONObject.
`static JSONObject`
XML.`toJSONObject(Reader reader, boolean keepStrings)`
Deprecated.
Convert a well-formed (but not necessarily valid) XML into a JSONObject.
`static JSONObject`
XML.`toJSONObject(Reader reader, org.apache.sling.commons.json.xml.XMLParserConfiguration config)`
Deprecated.
Convert a well-formed (but not necessarily valid) XML into a JSONObject.
`static JSONObject`
XML.`toJSONObject(String string)`
Deprecated.
Convert a well-formed (but not necessarily valid) XML string into a JSONObject.
`static JSONObject`
XML.`toJSONObject(String string, boolean keepStrings)`
Deprecated.
Convert a well-formed (but not necessarily valid) XML string into a JSONObject.
`static JSONObject`
XML.`toJSONObject(String string, org.apache.sling.commons.json.xml.XMLParserConfiguration config)`
Deprecated.
Convert a well-formed (but not necessarily valid) XML string into a JSONObject.