From 4f7ad29163d4285e16791d8e3b67fab2942c83b1 Mon Sep 17 00:00:00 2001 From: stleary Date: Tue, 6 Oct 2020 15:13:19 -0500 Subject: [PATCH] update to latest --- META-INF/MANIFEST.MF | 6 - .../allclasses-frame.html | 76 +- .../allclasses-noframe.html | 76 +- .../constant-values.html | 328 +- .../deprecated-list.html | 315 +- help-doc.html => docs/help-doc.html | 442 +- index-all.html => docs/index-all.html | 2921 +++++++----- index.html => docs/index.html | 143 +- {org => docs/org}/json/CDL.html | 1054 +++-- {org => docs/org}/json/Cookie.html | 766 ++- {org => docs/org}/json/CookieList.html | 640 ++- {org => docs/org}/json/HTTP.html | 786 ++-- {org => docs/org}/json/HTTPTokener.html | 606 ++- {org => docs/org}/json/JSONArray.html | 4136 ++++++++++------- {org => docs/org}/json/JSONException.html | 636 ++- {org => docs/org}/json/JSONML.html | 1042 +++-- docs/org/json/JSONObject.html | 2755 +++++++++++ docs/org/json/JSONPointer.Builder.html | 334 ++ docs/org/json/JSONPointer.html | 414 ++ docs/org/json/JSONPointerException.html | 284 ++ docs/org/json/JSONPropertyIgnore.html | 162 + docs/org/json/JSONPropertyName.html | 214 + {org => docs/org}/json/JSONString.html | 468 +- {org => docs/org}/json/JSONStringer.html | 682 ++- {org => docs/org}/json/JSONTokener.html | 1386 +++--- {org => docs/org}/json/JSONWriter.html | 1210 ++--- {org => docs/org}/json/Property.html | 620 ++- docs/org/json/XML.html | 902 ++++ docs/org/json/XMLParserConfiguration.html | 657 +++ {org => docs/org}/json/XMLTokener.html | 971 ++-- docs/org/json/XMLXsiTypeConverter.html | 255 + {org => docs/org}/json/package-frame.html | 93 +- {org => docs/org}/json/package-summary.html | 580 +-- {org => docs/org}/json/package-tree.html | 347 +- overview-tree.html => docs/overview-tree.html | 355 +- docs/package-list | 1 + docs/script.js | 30 + .../serialized-form.html | 287 +- docs/stylesheet.css | 574 +++ org/json/JSONObject.html | 2197 --------- org/json/XML.html | 606 --- org/json/class-use/CDL.html | 124 - org/json/class-use/Cookie.html | 124 - org/json/class-use/CookieList.html | 124 - org/json/class-use/HTTP.html | 124 - org/json/class-use/HTTPTokener.html | 124 - org/json/class-use/JSONArray.html | 401 -- org/json/class-use/JSONException.html | 900 ---- org/json/class-use/JSONML.html | 124 - org/json/class-use/JSONObject.html | 376 -- org/json/class-use/JSONString.html | 124 - org/json/class-use/JSONStringer.html | 124 - org/json/class-use/JSONTokener.html | 215 - org/json/class-use/JSONWriter.html | 215 - org/json/class-use/Property.html | 124 - org/json/class-use/XML.html | 124 - org/json/class-use/XMLTokener.html | 159 - org/json/package-use.html | 171 - 58 files changed, 17687 insertions(+), 16347 deletions(-) delete mode 100644 META-INF/MANIFEST.MF rename allclasses-frame.html => docs/allclasses-frame.html (65%) rename allclasses-noframe.html => docs/allclasses-noframe.html (64%) rename constant-values.html => docs/constant-values.html (68%) rename deprecated-list.html => docs/deprecated-list.html (58%) rename help-doc.html => docs/help-doc.html (88%) rename index-all.html => docs/index-all.html (68%) rename index.html => docs/index.html (92%) rename {org => docs/org}/json/CDL.html (77%) rename {org => docs/org}/json/Cookie.html (64%) rename {org => docs/org}/json/CookieList.html (72%) rename {org => docs/org}/json/HTTP.html (73%) rename {org => docs/org}/json/HTTPTokener.html (74%) rename {org => docs/org}/json/JSONArray.html (54%) rename {org => docs/org}/json/JSONException.html (53%) rename {org => docs/org}/json/JSONML.html (51%) create mode 100644 docs/org/json/JSONObject.html create mode 100644 docs/org/json/JSONPointer.Builder.html create mode 100644 docs/org/json/JSONPointer.html create mode 100644 docs/org/json/JSONPointerException.html create mode 100644 docs/org/json/JSONPropertyIgnore.html create mode 100644 docs/org/json/JSONPropertyName.html rename {org => docs/org}/json/JSONString.html (86%) rename {org => docs/org}/json/JSONStringer.html (77%) rename {org => docs/org}/json/JSONTokener.html (67%) rename {org => docs/org}/json/JSONWriter.html (71%) rename {org => docs/org}/json/Property.html (71%) create mode 100644 docs/org/json/XML.html create mode 100644 docs/org/json/XMLParserConfiguration.html rename {org => docs/org}/json/XMLTokener.html (60%) create mode 100644 docs/org/json/XMLXsiTypeConverter.html rename {org => docs/org}/json/package-frame.html (65%) rename {org => docs/org}/json/package-summary.html (76%) rename {org => docs/org}/json/package-tree.html (63%) rename overview-tree.html => docs/overview-tree.html (64%) create mode 100644 docs/package-list create mode 100644 docs/script.js rename serialized-form.html => docs/serialized-form.html (78%) create mode 100644 docs/stylesheet.css delete mode 100644 org/json/JSONObject.html delete mode 100644 org/json/XML.html delete mode 100644 org/json/class-use/CDL.html delete mode 100644 org/json/class-use/Cookie.html delete mode 100644 org/json/class-use/CookieList.html delete mode 100644 org/json/class-use/HTTP.html delete mode 100644 org/json/class-use/HTTPTokener.html delete mode 100644 org/json/class-use/JSONArray.html delete mode 100644 org/json/class-use/JSONException.html delete mode 100644 org/json/class-use/JSONML.html delete mode 100644 org/json/class-use/JSONObject.html delete mode 100644 org/json/class-use/JSONString.html delete mode 100644 org/json/class-use/JSONStringer.html delete mode 100644 org/json/class-use/JSONTokener.html delete mode 100644 org/json/class-use/JSONWriter.html delete mode 100644 org/json/class-use/Property.html delete mode 100644 org/json/class-use/XML.html delete mode 100644 org/json/class-use/XMLTokener.html delete mode 100644 org/json/package-use.html diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF deleted file mode 100644 index 025de46..0000000 --- a/META-INF/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Archiver-Version: Plexus Archiver -Created-By: Apache Maven -Built-By: Benjamin -Build-Jdk: 1.8.0_05 - diff --git a/allclasses-frame.html b/docs/allclasses-frame.html similarity index 65% rename from allclasses-frame.html rename to docs/allclasses-frame.html index 0a63484..bcf41c4 100644 --- a/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -1,35 +1,41 @@ - - - - - - -All Classes (JSON in Java 20160212 API) - - - - - -

All Classes

-
- -
- - + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/allclasses-noframe.html b/docs/allclasses-noframe.html similarity index 64% rename from allclasses-noframe.html rename to docs/allclasses-noframe.html index 147fa66..f6aef55 100644 --- a/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -1,35 +1,41 @@ - - - - - - -All Classes (JSON in Java 20160212 API) - - - - - -

All Classes

-
- -
- - + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/constant-values.html b/docs/constant-values.html similarity index 68% rename from constant-values.html rename to docs/constant-values.html index c1ab35a..f7f4adc 100644 --- a/constant-values.html +++ b/docs/constant-values.html @@ -1,153 +1,175 @@ - - - - - - -Constant Field Values (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Constant Field Values

-

Contents

- -
-
- - -

org.json.*

- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Constant Field Values + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

org.json.*

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/deprecated-list.html b/docs/deprecated-list.html similarity index 58% rename from deprecated-list.html rename to docs/deprecated-list.html index 16dd088..61b9a2a 100644 --- a/deprecated-list.html +++ b/docs/deprecated-list.html @@ -1,148 +1,167 @@ - - - - - - -Deprecated List (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Deprecated API

-

Contents

- -
-
- - - -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+ +
+
+ + + +
+ +
+ + + + + + + +
+ + + + diff --git a/help-doc.html b/docs/help-doc.html similarity index 88% rename from help-doc.html rename to docs/help-doc.html index 9bff898..0b6c62f 100644 --- a/help-doc.html +++ b/docs/help-doc.html @@ -1,225 +1,217 @@ - - - - - - -API Help (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

How This API Document Is Organized

-
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
-
-
- -This help file applies to API documentation generated using the standard doclet.
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +API Help + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+ +This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/index-all.html b/docs/index-all.html similarity index 68% rename from index-all.html rename to docs/index-all.html index 088dccb..7b31a59 100644 --- a/index-all.html +++ b/docs/index-all.html @@ -1,1263 +1,1658 @@ - - - - - - -Index (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
A B C D E G H I J K L M N O P Q R S T U V W X  - - -

A

-
-
accumulate(String, Object) - Method in class org.json.JSONObject
-
-
Accumulate values under a key.
-
-
AMP - Static variable in class org.json.XML
-
-
The Character '&'.
-
-
APOS - Static variable in class org.json.XML
-
-
The Character '''.
-
-
append(String, Object) - Method in class org.json.JSONObject
-
-
Append values to the array under a key.
-
-
array() - Method in class org.json.JSONWriter
-
-
Begin appending a new array.
-
-
- - - -

B

-
-
back() - Method in class org.json.JSONTokener
-
-
Back up one character.
-
-
BANG - Static variable in class org.json.XML
-
-
The Character '!'.
-
-
- - - -

C

-
-
CDL - Class in org.json
-
-
This provides static methods to convert comma delimited text into a - JSONArray, and to convert a JSONArray into comma delimited text.
-
-
CDL() - Constructor for class org.json.CDL
-
 
-
Cookie - Class in org.json
-
-
Convert a web browser cookie specification to a JSONObject and back.
-
-
Cookie() - Constructor for class org.json.Cookie
-
 
-
CookieList - Class in org.json
-
-
Convert a web browser cookie list string to a JSONObject and back.
-
-
CookieList() - Constructor for class org.json.CookieList
-
 
-
CRLF - Static variable in class org.json.HTTP
-
-
Carriage return/line feed.
-
-
- - - -

D

-
-
dehexchar(char) - Static method in class org.json.JSONTokener
-
-
Get the hex value of a character (base16).
-
-
doubleToString(double) - Static method in class org.json.JSONObject
-
-
Produce a string from a double.
-
-
- - - -

E

-
-
end() - Method in class org.json.JSONTokener
-
 
-
endArray() - Method in class org.json.JSONWriter
-
-
End an array.
-
-
endObject() - Method in class org.json.JSONWriter
-
-
End an object.
-
-
entity - Static variable in class org.json.XMLTokener
-
-
The table of entity values.
-
-
EQ - Static variable in class org.json.XML
-
-
The Character '='.
-
-
escape(String) - Static method in class org.json.Cookie
-
-
Produce a copy of a string in which the characters '+', '%', '=', ';' - and control characters are replaced with "%hh".
-
-
escape(String) - Static method in class org.json.XML
-
-
Replace special characters with XML escapes: - - - & (ampersand) is replaced by &amp; - < (less than) is replaced by &lt; - > (greater than) is replaced by &gt; - " (double quote) is replaced by &quot; -
-
-
- - - -

G

-
-
get(int) - Method in class org.json.JSONArray
-
-
Get the object value associated with an index.
-
-
get(String) - Method in class org.json.JSONObject
-
-
Get the value object associated with a key.
-
-
getBigDecimal(int) - Method in class org.json.JSONArray
-
-
Get the BigDecimal value associated with an index.
-
-
getBigDecimal(String) - Method in class org.json.JSONObject
-
-
Get the BigDecimal value associated with a key.
-
-
getBigInteger(int) - Method in class org.json.JSONArray
-
-
Get the BigInteger value associated with an index.
-
-
getBigInteger(String) - Method in class org.json.JSONObject
-
-
Get the BigInteger value associated with a key.
-
-
getBoolean(int) - Method in class org.json.JSONArray
-
-
Get the boolean value associated with an index.
-
-
getBoolean(String) - Method in class org.json.JSONObject
-
-
Get the boolean value associated with a key.
-
-
getDouble(int) - Method in class org.json.JSONArray
-
-
Get the double value associated with an index.
-
-
getDouble(String) - Method in class org.json.JSONObject
-
-
Get the double value associated with a key.
-
-
getEnum(Class<E>, int) - Method in class org.json.JSONArray
-
-
Get the enum value associated with an index.
-
-
getEnum(Class<E>, String) - Method in class org.json.JSONObject
-
-
Get the enum value associated with a key.
-
-
getInt(int) - Method in class org.json.JSONArray
-
-
Get the int value associated with an index.
-
-
getInt(String) - Method in class org.json.JSONObject
-
-
Get the int value associated with a key.
-
-
getJSONArray(int) - Method in class org.json.JSONArray
-
-
Get the JSONArray associated with an index.
-
-
getJSONArray(String) - Method in class org.json.JSONObject
-
-
Get the JSONArray value associated with a key.
-
-
getJSONObject(int) - Method in class org.json.JSONArray
-
-
Get the JSONObject associated with an index.
-
-
getJSONObject(String) - Method in class org.json.JSONObject
-
-
Get the JSONObject value associated with a key.
-
-
getLong(int) - Method in class org.json.JSONArray
-
-
Get the long value associated with an index.
-
-
getLong(String) - Method in class org.json.JSONObject
-
-
Get the long value associated with a key.
-
-
getNames(JSONObject) - Static method in class org.json.JSONObject
-
-
Get an array of field names from a JSONObject.
-
-
getNames(Object) - Static method in class org.json.JSONObject
-
-
Get an array of field names from an Object.
-
-
getString(int) - Method in class org.json.JSONArray
-
-
Get the string associated with an index.
-
-
getString(String) - Method in class org.json.JSONObject
-
-
Get the string associated with a key.
-
-
GT - Static variable in class org.json.XML
-
-
The Character '>'.
-
-
- - - -

H

-
-
has(String) - Method in class org.json.JSONObject
-
-
Determine if the JSONObject contains a specific key.
-
-
HTTP - Class in org.json
-
-
Convert an HTTP header to a JSONObject and back.
-
-
HTTP() - Constructor for class org.json.HTTP
-
 
-
HTTPTokener - Class in org.json
-
-
The HTTPTokener extends the JSONTokener to provide additional methods - for the parsing of HTTP headers.
-
-
HTTPTokener(String) - Constructor for class org.json.HTTPTokener
-
-
Construct an HTTPTokener from a string.
-
-
- - - -

I

-
-
increment(String) - Method in class org.json.JSONObject
-
-
Increment a property of a JSONObject.
-
-
isNull(int) - Method in class org.json.JSONArray
-
-
Determine if the value is null.
-
-
isNull(String) - Method in class org.json.JSONObject
-
-
Determine if the value associated with the key is null or if there is no - value.
-
-
iterator() - Method in class org.json.JSONArray
-
 
-
- - - -

J

-
-
join(String) - Method in class org.json.JSONArray
-
-
Make a string from the contents of this JSONArray.
-
-
JSONArray - Class in org.json
-
-
A JSONArray is an ordered sequence of values.
-
-
JSONArray() - Constructor for class org.json.JSONArray
-
-
Construct an empty JSONArray.
-
-
JSONArray(JSONTokener) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from a JSONTokener.
-
-
JSONArray(String) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from a source JSON text.
-
-
JSONArray(Collection<?>) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from a Collection.
-
-
JSONArray(Object) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from an array
-
-
JSONException - Exception in org.json
-
-
The JSONException is thrown by the JSON.org classes when things are amiss.
-
-
JSONException(String) - Constructor for exception org.json.JSONException
-
-
Constructs a JSONException with an explanatory message.
-
-
JSONException(String, Throwable) - Constructor for exception org.json.JSONException
-
-
Constructs a JSONException with an explanatory message and cause.
-
-
JSONException(Throwable) - Constructor for exception org.json.JSONException
-
-
Constructs a new JSONException with the specified cause.
-
-
JSONML - Class in org.json
-
-
This provides static methods to convert an XML text into a JSONArray or - JSONObject, and to covert a JSONArray or JSONObject into an XML text using - the JsonML transform.
-
-
JSONML() - Constructor for class org.json.JSONML
-
 
-
JSONObject - Class in org.json
-
-
A JSONObject is an unordered collection of name/value pairs.
-
-
JSONObject() - Constructor for class org.json.JSONObject
-
-
Construct an empty JSONObject.
-
-
JSONObject(JSONObject, String[]) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a subset of another JSONObject.
-
-
JSONObject(JSONTokener) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a JSONTokener.
-
-
JSONObject(Map<?, ?>) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a Map.
-
-
JSONObject(Object) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from an Object using bean getters.
-
-
JSONObject(Object, String[]) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from an Object, using reflection to find the - public members.
-
-
JSONObject(String) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a source JSON text string.
-
-
JSONObject(String, Locale) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a ResourceBundle.
-
-
JSONString - Interface in org.json
-
-
The JSONString interface allows a toJSONString() - method so that a class can change the behavior of - JSONObject.toString(), JSONArray.toString(), - and JSONWriter.value(Object).
-
-
JSONStringer - Class in org.json
-
-
JSONStringer provides a quick and convenient way of producing JSON text.
-
-
JSONStringer() - Constructor for class org.json.JSONStringer
-
-
Make a fresh JSONStringer.
-
-
JSONTokener - Class in org.json
-
-
A JSONTokener takes a source string and extracts characters and tokens from - it.
-
-
JSONTokener(Reader) - Constructor for class org.json.JSONTokener
-
-
Construct a JSONTokener from a Reader.
-
-
JSONTokener(InputStream) - Constructor for class org.json.JSONTokener
-
-
Construct a JSONTokener from an InputStream.
-
-
JSONTokener(String) - Constructor for class org.json.JSONTokener
-
-
Construct a JSONTokener from a string.
-
-
JSONWriter - Class in org.json
-
-
JSONWriter provides a quick and convenient way of producing JSON text.
-
-
JSONWriter(Writer) - Constructor for class org.json.JSONWriter
-
-
Make a fresh JSONWriter.
-
-
- - - -

K

-
-
key(String) - Method in class org.json.JSONWriter
-
-
Append a key.
-
-
keys() - Method in class org.json.JSONObject
-
-
Get an enumeration of the keys of the JSONObject.
-
-
keySet() - Method in class org.json.JSONObject
-
-
Get a set of keys of the JSONObject.
-
-
- - - -

L

-
-
length() - Method in class org.json.JSONArray
-
-
Get the number of elements in the JSONArray, included nulls.
-
-
length() - Method in class org.json.JSONObject
-
-
Get the number of keys stored in the JSONObject.
-
-
LT - Static variable in class org.json.XML
-
-
The Character '<'.
-
-
- - - -

M

-
-
mode - Variable in class org.json.JSONWriter
-
-
The current mode.
-
-
more() - Method in class org.json.JSONTokener
-
-
Determine if the source string still contains characters that next() - can consume.
-
-
- - - -

N

-
-
names() - Method in class org.json.JSONObject
-
-
Produce a JSONArray containing the names of the elements of this - JSONObject.
-
-
next() - Method in class org.json.JSONTokener
-
-
Get the next character in the source string.
-
-
next(char) - Method in class org.json.JSONTokener
-
-
Consume the next character, and check that it matches a specified - character.
-
-
next(int) - Method in class org.json.JSONTokener
-
-
Get the next n characters.
-
-
nextCDATA() - Method in class org.json.XMLTokener
-
-
Get the text in the CDATA block.
-
-
nextClean() - Method in class org.json.JSONTokener
-
-
Get the next char in the string, skipping whitespace.
-
-
nextContent() - Method in class org.json.XMLTokener
-
-
Get the next XML outer token, trimming whitespace.
-
-
nextEntity(char) - Method in class org.json.XMLTokener
-
-
Return the next entity.
-
-
nextMeta() - Method in class org.json.XMLTokener
-
-
Returns the next XML meta token.
-
-
nextString(char) - Method in class org.json.JSONTokener
-
-
Return the characters up to the next close quote character.
-
-
nextTo(char) - Method in class org.json.JSONTokener
-
-
Get the text up but not including the specified character or the - end of line, whichever comes first.
-
-
nextTo(String) - Method in class org.json.JSONTokener
-
-
Get the text up but not including one of the specified delimiter - characters or the end of line, whichever comes first.
-
-
nextToken() - Method in class org.json.HTTPTokener
-
-
Get the next token or string.
-
-
nextToken() - Method in class org.json.XMLTokener
-
-
Get the next XML Token.
-
-
nextValue() - Method in class org.json.JSONTokener
-
-
Get the next value.
-
-
noSpace(String) - Static method in class org.json.XML
-
-
Throw an exception if the string contains whitespace.
-
-
NULL - Static variable in class org.json.JSONObject
-
-
It is sometimes more convenient and less ambiguous to have a - NULL object than to use Java's null value.
-
-
numberToString(Number) - Static method in class org.json.JSONObject
-
-
Produce a string from a Number.
-
-
- - - -

O

-
-
object() - Method in class org.json.JSONWriter
-
-
Begin appending a new object.
-
-
opt(int) - Method in class org.json.JSONArray
-
-
Get the optional object value associated with an index.
-
-
opt(String) - Method in class org.json.JSONObject
-
-
Get an optional value associated with a key.
-
-
optBigDecimal(int, BigDecimal) - Method in class org.json.JSONArray
-
-
Get the optional BigDecimal value associated with an index.
-
-
optBigDecimal(String, BigDecimal) - Method in class org.json.JSONObject
-
-
Get an optional BigDecimal associated with a key, or the defaultValue if - there is no such key or if its value is not a number.
-
-
optBigInteger(int, BigInteger) - Method in class org.json.JSONArray
-
-
Get the optional BigInteger value associated with an index.
-
-
optBigInteger(String, BigInteger) - Method in class org.json.JSONObject
-
-
Get an optional BigInteger associated with a key, or the defaultValue if - there is no such key or if its value is not a number.
-
-
optBoolean(int) - Method in class org.json.JSONArray
-
-
Get the optional boolean value associated with an index.
-
-
optBoolean(int, boolean) - Method in class org.json.JSONArray
-
-
Get the optional boolean value associated with an index.
-
-
optBoolean(String) - Method in class org.json.JSONObject
-
-
Get an optional boolean associated with a key.
-
-
optBoolean(String, boolean) - Method in class org.json.JSONObject
-
-
Get an optional boolean associated with a key.
-
-
optDouble(int) - Method in class org.json.JSONArray
-
-
Get the optional double value associated with an index.
-
-
optDouble(int, double) - Method in class org.json.JSONArray
-
-
Get the optional double value associated with an index.
-
-
optDouble(String) - Method in class org.json.JSONObject
-
-
Get an optional double associated with a key, or NaN if there is no such - key or if its value is not a number.
-
-
optDouble(String, double) - Method in class org.json.JSONObject
-
-
Get an optional double associated with a key, or the defaultValue if - there is no such key or if its value is not a number.
-
-
optEnum(Class<E>, int) - Method in class org.json.JSONArray
-
-
Get the enum value associated with a key.
-
-
optEnum(Class<E>, int, E) - Method in class org.json.JSONArray
-
-
Get the enum value associated with a key.
-
-
optEnum(Class<E>, String) - Method in class org.json.JSONObject
-
-
Get the enum value associated with a key.
-
-
optEnum(Class<E>, String, E) - Method in class org.json.JSONObject
-
-
Get the enum value associated with a key.
-
-
optInt(int) - Method in class org.json.JSONArray
-
-
Get the optional int value associated with an index.
-
-
optInt(int, int) - Method in class org.json.JSONArray
-
-
Get the optional int value associated with an index.
-
-
optInt(String) - Method in class org.json.JSONObject
-
-
Get an optional int value associated with a key, or zero if there is no - such key or if the value is not a number.
-
-
optInt(String, int) - Method in class org.json.JSONObject
-
-
Get an optional int value associated with a key, or the default if there - is no such key or if the value is not a number.
-
-
optJSONArray(int) - Method in class org.json.JSONArray
-
-
Get the optional JSONArray associated with an index.
-
-
optJSONArray(String) - Method in class org.json.JSONObject
-
-
Get an optional JSONArray associated with a key.
-
-
optJSONObject(int) - Method in class org.json.JSONArray
-
-
Get the optional JSONObject associated with an index.
-
-
optJSONObject(String) - Method in class org.json.JSONObject
-
-
Get an optional JSONObject associated with a key.
-
-
optLong(int) - Method in class org.json.JSONArray
-
-
Get the optional long value associated with an index.
-
-
optLong(int, long) - Method in class org.json.JSONArray
-
-
Get the optional long value associated with an index.
-
-
optLong(String) - Method in class org.json.JSONObject
-
-
Get an optional long value associated with a key, or zero if there is no - such key or if the value is not a number.
-
-
optLong(String, long) - Method in class org.json.JSONObject
-
-
Get an optional long value associated with a key, or the default if there - is no such key or if the value is not a number.
-
-
optString(int) - Method in class org.json.JSONArray
-
-
Get the optional string value associated with an index.
-
-
optString(int, String) - Method in class org.json.JSONArray
-
-
Get the optional string associated with an index.
-
-
optString(String) - Method in class org.json.JSONObject
-
-
Get an optional string associated with a key.
-
-
optString(String, String) - Method in class org.json.JSONObject
-
-
Get an optional string associated with a key.
-
-
org.json - package org.json
-
 
-
- - - -

P

-
-
Property - Class in org.json
-
-
Converts a Property file data into JSONObject and back.
-
-
Property() - Constructor for class org.json.Property
-
 
-
put(boolean) - Method in class org.json.JSONArray
-
-
Append a boolean value.
-
-
put(Collection<?>) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
-
-
put(double) - Method in class org.json.JSONArray
-
-
Append a double value.
-
-
put(int) - Method in class org.json.JSONArray
-
-
Append an int value.
-
-
put(long) - Method in class org.json.JSONArray
-
-
Append an long value.
-
-
put(Map<?, ?>) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONObject which - is produced from a Map.
-
-
put(Object) - Method in class org.json.JSONArray
-
-
Append an object value.
-
-
put(int, boolean) - Method in class org.json.JSONArray
-
-
Put or replace a boolean value in the JSONArray.
-
-
put(int, Collection<?>) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
-
-
put(int, double) - Method in class org.json.JSONArray
-
-
Put or replace a double value.
-
-
put(int, int) - Method in class org.json.JSONArray
-
-
Put or replace an int value.
-
-
put(int, long) - Method in class org.json.JSONArray
-
-
Put or replace a long value.
-
-
put(int, Map<?, ?>) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONObject that - is produced from a Map.
-
-
put(int, Object) - Method in class org.json.JSONArray
-
-
Put or replace an object value in the JSONArray.
-
-
put(String, boolean) - Method in class org.json.JSONObject
-
-
Put a key/boolean pair in the JSONObject.
-
-
put(String, Collection<?>) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, where the value will be a - JSONArray which is produced from a Collection.
-
-
put(String, double) - Method in class org.json.JSONObject
-
-
Put a key/double pair in the JSONObject.
-
-
put(String, int) - Method in class org.json.JSONObject
-
-
Put a key/int pair in the JSONObject.
-
-
put(String, long) - Method in class org.json.JSONObject
-
-
Put a key/long pair in the JSONObject.
-
-
put(String, Map<?, ?>) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, where the value will be a - JSONObject which is produced from a Map.
-
-
put(String, Object) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject.
-
-
putOnce(String, Object) - Method in class org.json.JSONObject
-
-
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.
-
-
putOpt(String, Object) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, but only if the key and the value - are both non-null.
-
-
- - - -

Q

-
-
QUEST - Static variable in class org.json.XML
-
-
The Character '?'.
-
-
QUOT - Static variable in class org.json.XML
-
-
The Character '"'.
-
-
quote(String) - Static method in class org.json.JSONObject
-
-
Produce a string in double quotes with backslash sequences in all the - right places.
-
-
quote(String, Writer) - Static method in class org.json.JSONObject
-
 
-
- - - -

R

-
-
remove(int) - Method in class org.json.JSONArray
-
-
Remove an index and close the hole.
-
-
remove(String) - Method in class org.json.JSONObject
-
-
Remove a name and its value, if present.
-
-
rowToJSONArray(JSONTokener) - Static method in class org.json.CDL
-
-
Produce a JSONArray of strings from a row of comma delimited values.
-
-
rowToJSONObject(JSONArray, JSONTokener) - Static method in class org.json.CDL
-
-
Produce a JSONObject from a row of comma delimited text, using a - parallel JSONArray of strings to provides the names of the elements.
-
-
rowToString(JSONArray) - Static method in class org.json.CDL
-
-
Produce a comma delimited text row from a JSONArray.
-
-
- - - -

S

-
-
similar(Object) - Method in class org.json.JSONArray
-
-
Determine if two JSONArrays are similar.
-
-
similar(Object) - Method in class org.json.JSONObject
-
-
Determine if two JSONObjects are similar.
-
-
skipPast(String) - Method in class org.json.XMLTokener
-
-
Skip characters until past the requested string.
-
-
skipTo(char) - Method in class org.json.JSONTokener
-
-
Skip characters until the next character is the requested character.
-
-
SLASH - Static variable in class org.json.XML
-
-
The Character '/'.
-
-
stringToValue(String) - Static method in class org.json.JSONObject
-
-
Try to convert a string into a number, boolean, or null.
-
-
stringToValue(String) - Static method in class org.json.XML
-
-
Deprecated. - -
-
-
syntaxError(String) - Method in class org.json.JSONTokener
-
-
Make a JSONException to signal a syntax error.
-
-
- - - -

T

-
-
testValidity(Object) - Static method in class org.json.JSONObject
-
-
Throw an exception if the object is a NaN or infinite number.
-
-
toJSONArray(String) - Static method in class org.json.CDL
-
-
Produce a JSONArray of JSONObjects from a comma delimited text string, - using the first row as a source of names.
-
-
toJSONArray(JSONTokener) - Static method in class org.json.CDL
-
-
Produce a JSONArray of JSONObjects from a comma delimited text string, - using the first row as a source of names.
-
-
toJSONArray(JSONArray, String) - Static method in class org.json.CDL
-
-
Produce a JSONArray of JSONObjects from a comma delimited text string - using a supplied JSONArray as the source of element names.
-
-
toJSONArray(JSONArray, JSONTokener) - Static method in class org.json.CDL
-
-
Produce a JSONArray of JSONObjects from a comma delimited text string - using a supplied JSONArray as the source of element names.
-
-
toJSONArray(String) - Static method in class org.json.JSONML
-
-
Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform.
-
-
toJSONArray(XMLTokener) - Static method in class org.json.JSONML
-
-
Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform.
-
-
toJSONArray(JSONArray) - Method in class org.json.JSONObject
-
-
Produce a JSONArray containing the values of the members of this - JSONObject.
-
-
toJSONObject(String) - Static method in class org.json.Cookie
-
-
Convert a cookie specification string into a JSONObject.
-
-
toJSONObject(String) - Static method in class org.json.CookieList
-
-
Convert a cookie list into a JSONObject.
-
-
toJSONObject(String) - Static method in class org.json.HTTP
-
-
Convert an HTTP header string into a JSONObject.
-
-
toJSONObject(JSONArray) - Method in class org.json.JSONArray
-
-
Produce a JSONObject by combining a JSONArray of names with the values of - this JSONArray.
-
-
toJSONObject(XMLTokener) - Static method in class org.json.JSONML
-
-
Convert a well-formed (but not necessarily valid) XML string into a - JSONObject using the JsonML transform.
-
-
toJSONObject(String) - Static method in class org.json.JSONML
-
-
Convert a well-formed (but not necessarily valid) XML string into a - JSONObject using the JsonML transform.
-
-
toJSONObject(Properties) - Static method in class org.json.Property
-
-
Converts a property file object into a JSONObject.
-
-
toJSONObject(String) - Static method in class org.json.XML
-
-
Convert a well-formed (but not necessarily valid) XML string into a - JSONObject.
-
-
toJSONString() - Method in interface org.json.JSONString
-
-
The toJSONString method allows a class to produce its own JSON - serialization.
-
-
toProperties(JSONObject) - Static method in class org.json.Property
-
-
Converts the JSONObject into a property file object.
-
-
toString(JSONArray) - Static method in class org.json.CDL
-
-
Produce a comma delimited text from a JSONArray of JSONObjects.
-
-
toString(JSONArray, JSONArray) - Static method in class org.json.CDL
-
-
Produce a comma delimited text from a JSONArray of JSONObjects using - a provided list of names.
-
-
toString(JSONObject) - Static method in class org.json.Cookie
-
-
Convert a JSONObject into a cookie specification string.
-
-
toString(JSONObject) - Static method in class org.json.CookieList
-
-
Convert a JSONObject into a cookie list.
-
-
toString(JSONObject) - Static method in class org.json.HTTP
-
-
Convert a JSONObject into an HTTP header.
-
-
toString() - Method in class org.json.JSONArray
-
-
Make a JSON text of this JSONArray.
-
-
toString(int) - Method in class org.json.JSONArray
-
-
Make a prettyprinted JSON text of this JSONArray.
-
-
toString(JSONArray) - Static method in class org.json.JSONML
-
-
Reverse the JSONML transformation, making an XML text from a JSONArray.
-
-
toString(JSONObject) - Static method in class org.json.JSONML
-
-
Reverse the JSONML transformation, making an XML text from a JSONObject.
-
-
toString() - Method in class org.json.JSONObject
-
-
Make a JSON text of this JSONObject.
-
-
toString(int) - Method in class org.json.JSONObject
-
-
Make a prettyprinted JSON text of this JSONObject.
-
-
toString() - Method in class org.json.JSONStringer
-
-
Return the JSON text.
-
-
toString() - Method in class org.json.JSONTokener
-
-
Make a printable string of this JSONTokener.
-
-
toString(Object) - Static method in class org.json.XML
-
-
Convert a JSONObject into a well-formed, element-normal XML string.
-
-
toString(Object, String) - Static method in class org.json.XML
-
-
Convert a JSONObject into a well-formed, element-normal XML string.
-
-
- - - -

U

-
-
unescape(String) - Static method in class org.json.Cookie
-
-
Convert %hh sequences to single characters, and - convert plus to space.
-
-
- - - -

V

-
-
value(boolean) - Method in class org.json.JSONWriter
-
-
Append either the value true or the value - false.
-
-
value(double) - Method in class org.json.JSONWriter
-
-
Append a double value.
-
-
value(long) - Method in class org.json.JSONWriter
-
-
Append a long value.
-
-
value(Object) - Method in class org.json.JSONWriter
-
-
Append an object value.
-
-
valueToString(Object) - Static method in class org.json.JSONObject
-
-
Make a JSON text of an Object value.
-
-
- - - -

W

-
-
wrap(Object) - Static method in class org.json.JSONObject
-
-
Wrap an object, if necessary.
-
-
write(Writer) - Method in class org.json.JSONArray
-
-
Write the contents of the JSONArray as JSON text to a writer.
-
-
write(Writer, int, int) - Method in class org.json.JSONArray
-
-
Write the contents of the JSONArray as JSON text to a writer.
-
-
write(Writer) - Method in class org.json.JSONObject
-
-
Write the contents of the JSONObject as JSON text to a writer.
-
-
write(Writer, int, int) - Method in class org.json.JSONObject
-
-
Write the contents of the JSONObject as JSON text to a writer.
-
-
writer - Variable in class org.json.JSONWriter
-
-
The writer that will receive the output.
-
-
- - - -

X

-
-
XML - Class in org.json
-
-
This provides static methods to convert an XML text into a JSONObject, and to - covert a JSONObject into an XML text.
-
-
XML() - Constructor for class org.json.XML
-
 
-
XMLTokener - Class in org.json
-
-
The XMLTokener extends the JSONTokener to provide additional methods - for the parsing of XML texts.
-
-
XMLTokener(String) - Constructor for class org.json.XMLTokener
-
-
Construct an XMLTokener from a string.
-
-
-A B C D E G H I J K L M N O P Q R S T U V W X 
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E G H I J K L M N O P Q R S T U V W X  + + +

A

+
+
accumulate(String, Object) - Method in class org.json.JSONObject
+
+
Accumulate values under a key.
+
+
AMP - Static variable in class org.json.XML
+
+
The Character '&'.
+
+
APOS - Static variable in class org.json.XML
+
+
The Character '''.
+
+
append(String, Object) - Method in class org.json.JSONObject
+
+
Append values to the array under a key.
+
+
append(String) - Method in class org.json.JSONPointer.Builder
+
+
Adds an arbitrary token to the list of reference tokens.
+
+
append(int) - Method in class org.json.JSONPointer.Builder
+
+
Adds an integer to the reference token list.
+
+
array() - Method in class org.json.JSONWriter
+
+
Begin appending a new array.
+
+
+ + + +

B

+
+
back() - Method in class org.json.JSONTokener
+
+
Back up one character.
+
+
BANG - Static variable in class org.json.XML
+
+
The Character '!'.
+
+
build() - Method in class org.json.JSONPointer.Builder
+
+
Creates a JSONPointer instance using the tokens previously set using the + JSONPointer.Builder.append(String) method calls.
+
+
builder() - Static method in class org.json.JSONPointer
+
+
Static factory method for JSONPointer.Builder.
+
+
Builder() - Constructor for class org.json.JSONPointer.Builder
+
 
+
+ + + +

C

+
+
CDL - Class in org.json
+
+
This provides static methods to convert comma delimited text into a + JSONArray, and to convert a JSONArray into comma delimited text.
+
+
CDL() - Constructor for class org.json.CDL
+
 
+
clone() - Method in class org.json.XMLParserConfiguration
+
+
Provides a new instance of the same configuration.
+
+
convert(String) - Method in interface org.json.XMLXsiTypeConverter
+
 
+
Cookie - Class in org.json
+
+
Convert a web browser cookie specification to a JSONObject and back.
+
+
Cookie() - Constructor for class org.json.Cookie
+
 
+
CookieList - Class in org.json
+
+
Convert a web browser cookie list string to a JSONObject and back.
+
+
CookieList() - Constructor for class org.json.CookieList
+
 
+
CRLF - Static variable in class org.json.HTTP
+
+
Carriage return/line feed.
+
+
+ + + +

D

+
+
dehexchar(char) - Static method in class org.json.JSONTokener
+
+
Get the hex value of a character (base16).
+
+
doubleToString(double) - Static method in class org.json.JSONObject
+
+
Produce a string from a double.
+
+
+ + + +

E

+
+
end() - Method in class org.json.JSONTokener
+
+
Checks if the end of the input has been reached.
+
+
endArray() - Method in class org.json.JSONWriter
+
+
End an array.
+
+
endObject() - Method in class org.json.JSONWriter
+
+
End an object.
+
+
entity - Static variable in class org.json.XMLTokener
+
+
The table of entity values.
+
+
entrySet() - Method in class org.json.JSONObject
+
+
Get a set of entries of the JSONObject.
+
+
EQ - Static variable in class org.json.XML
+
+
The Character '='.
+
+
escape(String) - Static method in class org.json.Cookie
+
+
Produce a copy of a string in which the characters '+', '%', '=', ';' + and control characters are replaced with "%hh".
+
+
escape(String) - Static method in class org.json.XML
+
+
Replace special characters with XML escapes:
+
+
+ + + +

G

+
+
get(int) - Method in class org.json.JSONArray
+
+
Get the object value associated with an index.
+
+
get(String) - Method in class org.json.JSONObject
+
+
Get the value object associated with a key.
+
+
getBigDecimal(int) - Method in class org.json.JSONArray
+
+
Get the BigDecimal value associated with an index.
+
+
getBigDecimal(String) - Method in class org.json.JSONObject
+
+
Get the BigDecimal value associated with a key.
+
+
getBigInteger(int) - Method in class org.json.JSONArray
+
+
Get the BigInteger value associated with an index.
+
+
getBigInteger(String) - Method in class org.json.JSONObject
+
+
Get the BigInteger value associated with a key.
+
+
getBoolean(int) - Method in class org.json.JSONArray
+
+
Get the boolean value associated with an index.
+
+
getBoolean(String) - Method in class org.json.JSONObject
+
+
Get the boolean value associated with a key.
+
+
getcDataTagName() - Method in class org.json.XMLParserConfiguration
+
+
The name of the key in a JSON Object that indicates a CDATA section.
+
+
getDouble(int) - Method in class org.json.JSONArray
+
+
Get the double value associated with an index.
+
+
getDouble(String) - Method in class org.json.JSONObject
+
+
Get the double value associated with a key.
+
+
getEnum(Class<E>, int) - Method in class org.json.JSONArray
+
+
Get the enum value associated with an index.
+
+
getEnum(Class<E>, String) - Method in class org.json.JSONObject
+
+
Get the enum value associated with a key.
+
+
getFloat(int) - Method in class org.json.JSONArray
+
+
Get the float value associated with a key.
+
+
getFloat(String) - Method in class org.json.JSONObject
+
+
Get the float value associated with a key.
+
+
getInt(int) - Method in class org.json.JSONArray
+
+
Get the int value associated with an index.
+
+
getInt(String) - Method in class org.json.JSONObject
+
+
Get the int value associated with a key.
+
+
getJSONArray(int) - Method in class org.json.JSONArray
+
+
Get the JSONArray associated with an index.
+
+
getJSONArray(String) - Method in class org.json.JSONObject
+
+
Get the JSONArray value associated with a key.
+
+
getJSONObject(int) - Method in class org.json.JSONArray
+
+
Get the JSONObject associated with an index.
+
+
getJSONObject(String) - Method in class org.json.JSONObject
+
+
Get the JSONObject value associated with a key.
+
+
getLong(int) - Method in class org.json.JSONArray
+
+
Get the long value associated with an index.
+
+
getLong(String) - Method in class org.json.JSONObject
+
+
Get the long value associated with a key.
+
+
getNames(JSONObject) - Static method in class org.json.JSONObject
+
+
Get an array of field names from a JSONObject.
+
+
getNames(Object) - Static method in class org.json.JSONObject
+
+
Get an array of public field names from an Object.
+
+
getNumber(int) - Method in class org.json.JSONArray
+
+
Get the Number value associated with a key.
+
+
getNumber(String) - Method in class org.json.JSONObject
+
+
Get the Number value associated with a key.
+
+
getString(int) - Method in class org.json.JSONArray
+
+
Get the string associated with an index.
+
+
getString(String) - Method in class org.json.JSONObject
+
+
Get the string associated with a key.
+
+
getXsiTypeMap() - Method in class org.json.XMLParserConfiguration
+
+
When parsing the XML into JSON, specifies that the values with attribute xsi:type + will be converted to target type defined to client in this configuration + Map<String, XMLXsiTypeConverter<?>> to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
+
+
GT - Static variable in class org.json.XML
+
+
The Character
+
+
+ + + +

H

+
+
has(String) - Method in class org.json.JSONObject
+
+
Determine if the JSONObject contains a specific key.
+
+
HTTP - Class in org.json
+
+
Convert an HTTP header to a JSONObject and back.
+
+
HTTP() - Constructor for class org.json.HTTP
+
 
+
HTTPTokener - Class in org.json
+
+
The HTTPTokener extends the JSONTokener to provide additional methods + for the parsing of HTTP headers.
+
+
HTTPTokener(String) - Constructor for class org.json.HTTPTokener
+
+
Construct an HTTPTokener from a string.
+
+
+ + + +

I

+
+
increment(String) - Method in class org.json.JSONObject
+
+
Increment a property of a JSONObject.
+
+
isConvertNilAttributeToNull() - Method in class org.json.XMLParserConfiguration
+
+
When parsing the XML into JSON, specifies if values with attribute xsi:nil="true" + should be kept as attribute(false), or they should be converted to + null(true)
+
+
isDecimalNotation(String) - Static method in class org.json.JSONObject
+
+
Tests if the value should be tried as a decimal.
+
+
isEmpty() - Method in class org.json.JSONArray
+
+
Check if JSONArray is empty.
+
+
isEmpty() - Method in class org.json.JSONObject
+
+
Check if JSONObject is empty.
+
+
isKeepStrings() - Method in class org.json.XMLParserConfiguration
+
+
When parsing the XML into JSON, specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string)
+
+
isNull(int) - Method in class org.json.JSONArray
+
+
Determine if the value is null.
+
+
isNull(String) - Method in class org.json.JSONObject
+
+
Determine if the value associated with the key is null or if there is no + value.
+
+
iterator() - Method in class org.json.JSONArray
+
 
+
+ + + +

J

+
+
join(String) - Method in class org.json.JSONArray
+
+
Make a string from the contents of this JSONArray.
+
+
JSONArray - Class in org.json
+
+
A JSONArray is an ordered sequence of values.
+
+
JSONArray() - Constructor for class org.json.JSONArray
+
+
Construct an empty JSONArray.
+
+
JSONArray(JSONTokener) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray from a JSONTokener.
+
+
JSONArray(String) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray from a source JSON text.
+
+
JSONArray(Collection<?>) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray from a Collection.
+
+
JSONArray(Iterable<?>) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray from an Iterable.
+
+
JSONArray(JSONArray) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray from another JSONArray.
+
+
JSONArray(Object) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray from an array.
+
+
JSONArray(int) - Constructor for class org.json.JSONArray
+
+
Construct a JSONArray with the specified initial capacity.
+
+
JSONException - Exception in org.json
+
+
The JSONException is thrown by the JSON.org classes when things are amiss.
+
+
JSONException(String) - Constructor for exception org.json.JSONException
+
+
Constructs a JSONException with an explanatory message.
+
+
JSONException(String, Throwable) - Constructor for exception org.json.JSONException
+
+
Constructs a JSONException with an explanatory message and cause.
+
+
JSONException(Throwable) - Constructor for exception org.json.JSONException
+
+
Constructs a new JSONException with the specified cause.
+
+
JSONML - Class in org.json
+
+
This provides static methods to convert an XML text into a JSONArray or + JSONObject, and to covert a JSONArray or JSONObject into an XML text using + the JsonML transform.
+
+
JSONML() - Constructor for class org.json.JSONML
+
 
+
JSONObject - Class in org.json
+
+
A JSONObject is an unordered collection of name/value pairs.
+
+
JSONObject() - Constructor for class org.json.JSONObject
+
+
Construct an empty JSONObject.
+
+
JSONObject(JSONObject, String...) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from a subset of another JSONObject.
+
+
JSONObject(JSONTokener) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from a JSONTokener.
+
+
JSONObject(Map<?, ?>) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from a Map.
+
+
JSONObject(Object) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from an Object using bean getters.
+
+
JSONObject(Object, String...) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from an Object, using reflection to find the + public members.
+
+
JSONObject(String) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from a source JSON text string.
+
+
JSONObject(String, Locale) - Constructor for class org.json.JSONObject
+
+
Construct a JSONObject from a ResourceBundle.
+
+
JSONObject(int) - Constructor for class org.json.JSONObject
+
+
Constructor to specify an initial capacity of the internal map.
+
+
JSONPointer - Class in org.json
+
+
A JSON Pointer is a simple query language defined for JSON documents by + RFC 6901.
+
+
JSONPointer(String) - Constructor for class org.json.JSONPointer
+
+
Pre-parses and initializes a new JSONPointer instance.
+
+
JSONPointer(List<String>) - Constructor for class org.json.JSONPointer
+
 
+
JSONPointer.Builder - Class in org.json
+
+
This class allows the user to build a JSONPointer in steps, using + exactly one segment in each step.
+
+
JSONPointerException - Exception in org.json
+
+
The JSONPointerException is thrown by JSONPointer if an error occurs + during evaluating a pointer.
+
+
JSONPointerException(String) - Constructor for exception org.json.JSONPointerException
+
 
+
JSONPointerException(String, Throwable) - Constructor for exception org.json.JSONPointerException
+
 
+
JSONPropertyIgnore - Annotation Type in org.json
+
 
+
JSONPropertyName - Annotation Type in org.json
+
 
+
JSONString - Interface in org.json
+
+
The JSONString interface allows a toJSONString() + method so that a class can change the behavior of + JSONObject.toString(), JSONArray.toString(), + and JSONWriter.value(Object).
+
+
JSONStringer - Class in org.json
+
+
JSONStringer provides a quick and convenient way of producing JSON text.
+
+
JSONStringer() - Constructor for class org.json.JSONStringer
+
+
Make a fresh JSONStringer.
+
+
JSONTokener - Class in org.json
+
+
A JSONTokener takes a source string and extracts characters and tokens from + it.
+
+
JSONTokener(Reader) - Constructor for class org.json.JSONTokener
+
+
Construct a JSONTokener from a Reader.
+
+
JSONTokener(InputStream) - Constructor for class org.json.JSONTokener
+
+
Construct a JSONTokener from an InputStream.
+
+
JSONTokener(String) - Constructor for class org.json.JSONTokener
+
+
Construct a JSONTokener from a string.
+
+
JSONWriter - Class in org.json
+
+
JSONWriter provides a quick and convenient way of producing JSON text.
+
+
JSONWriter(Appendable) - Constructor for class org.json.JSONWriter
+
+
Make a fresh JSONWriter.
+
+
+ + + +

K

+
+
KEEP_STRINGS - Static variable in class org.json.XMLParserConfiguration
+
+
Original configuration of the XML Parser except that values are kept as strings.
+
+
key(String) - Method in class org.json.JSONWriter
+
+
Append a key.
+
+
keys() - Method in class org.json.JSONObject
+
+
Get an enumeration of the keys of the JSONObject.
+
+
keySet() - Method in class org.json.JSONObject
+
+
Get a set of keys of the JSONObject.
+
+
+ + + +

L

+
+
length() - Method in class org.json.JSONArray
+
+
Get the number of elements in the JSONArray, included nulls.
+
+
length() - Method in class org.json.JSONObject
+
+
Get the number of keys stored in the JSONObject.
+
+
LT - Static variable in class org.json.XML
+
+
The Character '<'.
+
+
+ + + +

M

+
+
mode - Variable in class org.json.JSONWriter
+
+
The current mode.
+
+
more() - Method in class org.json.JSONTokener
+
+
Determine if the source string still contains characters that next() + can consume.
+
+
+ + + +

N

+
+
names() - Method in class org.json.JSONObject
+
+
Produce a JSONArray containing the names of the elements of this + JSONObject.
+
+
next() - Method in class org.json.JSONTokener
+
+
Get the next character in the source string.
+
+
next(char) - Method in class org.json.JSONTokener
+
+
Consume the next character, and check that it matches a specified + character.
+
+
next(int) - Method in class org.json.JSONTokener
+
+
Get the next n characters.
+
+
nextCDATA() - Method in class org.json.XMLTokener
+
+
Get the text in the CDATA block.
+
+
nextClean() - Method in class org.json.JSONTokener
+
+
Get the next char in the string, skipping whitespace.
+
+
nextContent() - Method in class org.json.XMLTokener
+
+
Get the next XML outer token, trimming whitespace.
+
+
nextEntity(char) - Method in class org.json.XMLTokener
+
+
{@code + Return the next entity.
+
+
nextMeta() - Method in class org.json.XMLTokener
+
+
{@code + Returns the next XML meta token.
+
+
nextString(char) - Method in class org.json.JSONTokener
+
+
Return the characters up to the next close quote character.
+
+
nextTo(char) - Method in class org.json.JSONTokener
+
+
Get the text up but not including the specified character or the + end of line, whichever comes first.
+
+
nextTo(String) - Method in class org.json.JSONTokener
+
+
Get the text up but not including one of the specified delimiter + characters or the end of line, whichever comes first.
+
+
nextToken() - Method in class org.json.HTTPTokener
+
+
Get the next token or string.
+
+
nextToken() - Method in class org.json.XMLTokener
+
+
{@code + Get the next XML Token.
+
+
nextValue() - Method in class org.json.JSONTokener
+
+
Get the next value.
+
+
noSpace(String) - Static method in class org.json.XML
+
+
Throw an exception if the string contains whitespace.
+
+
NULL - Static variable in class org.json.JSONObject
+
+
It is sometimes more convenient and less ambiguous to have a + NULL object than to use Java's null value.
+
+
NULL_ATTR - Static variable in class org.json.XML
+
+
Null attribute name
+
+
numberToString(Number) - Static method in class org.json.JSONObject
+
+
Produce a string from a Number.
+
+
+ + + +

O

+
+
object() - Method in class org.json.JSONWriter
+
+
Begin appending a new object.
+
+
opt(int) - Method in class org.json.JSONArray
+
+
Get the optional object value associated with an index.
+
+
opt(String) - Method in class org.json.JSONObject
+
+
Get an optional value associated with a key.
+
+
optBigDecimal(int, BigDecimal) - Method in class org.json.JSONArray
+
+
Get the optional BigDecimal value associated with an index.
+
+
optBigDecimal(String, BigDecimal) - Method in class org.json.JSONObject
+
+
Get an optional BigDecimal associated with a key, or the defaultValue if + there is no such key or if its value is not a number.
+
+
optBigInteger(int, BigInteger) - Method in class org.json.JSONArray
+
+
Get the optional BigInteger value associated with an index.
+
+
optBigInteger(String, BigInteger) - Method in class org.json.JSONObject
+
+
Get an optional BigInteger associated with a key, or the defaultValue if + there is no such key or if its value is not a number.
+
+
optBoolean(int) - Method in class org.json.JSONArray
+
+
Get the optional boolean value associated with an index.
+
+
optBoolean(int, boolean) - Method in class org.json.JSONArray
+
+
Get the optional boolean value associated with an index.
+
+
optBoolean(String) - Method in class org.json.JSONObject
+
+
Get an optional boolean associated with a key.
+
+
optBoolean(String, boolean) - Method in class org.json.JSONObject
+
+
Get an optional boolean associated with a key.
+
+
optDouble(int) - Method in class org.json.JSONArray
+
+
Get the optional double value associated with an index.
+
+
optDouble(int, double) - Method in class org.json.JSONArray
+
+
Get the optional double value associated with an index.
+
+
optDouble(String) - Method in class org.json.JSONObject
+
+
Get an optional double associated with a key, or NaN if there is no such + key or if its value is not a number.
+
+
optDouble(String, double) - Method in class org.json.JSONObject
+
+
Get an optional double associated with a key, or the defaultValue if + there is no such key or if its value is not a number.
+
+
optEnum(Class<E>, int) - Method in class org.json.JSONArray
+
+
Get the enum value associated with a key.
+
+
optEnum(Class<E>, int, E) - Method in class org.json.JSONArray
+
+
Get the enum value associated with a key.
+
+
optEnum(Class<E>, String) - Method in class org.json.JSONObject
+
+
Get the enum value associated with a key.
+
+
optEnum(Class<E>, String, E) - Method in class org.json.JSONObject
+
+
Get the enum value associated with a key.
+
+
optFloat(int) - Method in class org.json.JSONArray
+
+
Get the optional float value associated with an index.
+
+
optFloat(int, float) - Method in class org.json.JSONArray
+
+
Get the optional float value associated with an index.
+
+
optFloat(String) - Method in class org.json.JSONObject
+
+
Get the optional double value associated with an index.
+
+
optFloat(String, float) - Method in class org.json.JSONObject
+
+
Get the optional double value associated with an index.
+
+
optInt(int) - Method in class org.json.JSONArray
+
+
Get the optional int value associated with an index.
+
+
optInt(int, int) - Method in class org.json.JSONArray
+
+
Get the optional int value associated with an index.
+
+
optInt(String) - Method in class org.json.JSONObject
+
+
Get an optional int value associated with a key, or zero if there is no + such key or if the value is not a number.
+
+
optInt(String, int) - Method in class org.json.JSONObject
+
+
Get an optional int value associated with a key, or the default if there + is no such key or if the value is not a number.
+
+
optJSONArray(int) - Method in class org.json.JSONArray
+
+
Get the optional JSONArray associated with an index.
+
+
optJSONArray(String) - Method in class org.json.JSONObject
+
+
Get an optional JSONArray associated with a key.
+
+
optJSONObject(int) - Method in class org.json.JSONArray
+
+
Get the optional JSONObject associated with an index.
+
+
optJSONObject(String) - Method in class org.json.JSONObject
+
+
Get an optional JSONObject associated with a key.
+
+
optLong(int) - Method in class org.json.JSONArray
+
+
Get the optional long value associated with an index.
+
+
optLong(int, long) - Method in class org.json.JSONArray
+
+
Get the optional long value associated with an index.
+
+
optLong(String) - Method in class org.json.JSONObject
+
+
Get an optional long value associated with a key, or zero if there is no + such key or if the value is not a number.
+
+
optLong(String, long) - Method in class org.json.JSONObject
+
+
Get an optional long value associated with a key, or the default if there + is no such key or if the value is not a number.
+
+
optNumber(int) - Method in class org.json.JSONArray
+
+
Get an optional Number value associated with a key, or null + if there is no such key or if the value is not a number.
+
+
optNumber(int, Number) - Method in class org.json.JSONArray
+
+
Get an optional Number value associated with a key, or the default if there + is no such key or if the value is not a number.
+
+
optNumber(String) - Method in class org.json.JSONObject
+
+
Get an optional Number value associated with a key, or null + if there is no such key or if the value is not a number.
+
+
optNumber(String, Number) - Method in class org.json.JSONObject
+
+
Get an optional Number value associated with a key, or the default if there + is no such key or if the value is not a number.
+
+
optQuery(String) - Method in class org.json.JSONArray
+
+
Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
+
+
optQuery(JSONPointer) - Method in class org.json.JSONArray
+
+
Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
+
+
optQuery(String) - Method in class org.json.JSONObject
+
+
Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
+
+
optQuery(JSONPointer) - Method in class org.json.JSONObject
+
+
Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
+
+
optString(int) - Method in class org.json.JSONArray
+
+
Get the optional string value associated with an index.
+
+
optString(int, String) - Method in class org.json.JSONArray
+
+
Get the optional string associated with an index.
+
+
optString(String) - Method in class org.json.JSONObject
+
+
Get an optional string associated with a key.
+
+
optString(String, String) - Method in class org.json.JSONObject
+
+
Get an optional string associated with a key.
+
+
org.json - package org.json
+
 
+
ORIGINAL - Static variable in class org.json.XMLParserConfiguration
+
+
Original Configuration of the XML Parser.
+
+
+ + + +

P

+
+
Property - Class in org.json
+
+
Converts a Property file data into JSONObject and back.
+
+
Property() - Constructor for class org.json.Property
+
 
+
put(boolean) - Method in class org.json.JSONArray
+
+
Append a boolean value.
+
+
put(Collection<?>) - Method in class org.json.JSONArray
+
+
Put a value in the JSONArray, where the value will be a JSONArray which + is produced from a Collection.
+
+
put(double) - Method in class org.json.JSONArray
+
+
Append a double value.
+
+
put(float) - Method in class org.json.JSONArray
+
+
Append a float value.
+
+
put(int) - Method in class org.json.JSONArray
+
+
Append an int value.
+
+
put(long) - Method in class org.json.JSONArray
+
+
Append an long value.
+
+
put(Map<?, ?>) - Method in class org.json.JSONArray
+
+
Put a value in the JSONArray, where the value will be a JSONObject which + is produced from a Map.
+
+
put(Object) - Method in class org.json.JSONArray
+
+
Append an object value.
+
+
put(int, boolean) - Method in class org.json.JSONArray
+
+
Put or replace a boolean value in the JSONArray.
+
+
put(int, Collection<?>) - Method in class org.json.JSONArray
+
+
Put a value in the JSONArray, where the value will be a JSONArray which + is produced from a Collection.
+
+
put(int, double) - Method in class org.json.JSONArray
+
+
Put or replace a double value.
+
+
put(int, float) - Method in class org.json.JSONArray
+
+
Put or replace a float value.
+
+
put(int, int) - Method in class org.json.JSONArray
+
+
Put or replace an int value.
+
+
put(int, long) - Method in class org.json.JSONArray
+
+
Put or replace a long value.
+
+
put(int, Map<?, ?>) - Method in class org.json.JSONArray
+
+
Put a value in the JSONArray, where the value will be a JSONObject that + is produced from a Map.
+
+
put(int, Object) - Method in class org.json.JSONArray
+
+
Put or replace an object value in the JSONArray.
+
+
put(String, boolean) - Method in class org.json.JSONObject
+
+
Put a key/boolean pair in the JSONObject.
+
+
put(String, Collection<?>) - Method in class org.json.JSONObject
+
+
Put a key/value pair in the JSONObject, where the value will be a + JSONArray which is produced from a Collection.
+
+
put(String, double) - Method in class org.json.JSONObject
+
+
Put a key/double pair in the JSONObject.
+
+
put(String, float) - Method in class org.json.JSONObject
+
+
Put a key/float pair in the JSONObject.
+
+
put(String, int) - Method in class org.json.JSONObject
+
+
Put a key/int pair in the JSONObject.
+
+
put(String, long) - Method in class org.json.JSONObject
+
+
Put a key/long pair in the JSONObject.
+
+
put(String, Map<?, ?>) - Method in class org.json.JSONObject
+
+
Put a key/value pair in the JSONObject, where the value will be a + JSONObject which is produced from a Map.
+
+
put(String, Object) - Method in class org.json.JSONObject
+
+
Put a key/value pair in the JSONObject.
+
+
putAll(Collection<?>) - Method in class org.json.JSONArray
+
+
Put a collection's elements in to the JSONArray.
+
+
putAll(Iterable<?>) - Method in class org.json.JSONArray
+
+
Put an Iterable's elements in to the JSONArray.
+
+
putAll(JSONArray) - Method in class org.json.JSONArray
+
+
Put a JSONArray's elements in to the JSONArray.
+
+
putAll(Object) - Method in class org.json.JSONArray
+
+
Put an array's elements in to the JSONArray.
+
+
putOnce(String, Object) - Method in class org.json.JSONObject
+
+
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.
+
+
putOpt(String, Object) - Method in class org.json.JSONObject
+
+
Put a key/value pair in the JSONObject, but only if the key and the value + are both non-null.
+
+
+ + + +

Q

+
+
query(String) - Method in class org.json.JSONArray
+
+
Creates a JSONPointer using an initialization string and tries to + match it to an item within this JSONArray.
+
+
query(JSONPointer) - Method in class org.json.JSONArray
+
+
Uses a user initialized JSONPointer and tries to + match it to an item within this JSONArray.
+
+
query(String) - Method in class org.json.JSONObject
+
+
Creates a JSONPointer using an initialization string and tries to + match it to an item within this JSONObject.
+
+
query(JSONPointer) - Method in class org.json.JSONObject
+
+
Uses a user initialized JSONPointer and tries to + match it to an item within this JSONObject.
+
+
queryFrom(Object) - Method in class org.json.JSONPointer
+
+
Evaluates this JSON Pointer on the given document.
+
+
QUEST - Static variable in class org.json.XML
+
+
The Character '?'.
+
+
QUOT - Static variable in class org.json.XML
+
+
The Character '"'.
+
+
quote(String) - Static method in class org.json.JSONObject
+
+
Produce a string in double quotes with backslash sequences in all the + right places.
+
+
quote(String, Writer) - Static method in class org.json.JSONObject
+
 
+
+ + + +

R

+
+
remove(int) - Method in class org.json.JSONArray
+
+
Remove an index and close the hole.
+
+
remove(String) - Method in class org.json.JSONObject
+
+
Remove a name and its value, if present.
+
+
rowToJSONArray(JSONTokener) - Static method in class org.json.CDL
+
+
Produce a JSONArray of strings from a row of comma delimited values.
+
+
rowToJSONObject(JSONArray, JSONTokener) - Static method in class org.json.CDL
+
+
Produce a JSONObject from a row of comma delimited text, using a + parallel JSONArray of strings to provides the names of the elements.
+
+
rowToString(JSONArray) - Static method in class org.json.CDL
+
+
Produce a comma delimited text row from a JSONArray.
+
+
+ + + +

S

+
+
similar(Object) - Method in class org.json.JSONArray
+
+
Determine if two JSONArrays are similar.
+
+
similar(Object) - Method in class org.json.JSONObject
+
+
Determine if two JSONObjects are similar.
+
+
skipPast(String) - Method in class org.json.XMLTokener
+
+
Skip characters until past the requested string.
+
+
skipTo(char) - Method in class org.json.JSONTokener
+
+
Skip characters until the next character is the requested character.
+
+
SLASH - Static variable in class org.json.XML
+
+
The Character '/'.
+
+
stringToNumber(String) - Static method in class org.json.JSONObject
+
+
Converts a string to a number using the narrowest possible type.
+
+
stringToValue(String) - Static method in class org.json.JSONObject
+
+
Try to convert a string into a number, boolean, or null.
+
+
stringToValue(String, XMLXsiTypeConverter<?>) - Static method in class org.json.XML
+
+
This method tries to convert the given string value to the target object
+
+
stringToValue(String) - Static method in class org.json.XML
+
+
This method is the same as JSONObject.stringToValue(String).
+
+
syntaxError(String) - Method in class org.json.JSONTokener
+
+
Make a JSONException to signal a syntax error.
+
+
syntaxError(String, Throwable) - Method in class org.json.JSONTokener
+
+
Make a JSONException to signal a syntax error.
+
+
+ + + +

T

+
+
testValidity(Object) - Static method in class org.json.JSONObject
+
+
Throw an exception if the object is a NaN or infinite number.
+
+
toJSONArray(String) - Static method in class org.json.CDL
+
+
Produce a JSONArray of JSONObjects from a comma delimited text string, + using the first row as a source of names.
+
+
toJSONArray(JSONTokener) - Static method in class org.json.CDL
+
+
Produce a JSONArray of JSONObjects from a comma delimited text string, + using the first row as a source of names.
+
+
toJSONArray(JSONArray, String) - Static method in class org.json.CDL
+
+
Produce a JSONArray of JSONObjects from a comma delimited text string + using a supplied JSONArray as the source of element names.
+
+
toJSONArray(JSONArray, JSONTokener) - Static method in class org.json.CDL
+
+
Produce a JSONArray of JSONObjects from a comma delimited text string + using a supplied JSONArray as the source of element names.
+
+
toJSONArray(String) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform.
+
+
toJSONArray(String, boolean) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform.
+
+
toJSONArray(XMLTokener, boolean) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform.
+
+
toJSONArray(XMLTokener) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform.
+
+
toJSONArray(JSONArray) - Method in class org.json.JSONObject
+
+
Produce a JSONArray containing the values of the members of this + JSONObject.
+
+
toJSONObject(String) - Static method in class org.json.Cookie
+
+
Convert a cookie specification string into a JSONObject.
+
+
toJSONObject(String) - Static method in class org.json.CookieList
+
+
Convert a cookie list into a JSONObject.
+
+
toJSONObject(String) - Static method in class org.json.HTTP
+
+
Convert an HTTP header string into a JSONObject.
+
+
toJSONObject(JSONArray) - Method in class org.json.JSONArray
+
+
Produce a JSONObject by combining a JSONArray of names with the values of + this JSONArray.
+
+
toJSONObject(String) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform.
+
+
toJSONObject(String, boolean) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform.
+
+
toJSONObject(XMLTokener) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform.
+
+
toJSONObject(XMLTokener, boolean) - Static method in class org.json.JSONML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform.
+
+
toJSONObject(Properties) - Static method in class org.json.Property
+
+
Converts a property file object into a JSONObject.
+
+
toJSONObject(String) - Static method in class org.json.XML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject.
+
+
toJSONObject(Reader) - Static method in class org.json.XML
+
+
Convert a well-formed (but not necessarily valid) XML into a + JSONObject.
+
+
toJSONObject(Reader, boolean) - Static method in class org.json.XML
+
+
Convert a well-formed (but not necessarily valid) XML into a + JSONObject.
+
+
toJSONObject(Reader, XMLParserConfiguration) - Static method in class org.json.XML
+
+
Convert a well-formed (but not necessarily valid) XML into a + JSONObject.
+
+
toJSONObject(String, boolean) - Static method in class org.json.XML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject.
+
+
toJSONObject(String, XMLParserConfiguration) - Static method in class org.json.XML
+
+
Convert a well-formed (but not necessarily valid) XML string into a + JSONObject.
+
+
toJSONString() - Method in interface org.json.JSONString
+
+
The toJSONString method allows a class to produce its own JSON + serialization.
+
+
toList() - Method in class org.json.JSONArray
+
+
Returns a java.util.List containing all of the elements in this array.
+
+
toMap() - Method in class org.json.JSONObject
+
+
Returns a java.util.Map containing all of the entries in this object.
+
+
toProperties(JSONObject) - Static method in class org.json.Property
+
+
Converts the JSONObject into a property file object.
+
+
toString(JSONArray) - Static method in class org.json.CDL
+
+
Produce a comma delimited text from a JSONArray of JSONObjects.
+
+
toString(JSONArray, JSONArray) - Static method in class org.json.CDL
+
+
Produce a comma delimited text from a JSONArray of JSONObjects using + a provided list of names.
+
+
toString(JSONObject) - Static method in class org.json.Cookie
+
+
Convert a JSONObject into a cookie specification string.
+
+
toString(JSONObject) - Static method in class org.json.CookieList
+
+
Convert a JSONObject into a cookie list.
+
+
toString(JSONObject) - Static method in class org.json.HTTP
+
+
Convert a JSONObject into an HTTP header.
+
+
toString() - Method in class org.json.JSONArray
+
+
Make a JSON text of this JSONArray.
+
+
toString(int) - Method in class org.json.JSONArray
+
+
Make a pretty-printed JSON text of this JSONArray.
+
+
toString(JSONArray) - Static method in class org.json.JSONML
+
+
Reverse the JSONML transformation, making an XML text from a JSONArray.
+
+
toString(JSONObject) - Static method in class org.json.JSONML
+
+
Reverse the JSONML transformation, making an XML text from a JSONObject.
+
+
toString() - Method in class org.json.JSONObject
+
+
Make a JSON text of this JSONObject.
+
+
toString(int) - Method in class org.json.JSONObject
+
+
Make a pretty-printed JSON text of this JSONObject.
+
+
toString() - Method in class org.json.JSONPointer
+
+
Returns a string representing the JSONPointer path value using string + representation
+
+
toString() - Method in class org.json.JSONStringer
+
+
Return the JSON text.
+
+
toString() - Method in class org.json.JSONTokener
+
+
Make a printable string of this JSONTokener.
+
+
toString(Object) - Static method in class org.json.XML
+
+
Convert a JSONObject into a well-formed, element-normal XML string.
+
+
toString(Object, String) - Static method in class org.json.XML
+
+
Convert a JSONObject into a well-formed, element-normal XML string.
+
+
toString(Object, String, XMLParserConfiguration) - Static method in class org.json.XML
+
+
Convert a JSONObject into a well-formed, element-normal XML string.
+
+
toURIFragment() - Method in class org.json.JSONPointer
+
+
Returns a string representing the JSONPointer path value using URI + fragment identifier representation
+
+
TYPE_ATTR - Static variable in class org.json.XML
+
 
+
+ + + +

U

+
+
unescape(String) - Static method in class org.json.Cookie
+
+
Convert %hh sequences to single characters, and + convert plus to space.
+
+
unescape(String) - Static method in class org.json.XML
+
+
Removes XML escapes from the string.
+
+
+ + + +

V

+
+
value(boolean) - Method in class org.json.JSONWriter
+
+
Append either the value true or the value + false.
+
+
value(double) - Method in class org.json.JSONWriter
+
+
Append a double value.
+
+
value(long) - Method in class org.json.JSONWriter
+
+
Append a long value.
+
+
value(Object) - Method in class org.json.JSONWriter
+
+
Append an object value.
+
+
valueToString(Object) - Static method in class org.json.JSONObject
+
+
Make a JSON text of an Object value.
+
+
valueToString(Object) - Static method in class org.json.JSONWriter
+
+
Make a JSON text of an Object value.
+
+
+ + + +

W

+
+
withcDataTagName(String) - Method in class org.json.XMLParserConfiguration
+
+
The name of the key in a JSON Object that indicates a CDATA section.
+
+
withConvertNilAttributeToNull(boolean) - Method in class org.json.XMLParserConfiguration
+
+
When parsing the XML into JSON, specifies if values with attribute xsi:nil="true" + should be kept as attribute(false), or they should be converted to + null(true)
+
+
withKeepStrings(boolean) - Method in class org.json.XMLParserConfiguration
+
+
When parsing the XML into JSON, specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string)
+
+
withXsiTypeMap(Map<String, XMLXsiTypeConverter<?>>) - Method in class org.json.XMLParserConfiguration
+
+
When parsing the XML into JSON, specifies that the values with attribute xsi:type + will be converted to target type defined to client in this configuration + Map<String, XMLXsiTypeConverter<?>> to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
+
+
wrap(Object) - Static method in class org.json.JSONObject
+
+
Wrap an object, if necessary.
+
+
write(Writer) - Method in class org.json.JSONArray
+
+
Write the contents of the JSONArray as JSON text to a writer.
+
+
write(Writer, int, int) - Method in class org.json.JSONArray
+
+
Write the contents of the JSONArray as JSON text to a writer.
+
+
write(Writer) - Method in class org.json.JSONObject
+
+
Write the contents of the JSONObject as JSON text to a writer.
+
+
write(Writer, int, int) - Method in class org.json.JSONObject
+
+
Write the contents of the JSONObject as JSON text to a writer.
+
+
writer - Variable in class org.json.JSONWriter
+
+
The writer that will receive the output.
+
+
+ + + +

X

+
+
XML - Class in org.json
+
+
This provides static methods to convert an XML text into a JSONObject, and to + covert a JSONObject into an XML text.
+
+
XML() - Constructor for class org.json.XML
+
 
+
XMLParserConfiguration - Class in org.json
+
+
Configuration object for the XML parser.
+
+
XMLParserConfiguration() - Constructor for class org.json.XMLParserConfiguration
+
+
Default parser configuration.
+
+
XMLParserConfiguration(boolean) - Constructor for class org.json.XMLParserConfiguration
+
+
Deprecated. +
This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
+
+
+
XMLParserConfiguration(String) - Constructor for class org.json.XMLParserConfiguration
+
+
Deprecated. +
This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
+
+
+
XMLParserConfiguration(boolean, String) - Constructor for class org.json.XMLParserConfiguration
+
+
Deprecated. +
This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
+
+
+
XMLParserConfiguration(boolean, String, boolean) - Constructor for class org.json.XMLParserConfiguration
+
+
Deprecated. +
This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed or marked private in a future release.
+
+
+
XMLTokener - Class in org.json
+
+
The XMLTokener extends the JSONTokener to provide additional methods + for the parsing of XML texts.
+
+
XMLTokener(Reader) - Constructor for class org.json.XMLTokener
+
+
Construct an XMLTokener from a Reader.
+
+
XMLTokener(String) - Constructor for class org.json.XMLTokener
+
+
Construct an XMLTokener from a string.
+
+
XMLXsiTypeConverter<T> - Interface in org.json
+
+
Type conversion configuration interface to be used with xsi:type attributes.
+
+
+A B C D E G H I J K L M N O P Q R S T U V W X 
+ +
+ + + + + + + +
+ + + + diff --git a/index.html b/docs/index.html similarity index 92% rename from index.html rename to docs/index.html index a915663..1f4eb87 100644 --- a/index.html +++ b/docs/index.html @@ -1,72 +1,71 @@ - - - - - - -JSON in Java 20160212 API - - - - - - -<noscript> -<div>JavaScript is disabled on your browser.</div> -</noscript> -<h2>Frame Alert</h2> -<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/json/package-summary.html">Non-frame version</a>.</p> - - - + + + + + +Generated Documentation (Untitled) + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/json/package-summary.html">Non-frame version</a>.</p> + + + diff --git a/org/json/CDL.html b/docs/org/json/CDL.html similarity index 77% rename from org/json/CDL.html rename to docs/org/json/CDL.html index 100a8a0..bbee6cb 100644 --- a/org/json/CDL.html +++ b/docs/org/json/CDL.html @@ -1,532 +1,522 @@ - - - - - - -CDL (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class CDL

-
-
- -
-
    -
  • -
    -
    -
    public class CDL
    -extends java.lang.Object
    -
    This provides static methods to convert comma delimited text into a - JSONArray, and to convert a JSONArray into comma delimited text. Comma - delimited text is a very popular format for data interchange. It is - understood by most database, spreadsheet, and organizer programs. -

    - Each row of text represents a row in a table or a data record. Each row - ends with a NEWLINE character. Each row contains one or more values. - Values are separated by commas. A value can contain any character except - for comma, unless is is wrapped in single quotes or double quotes. -

    - The first row usually contains the names of the columns. -

    - A comma delimited list can be converted into a JSONArray of JSONObjects. - The names for the elements in the JSONObjects can be taken from the names - in the first row.

    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      CDL() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static JSONArrayrowToJSONArray(JSONTokener x) -
      Produce a JSONArray of strings from a row of comma delimited values.
      -
      static JSONObjectrowToJSONObject(JSONArray names, - JSONTokener x) -
      Produce a JSONObject from a row of comma delimited text, using a - parallel JSONArray of strings to provides the names of the elements.
      -
      static java.lang.StringrowToString(JSONArray ja) -
      Produce a comma delimited text row from a JSONArray.
      -
      static JSONArraytoJSONArray(JSONArray names, - JSONTokener x) -
      Produce a JSONArray of JSONObjects from a comma delimited text string - using a supplied JSONArray as the source of element names.
      -
      static JSONArraytoJSONArray(JSONArray names, - java.lang.String string) -
      Produce a JSONArray of JSONObjects from a comma delimited text string - using a supplied JSONArray as the source of element names.
      -
      static JSONArraytoJSONArray(JSONTokener x) -
      Produce a JSONArray of JSONObjects from a comma delimited text string, - using the first row as a source of names.
      -
      static JSONArraytoJSONArray(java.lang.String string) -
      Produce a JSONArray of JSONObjects from a comma delimited text string, - using the first row as a source of names.
      -
      static java.lang.StringtoString(JSONArray ja) -
      Produce a comma delimited text from a JSONArray of JSONObjects.
      -
      static java.lang.StringtoString(JSONArray names, - JSONArray ja) -
      Produce a comma delimited text from a JSONArray of JSONObjects using - a provided list of names.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        CDL

        -
        public CDL()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        rowToJSONArray

        -
        public static JSONArray rowToJSONArray(JSONTokener x)
        -                                throws JSONException
        -
        Produce a JSONArray of strings from a row of comma delimited values.
        -
        -
        Parameters:
        -
        x - A JSONTokener of the source text.
        -
        Returns:
        -
        A JSONArray of strings.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        rowToJSONObject

        -
        public static JSONObject rowToJSONObject(JSONArray names,
        -                                         JSONTokener x)
        -                                  throws JSONException
        -
        Produce a JSONObject from a row of comma delimited text, using a - parallel JSONArray of strings to provides the names of the elements.
        -
        -
        Parameters:
        -
        names - A JSONArray of names. This is commonly obtained from the - first row of a comma delimited text file using the rowToJSONArray - method.
        -
        x - A JSONTokener of the source text.
        -
        Returns:
        -
        A JSONObject combining the names and values.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        rowToString

        -
        public static java.lang.String rowToString(JSONArray ja)
        -
        Produce a comma delimited text row from a JSONArray. Values containing - the comma character will be quoted. Troublesome characters may be - removed.
        -
        -
        Parameters:
        -
        ja - A JSONArray of strings.
        -
        Returns:
        -
        A string ending in NEWLINE.
        -
        -
      • -
      - - - -
        -
      • -

        toJSONArray

        -
        public static JSONArray toJSONArray(java.lang.String string)
        -                             throws JSONException
        -
        Produce a JSONArray of JSONObjects from a comma delimited text string, - using the first row as a source of names.
        -
        -
        Parameters:
        -
        string - The comma delimited text.
        -
        Returns:
        -
        A JSONArray of JSONObjects.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toJSONArray

        -
        public static JSONArray toJSONArray(JSONTokener x)
        -                             throws JSONException
        -
        Produce a JSONArray of JSONObjects from a comma delimited text string, - using the first row as a source of names.
        -
        -
        Parameters:
        -
        x - The JSONTokener containing the comma delimited text.
        -
        Returns:
        -
        A JSONArray of JSONObjects.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toJSONArray

        -
        public static JSONArray toJSONArray(JSONArray names,
        -                                    java.lang.String string)
        -                             throws JSONException
        -
        Produce a JSONArray of JSONObjects from a comma delimited text string - using a supplied JSONArray as the source of element names.
        -
        -
        Parameters:
        -
        names - A JSONArray of strings.
        -
        string - The comma delimited text.
        -
        Returns:
        -
        A JSONArray of JSONObjects.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toJSONArray

        -
        public static JSONArray toJSONArray(JSONArray names,
        -                                    JSONTokener x)
        -                             throws JSONException
        -
        Produce a JSONArray of JSONObjects from a comma delimited text string - using a supplied JSONArray as the source of element names.
        -
        -
        Parameters:
        -
        names - A JSONArray of strings.
        -
        x - A JSONTokener of the source text.
        -
        Returns:
        -
        A JSONArray of JSONObjects.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONArray ja)
        -                                 throws JSONException
        -
        Produce a comma delimited text from a JSONArray of JSONObjects. The - first row will be a list of names obtained by inspecting the first - JSONObject.
        -
        -
        Parameters:
        -
        ja - A JSONArray of JSONObjects.
        -
        Returns:
        -
        A comma delimited text.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONArray names,
        -                                        JSONArray ja)
        -                                 throws JSONException
        -
        Produce a comma delimited text from a JSONArray of JSONObjects using - a provided list of names. The list of names is not included in the - output.
        -
        -
        Parameters:
        -
        names - A JSONArray of strings.
        -
        ja - A JSONArray of JSONObjects.
        -
        Returns:
        -
        A comma delimited text.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +CDL + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class CDL

+
+
+ +
+
    +
  • +
    +
    +
    public class CDL
    +extends Object
    +
    This provides static methods to convert comma delimited text into a + JSONArray, and to convert a JSONArray into comma delimited text. Comma + delimited text is a very popular format for data interchange. It is + understood by most database, spreadsheet, and organizer programs. +

    + Each row of text represents a row in a table or a data record. Each row + ends with a NEWLINE character. Each row contains one or more values. + Values are separated by commas. A value can contain any character except + for comma, unless is is wrapped in single quotes or double quotes. +

    + The first row usually contains the names of the columns. +

    + A comma delimited list can be converted into a JSONArray of JSONObjects. + The names for the elements in the JSONObjects can be taken from the names + in the first row.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CDL

        +
        public CDL()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        rowToJSONArray

        +
        public static JSONArray rowToJSONArray(JSONTokener x)
        +                                throws JSONException
        +
        Produce a JSONArray of strings from a row of comma delimited values.
        +
        +
        Parameters:
        +
        x - A JSONTokener of the source text.
        +
        Returns:
        +
        A JSONArray of strings.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        rowToJSONObject

        +
        public static JSONObject rowToJSONObject(JSONArray names,
        +                                         JSONTokener x)
        +                                  throws JSONException
        +
        Produce a JSONObject from a row of comma delimited text, using a + parallel JSONArray of strings to provides the names of the elements.
        +
        +
        Parameters:
        +
        names - A JSONArray of names. This is commonly obtained from the + first row of a comma delimited text file using the rowToJSONArray + method.
        +
        x - A JSONTokener of the source text.
        +
        Returns:
        +
        A JSONObject combining the names and values.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        rowToString

        +
        public static String rowToString(JSONArray ja)
        +
        Produce a comma delimited text row from a JSONArray. Values containing + the comma character will be quoted. Troublesome characters may be + removed.
        +
        +
        Parameters:
        +
        ja - A JSONArray of strings.
        +
        Returns:
        +
        A string ending in NEWLINE.
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(String string)
        +                             throws JSONException
        +
        Produce a JSONArray of JSONObjects from a comma delimited text string, + using the first row as a source of names.
        +
        +
        Parameters:
        +
        string - The comma delimited text.
        +
        Returns:
        +
        A JSONArray of JSONObjects.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(JSONTokener x)
        +                             throws JSONException
        +
        Produce a JSONArray of JSONObjects from a comma delimited text string, + using the first row as a source of names.
        +
        +
        Parameters:
        +
        x - The JSONTokener containing the comma delimited text.
        +
        Returns:
        +
        A JSONArray of JSONObjects.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(JSONArray names,
        +                                    String string)
        +                             throws JSONException
        +
        Produce a JSONArray of JSONObjects from a comma delimited text string + using a supplied JSONArray as the source of element names.
        +
        +
        Parameters:
        +
        names - A JSONArray of strings.
        +
        string - The comma delimited text.
        +
        Returns:
        +
        A JSONArray of JSONObjects.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(JSONArray names,
        +                                    JSONTokener x)
        +                             throws JSONException
        +
        Produce a JSONArray of JSONObjects from a comma delimited text string + using a supplied JSONArray as the source of element names.
        +
        +
        Parameters:
        +
        names - A JSONArray of strings.
        +
        x - A JSONTokener of the source text.
        +
        Returns:
        +
        A JSONArray of JSONObjects.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONArray ja)
        +                       throws JSONException
        +
        Produce a comma delimited text from a JSONArray of JSONObjects. The + first row will be a list of names obtained by inspecting the first + JSONObject.
        +
        +
        Parameters:
        +
        ja - A JSONArray of JSONObjects.
        +
        Returns:
        +
        A comma delimited text.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONArray names,
        +                              JSONArray ja)
        +                       throws JSONException
        +
        Produce a comma delimited text from a JSONArray of JSONObjects using + a provided list of names. The list of names is not included in the + output.
        +
        +
        Parameters:
        +
        names - A JSONArray of strings.
        +
        ja - A JSONArray of JSONObjects.
        +
        Returns:
        +
        A comma delimited text.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/Cookie.html b/docs/org/json/Cookie.html similarity index 64% rename from org/json/Cookie.html rename to docs/org/json/Cookie.html index 13ba60b..5e836c2 100644 --- a/org/json/Cookie.html +++ b/docs/org/json/Cookie.html @@ -1,385 +1,381 @@ - - - - - - -Cookie (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class Cookie

-
-
- -
-
    -
  • -
    -
    -
    public class Cookie
    -extends java.lang.Object
    -
    Convert a web browser cookie specification to a JSONObject and back. - JSON and Cookies are both notations for name/value pairs.
    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      Cookie() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static java.lang.Stringescape(java.lang.String string) -
      Produce a copy of a string in which the characters '+', '%', '=', ';' - and control characters are replaced with "%hh".
      -
      static JSONObjecttoJSONObject(java.lang.String string) -
      Convert a cookie specification string into a JSONObject.
      -
      static java.lang.StringtoString(JSONObject jo) -
      Convert a JSONObject into a cookie specification string.
      -
      static java.lang.Stringunescape(java.lang.String string) -
      Convert %hh sequences to single characters, and - convert plus to space.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Cookie

        -
        public Cookie()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        escape

        -
        public static java.lang.String escape(java.lang.String string)
        -
        Produce a copy of a string in which the characters '+', '%', '=', ';' - and control characters are replaced with "%hh". This is a gentle form - of URL encoding, attempting to cause as little distortion to the - string as possible. The characters '=' and ';' are meta characters in - cookies. By convention, they are escaped using the URL-encoding. This is - only a convention, not a standard. Often, cookies are expected to have - encoded values. We encode '=' and ';' because we must. We encode '%' and - '+' because they are meta characters in URL encoding.
        -
        -
        Parameters:
        -
        string - The source string.
        -
        Returns:
        -
        The escaped result.
        -
        -
      • -
      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(java.lang.String string)
        -                               throws JSONException
        -
        Convert a cookie specification string into a JSONObject. The string - will contain a name value pair separated by '='. The name and the value - will be unescaped, possibly converting '+' and '%' sequences. The - cookie properties may follow, separated by ';', also represented as - name=value (except the secure property, which does not have a value). - The name will be stored under the key "name", and the value will be - stored under the key "value". This method does not do checking or - validation of the parameters. It only converts the cookie string into - a JSONObject.
        -
        -
        Parameters:
        -
        string - The cookie specification string.
        -
        Returns:
        -
        A JSONObject containing "name", "value", and possibly other - members.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONObject jo)
        -                                 throws JSONException
        -
        Convert a JSONObject into a cookie specification string. The JSONObject - must contain "name" and "value" members. - If the JSONObject contains "expires", "domain", "path", or "secure" - members, they will be appended to the cookie specification string. - All other members are ignored.
        -
        -
        Parameters:
        -
        jo - A JSONObject
        -
        Returns:
        -
        A cookie specification string
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        unescape

        -
        public static java.lang.String unescape(java.lang.String string)
        -
        Convert %hh sequences to single characters, and - convert plus to space.
        -
        -
        Parameters:
        -
        string - A string that may contain - + (plus) and - %hh sequences.
        -
        Returns:
        -
        The unescaped string.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Cookie + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class Cookie

+
+
+ +
+
    +
  • +
    +
    +
    public class Cookie
    +extends Object
    +
    Convert a web browser cookie specification to a JSONObject and back. + JSON and Cookies are both notations for name/value pairs. + See also: https://tools.ietf.org/html/rfc6265
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Cookie

        +
        public Cookie()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        escape

        +
        public static String escape(String string)
        +
        Produce a copy of a string in which the characters '+', '%', '=', ';' + and control characters are replaced with "%hh". This is a gentle form + of URL encoding, attempting to cause as little distortion to the + string as possible. The characters '=' and ';' are meta characters in + cookies. By convention, they are escaped using the URL-encoding. This is + only a convention, not a standard. Often, cookies are expected to have + encoded values. We encode '=' and ';' because we must. We encode '%' and + '+' because they are meta characters in URL encoding.
        +
        +
        Parameters:
        +
        string - The source string.
        +
        Returns:
        +
        The escaped result.
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string)
        +
        Convert a cookie specification string into a JSONObject. The string + must contain a name value pair separated by '='. The name and the value + will be unescaped, possibly converting '+' and '%' sequences. The + cookie properties may follow, separated by ';', also represented as + name=value (except the Attribute properties like "Secure" or "HttpOnly", + which do not have a value. The value Boolean.TRUE will be used for these). + The name will be stored under the key "name", and the value will be + stored under the key "value". This method does not do checking or + validation of the parameters. It only converts the cookie string into + a JSONObject. All attribute names are converted to lower case keys in the + JSONObject (HttpOnly => httponly). If an attribute is specified more than + once, only the value found closer to the end of the cookie-string is kept.
        +
        +
        Parameters:
        +
        string - The cookie specification string.
        +
        Returns:
        +
        A JSONObject containing "name", "value", and possibly other + members.
        +
        Throws:
        +
        JSONException - If there is an error parsing the Cookie String. + Cookie strings must have at least one '=' character and the 'name' + portion of the cookie must not be blank.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONObject jo)
        +                       throws JSONException
        +
        Convert a JSONObject into a cookie specification string. The JSONObject + must contain "name" and "value" members (case insensitive). + If the JSONObject contains other members, they will be appended to the cookie + specification string. User-Agents are instructed to ignore unknown attributes, + so ensure your JSONObject is using only known attributes. + See also: https://tools.ietf.org/html/rfc6265
        +
        +
        Parameters:
        +
        jo - A JSONObject
        +
        Returns:
        +
        A cookie specification string
        +
        Throws:
        +
        JSONException - thrown if the cookie has no name.
        +
        +
      • +
      + + + +
        +
      • +

        unescape

        +
        public static String unescape(String string)
        +
        Convert %hh sequences to single characters, and + convert plus to space.
        +
        +
        Parameters:
        +
        string - A string that may contain + + (plus) and + %hh sequences.
        +
        Returns:
        +
        The unescaped string.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/CookieList.html b/docs/org/json/CookieList.html similarity index 72% rename from org/json/CookieList.html rename to docs/org/json/CookieList.html index d47e0f0..0af6802 100644 --- a/org/json/CookieList.html +++ b/docs/org/json/CookieList.html @@ -1,325 +1,315 @@ - - - - - - -CookieList (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class CookieList

-
-
- -
-
    -
  • -
    -
    -
    public class CookieList
    -extends java.lang.Object
    -
    Convert a web browser cookie list string to a JSONObject and back.
    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      CookieList() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static JSONObjecttoJSONObject(java.lang.String string) -
      Convert a cookie list into a JSONObject.
      -
      static java.lang.StringtoString(JSONObject jo) -
      Convert a JSONObject into a cookie list.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        CookieList

        -
        public CookieList()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(java.lang.String string)
        -                               throws JSONException
        -
        Convert a cookie list into a JSONObject. A cookie list is a sequence - of name/value pairs. The names are separated from the values by '='. - The pairs are separated by ';'. The names and the values - will be unescaped, possibly converting '+' and '%' sequences. - - To add a cookie to a cooklist, - cookielistJSONObject.put(cookieJSONObject.getString("name"), - cookieJSONObject.getString("value"));
        -
        -
        Parameters:
        -
        string - A cookie list string
        -
        Returns:
        -
        A JSONObject
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONObject jo)
        -                                 throws JSONException
        -
        Convert a JSONObject into a cookie list. A cookie list is a sequence - of name/value pairs. The names are separated from the values by '='. - The pairs are separated by ';'. The characters '%', '+', '=', and ';' - in the names and values are replaced by "%hh".
        -
        -
        Parameters:
        -
        jo - A JSONObject
        -
        Returns:
        -
        A cookie list string
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +CookieList + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class CookieList

+
+
+ +
+
    +
  • +
    +
    +
    public class CookieList
    +extends Object
    +
    Convert a web browser cookie list string to a JSONObject and back.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CookieList

        +
        public CookieList()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string)
        +                               throws JSONException
        +
        Convert a cookie list into a JSONObject. A cookie list is a sequence + of name/value pairs. The names are separated from the values by '='. + The pairs are separated by ';'. The names and the values + will be unescaped, possibly converting '+' and '%' sequences. + + To add a cookie to a cookie list, + cookielistJSONObject.put(cookieJSONObject.getString("name"), + cookieJSONObject.getString("value"));
        +
        +
        Parameters:
        +
        string - A cookie list string
        +
        Returns:
        +
        A JSONObject
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONObject jo)
        +                       throws JSONException
        +
        Convert a JSONObject into a cookie list. A cookie list is a sequence + of name/value pairs. The names are separated from the values by '='. + The pairs are separated by ';'. The characters '%', '+', '=', and ';' + in the names and values are replaced by "%hh".
        +
        +
        Parameters:
        +
        jo - A JSONObject
        +
        Returns:
        +
        A cookie list string
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/HTTP.html b/docs/org/json/HTTP.html similarity index 73% rename from org/json/HTTP.html rename to docs/org/json/HTTP.html index 1be7acc..75c5310 100644 --- a/org/json/HTTP.html +++ b/docs/org/json/HTTP.html @@ -1,398 +1,388 @@ - - - - - - -HTTP (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class HTTP

-
-
- -
-
    -
  • -
    -
    -
    public class HTTP
    -extends java.lang.Object
    -
    Convert an HTTP header to a JSONObject and back.
    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Summary

      - - - - - - - - - - -
      Fields 
      Modifier and TypeField and Description
      static java.lang.StringCRLF -
      Carriage return/line feed.
      -
      -
    • -
    - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      HTTP() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static JSONObjecttoJSONObject(java.lang.String string) -
      Convert an HTTP header string into a JSONObject.
      -
      static java.lang.StringtoString(JSONObject jo) -
      Convert a JSONObject into an HTTP header.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        CRLF

        -
        public static final java.lang.String CRLF
        -
        Carriage return/line feed.
        -
        -
        See Also:
        -
        Constant Field Values
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        HTTP

        -
        public HTTP()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(java.lang.String string)
        -                               throws JSONException
        -
        Convert an HTTP header string into a JSONObject. It can be a request - header or a response header. A request header will contain -
        {
        -    Method: "POST" (for example),
        -    "Request-URI": "/" (for example),
        -    "HTTP-Version": "HTTP/1.1" (for example)
        - }
        - A response header will contain -
        {
        -    "HTTP-Version": "HTTP/1.1" (for example),
        -    "Status-Code": "200" (for example),
        -    "Reason-Phrase": "OK" (for example)
        - }
        - In addition, the other parameters in the header will be captured, using - the HTTP field names as JSON names, so that
        -    Date: Sun, 26 May 2002 18:06:04 GMT
        -    Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
        -    Cache-Control: no-cache
        - become -
        {...
        -    Date: "Sun, 26 May 2002 18:06:04 GMT",
        -    Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
        -    "Cache-Control": "no-cache",
        - ...}
        - It does no further checking or conversion. It does not parse dates. - It does not do '%' transforms on URLs.
        -
        -
        Parameters:
        -
        string - An HTTP header string.
        -
        Returns:
        -
        A JSONObject containing the elements and attributes - of the XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONObject jo)
        -                                 throws JSONException
        -
        Convert a JSONObject into an HTTP header. A request header must contain -
        {
        -    Method: "POST" (for example),
        -    "Request-URI": "/" (for example),
        -    "HTTP-Version": "HTTP/1.1" (for example)
        - }
        - A response header must contain -
        {
        -    "HTTP-Version": "HTTP/1.1" (for example),
        -    "Status-Code": "200" (for example),
        -    "Reason-Phrase": "OK" (for example)
        - }
        - Any other members of the JSONObject will be output as HTTP fields. - The result will end with two CRLF pairs.
        -
        -
        Parameters:
        -
        jo - A JSONObject
        -
        Returns:
        -
        An HTTP header string.
        -
        Throws:
        -
        JSONException - if the object does not contain enough - information.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +HTTP + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class HTTP

+
+
+ +
+
    +
  • +
    +
    +
    public class HTTP
    +extends Object
    +
    Convert an HTTP header to a JSONObject and back.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HTTP

        +
        public HTTP()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string)
        +                               throws JSONException
        +
        Convert an HTTP header string into a JSONObject. It can be a request + header or a response header. A request header will contain +
        {
        +    Method: "POST" (for example),
        +    "Request-URI": "/" (for example),
        +    "HTTP-Version": "HTTP/1.1" (for example)
        + }
        + A response header will contain +
        {
        +    "HTTP-Version": "HTTP/1.1" (for example),
        +    "Status-Code": "200" (for example),
        +    "Reason-Phrase": "OK" (for example)
        + }
        + In addition, the other parameters in the header will be captured, using + the HTTP field names as JSON names, so that
        
        +    Date: Sun, 26 May 2002 18:06:04 GMT
        +    Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
        +    Cache-Control: no-cache
        + become +
        
        +    Date: "Sun, 26 May 2002 18:06:04 GMT",
        +    Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
        +    "Cache-Control": "no-cache",
        + ...
        + It does no further checking or conversion. It does not parse dates. + It does not do '%' transforms on URLs.
        +
        +
        Parameters:
        +
        string - An HTTP header string.
        +
        Returns:
        +
        A JSONObject containing the elements and attributes + of the XML string.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONObject jo)
        +                       throws JSONException
        +
        Convert a JSONObject into an HTTP header. A request header must contain +
        {
        +    Method: "POST" (for example),
        +    "Request-URI": "/" (for example),
        +    "HTTP-Version": "HTTP/1.1" (for example)
        + }
        + A response header must contain +
        {
        +    "HTTP-Version": "HTTP/1.1" (for example),
        +    "Status-Code": "200" (for example),
        +    "Reason-Phrase": "OK" (for example)
        + }
        + Any other members of the JSONObject will be output as HTTP fields. + The result will end with two CRLF pairs.
        +
        +
        Parameters:
        +
        jo - A JSONObject
        +
        Returns:
        +
        An HTTP header string.
        +
        Throws:
        +
        JSONException - if the object does not contain enough + information.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/HTTPTokener.html b/docs/org/json/HTTPTokener.html similarity index 74% rename from org/json/HTTPTokener.html rename to docs/org/json/HTTPTokener.html index 6f81da9..2c7224c 100644 --- a/org/json/HTTPTokener.html +++ b/docs/org/json/HTTPTokener.html @@ -1,308 +1,298 @@ - - - - - - -HTTPTokener (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class HTTPTokener

-
-
- -
-
    -
  • -
    -
    -
    public class HTTPTokener
    -extends JSONTokener
    -
    The HTTPTokener extends the JSONTokener to provide additional methods - for the parsing of HTTP headers.
    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        HTTPTokener

        -
        public HTTPTokener(java.lang.String string)
        -
        Construct an HTTPTokener from a string.
        -
        -
        Parameters:
        -
        string - A source string.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        nextToken

        -
        public java.lang.String nextToken()
        -                           throws JSONException
        -
        Get the next token or string. This is used in parsing HTTP headers.
        -
        -
        Returns:
        -
        A String.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +HTTPTokener + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class HTTPTokener

+
+
+ +
+
    +
  • +
    +
    +
    public class HTTPTokener
    +extends JSONTokener
    +
    The HTTPTokener extends the JSONTokener to provide additional methods + for the parsing of HTTP headers.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HTTPTokener

        +
        public HTTPTokener(String string)
        +
        Construct an HTTPTokener from a string.
        +
        +
        Parameters:
        +
        string - A source string.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        nextToken

        +
        public String nextToken()
        +                 throws JSONException
        +
        Get the next token or string. This is used in parsing HTTP headers.
        +
        +
        Returns:
        +
        A String.
        +
        Throws:
        +
        JSONException - if a syntax error occurs
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONArray.html b/docs/org/json/JSONArray.html similarity index 54% rename from org/json/JSONArray.html rename to docs/org/json/JSONArray.html index 8080eeb..d970e99 100644 --- a/org/json/JSONArray.html +++ b/docs/org/json/JSONArray.html @@ -1,1778 +1,2358 @@ - - - - - - -JSONArray (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONArray

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.lang.Iterable<java.lang.Object>
    -
    -
    -
    -
    public class JSONArray
    -extends java.lang.Object
    -implements java.lang.Iterable<java.lang.Object>
    -
    A JSONArray is an ordered sequence of values. Its external text form is a - string wrapped in square brackets with commas separating the values. The - internal form is an object having get and opt - methods for accessing the values by index, and put methods for - adding or replacing values. The values can be any of these types: - Boolean, JSONArray, JSONObject, - Number, String, or the - JSONObject.NULL object. -

    - The constructor can convert a JSON text into a Java object. The - toString method converts to JSON text. -

    - A get method returns a value if one can be found, and throws an - exception if one cannot be found. An opt method returns a - default value instead of throwing an exception, and so is useful for - obtaining optional values. -

    - The generic get() and opt() methods return an - object which you can cast or query for type. There are also typed - get and opt methods that do type checking and type - coercion for you. -

    - The texts produced by the toString methods strictly conform to - JSON syntax rules. The constructors are more forgiving in the texts they will - accept: -

      -
    • An extra , (comma) may appear just - before the closing bracket.
    • -
    • The null value will be inserted when there is , -  (comma) elision.
    • -
    • Strings may be quoted with ' (single - quote).
    • -
    • Strings do not need to be quoted at all if they do not begin with a quote - or single quote, and if they do not contain leading or trailing spaces, and - if they do not contain any of these characters: - { } [ ] / \ : , # and if they do not look like numbers and - if they are not the reserved words true, false, or - null.
    • -
    -
    -
    Version:
    -
    2016-02-08
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - - - - - - - - - - - - - -
      Constructors 
      Constructor and Description
      JSONArray() -
      Construct an empty JSONArray.
      -
      JSONArray(java.util.Collection<?> collection) -
      Construct a JSONArray from a Collection.
      -
      JSONArray(JSONTokener x) -
      Construct a JSONArray from a JSONTokener.
      -
      JSONArray(java.lang.Object array) -
      Construct a JSONArray from an array
      -
      JSONArray(java.lang.String source) -
      Construct a JSONArray from a source JSON text.
      -
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.Objectget(int index) -
      Get the object value associated with an index.
      -
      java.math.BigDecimalgetBigDecimal(int index) -
      Get the BigDecimal value associated with an index.
      -
      java.math.BigIntegergetBigInteger(int index) -
      Get the BigInteger value associated with an index.
      -
      booleangetBoolean(int index) -
      Get the boolean value associated with an index.
      -
      doublegetDouble(int index) -
      Get the double value associated with an index.
      -
      <E extends java.lang.Enum<E>>
      E
      getEnum(java.lang.Class<E> clazz, - int index) -
      Get the enum value associated with an index.
      -
      intgetInt(int index) -
      Get the int value associated with an index.
      -
      JSONArraygetJSONArray(int index) -
      Get the JSONArray associated with an index.
      -
      JSONObjectgetJSONObject(int index) -
      Get the JSONObject associated with an index.
      -
      longgetLong(int index) -
      Get the long value associated with an index.
      -
      java.lang.StringgetString(int index) -
      Get the string associated with an index.
      -
      booleanisNull(int index) -
      Determine if the value is null.
      -
      java.util.Iterator<java.lang.Object>iterator() 
      java.lang.Stringjoin(java.lang.String separator) -
      Make a string from the contents of this JSONArray.
      -
      intlength() -
      Get the number of elements in the JSONArray, included nulls.
      -
      java.lang.Objectopt(int index) -
      Get the optional object value associated with an index.
      -
      java.math.BigDecimaloptBigDecimal(int index, - java.math.BigDecimal defaultValue) -
      Get the optional BigDecimal value associated with an index.
      -
      java.math.BigIntegeroptBigInteger(int index, - java.math.BigInteger defaultValue) -
      Get the optional BigInteger value associated with an index.
      -
      booleanoptBoolean(int index) -
      Get the optional boolean value associated with an index.
      -
      booleanoptBoolean(int index, - boolean defaultValue) -
      Get the optional boolean value associated with an index.
      -
      doubleoptDouble(int index) -
      Get the optional double value associated with an index.
      -
      doubleoptDouble(int index, - double defaultValue) -
      Get the optional double value associated with an index.
      -
      <E extends java.lang.Enum<E>>
      E
      optEnum(java.lang.Class<E> clazz, - int index) -
      Get the enum value associated with a key.
      -
      <E extends java.lang.Enum<E>>
      E
      optEnum(java.lang.Class<E> clazz, - int index, - E defaultValue) -
      Get the enum value associated with a key.
      -
      intoptInt(int index) -
      Get the optional int value associated with an index.
      -
      intoptInt(int index, - int defaultValue) -
      Get the optional int value associated with an index.
      -
      JSONArrayoptJSONArray(int index) -
      Get the optional JSONArray associated with an index.
      -
      JSONObjectoptJSONObject(int index) -
      Get the optional JSONObject associated with an index.
      -
      longoptLong(int index) -
      Get the optional long value associated with an index.
      -
      longoptLong(int index, - long defaultValue) -
      Get the optional long value associated with an index.
      -
      java.lang.StringoptString(int index) -
      Get the optional string value associated with an index.
      -
      java.lang.StringoptString(int index, - java.lang.String defaultValue) -
      Get the optional string associated with an index.
      -
      JSONArrayput(boolean value) -
      Append a boolean value.
      -
      JSONArrayput(java.util.Collection<?> value) -
      Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
      -
      JSONArrayput(double value) -
      Append a double value.
      -
      JSONArrayput(int value) -
      Append an int value.
      -
      JSONArrayput(int index, - boolean value) -
      Put or replace a boolean value in the JSONArray.
      -
      JSONArrayput(int index, - java.util.Collection<?> value) -
      Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
      -
      JSONArrayput(int index, - double value) -
      Put or replace a double value.
      -
      JSONArrayput(int index, - int value) -
      Put or replace an int value.
      -
      JSONArrayput(int index, - long value) -
      Put or replace a long value.
      -
      JSONArrayput(int index, - java.util.Map<?,?> value) -
      Put a value in the JSONArray, where the value will be a JSONObject that - is produced from a Map.
      -
      JSONArrayput(int index, - java.lang.Object value) -
      Put or replace an object value in the JSONArray.
      -
      JSONArrayput(long value) -
      Append an long value.
      -
      JSONArrayput(java.util.Map<?,?> value) -
      Put a value in the JSONArray, where the value will be a JSONObject which - is produced from a Map.
      -
      JSONArrayput(java.lang.Object value) -
      Append an object value.
      -
      java.lang.Objectremove(int index) -
      Remove an index and close the hole.
      -
      booleansimilar(java.lang.Object other) -
      Determine if two JSONArrays are similar.
      -
      JSONObjecttoJSONObject(JSONArray names) -
      Produce a JSONObject by combining a JSONArray of names with the values of - this JSONArray.
      -
      java.lang.StringtoString() -
      Make a JSON text of this JSONArray.
      -
      java.lang.StringtoString(int indentFactor) -
      Make a prettyprinted JSON text of this JSONArray.
      -
      java.io.Writerwrite(java.io.Writer writer) -
      Write the contents of the JSONArray as JSON text to a writer.
      -
      java.io.Writerwrite(java.io.Writer writer, - int indentFactor, - int indent) -
      Write the contents of the JSONArray as JSON text to a writer.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
        -
      • - - -

        Methods inherited from interface java.lang.Iterable

        -forEach, spliterator
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONArray

        -
        public JSONArray()
        -
        Construct an empty JSONArray.
        -
      • -
      - - - -
        -
      • -

        JSONArray

        -
        public JSONArray(JSONTokener x)
        -          throws JSONException
        -
        Construct a JSONArray from a JSONTokener.
        -
        -
        Parameters:
        -
        x - A JSONTokener
        -
        Throws:
        -
        JSONException - If there is a syntax error.
        -
        -
      • -
      - - - -
        -
      • -

        JSONArray

        -
        public JSONArray(java.lang.String source)
        -          throws JSONException
        -
        Construct a JSONArray from a source JSON text.
        -
        -
        Parameters:
        -
        source - A string that begins with [ (left - bracket) and ends with ] -  (right bracket).
        -
        Throws:
        -
        JSONException - If there is a syntax error.
        -
        -
      • -
      - - - -
        -
      • -

        JSONArray

        -
        public JSONArray(java.util.Collection<?> collection)
        -
        Construct a JSONArray from a Collection.
        -
        -
        Parameters:
        -
        collection - A Collection.
        -
        -
      • -
      - - - -
        -
      • -

        JSONArray

        -
        public JSONArray(java.lang.Object array)
        -          throws JSONException
        -
        Construct a JSONArray from an array
        -
        -
        Throws:
        -
        JSONException - If not an array.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        iterator

        -
        public java.util.Iterator<java.lang.Object> iterator()
        -
        -
        Specified by:
        -
        iterator in interface java.lang.Iterable<java.lang.Object>
        -
        -
      • -
      - - - -
        -
      • -

        get

        -
        public java.lang.Object get(int index)
        -                     throws JSONException
        -
        Get the object value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        An object value.
        -
        Throws:
        -
        JSONException - If there is no value for the index.
        -
        -
      • -
      - - - -
        -
      • -

        getBoolean

        -
        public boolean getBoolean(int index)
        -                   throws JSONException
        -
        Get the boolean value associated with an index. The string values "true" - and "false" are converted to boolean.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The truth.
        -
        Throws:
        -
        JSONException - If there is no value for the index or if the value is not - convertible to boolean.
        -
        -
      • -
      - - - -
        -
      • -

        getDouble

        -
        public double getDouble(int index)
        -                 throws JSONException
        -
        Get the double value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        Throws:
        -
        JSONException - If the key is not found or if the value cannot be converted - to a number.
        -
        -
      • -
      - - - -
        -
      • -

        getEnum

        -
        public <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> clazz,
        -                                               int index)
        -                                        throws JSONException
        -
        Get the enum value associated with an index.
        -
        -
        Parameters:
        -
        clazz - The type of enum to retrieve.
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The enum value at the index location
        -
        Throws:
        -
        JSONException - if the key is not found or if the value cannot be converted - to an enum.
        -
        -
      • -
      - - - -
        -
      • -

        getBigDecimal

        -
        public java.math.BigDecimal getBigDecimal(int index)
        -                                   throws JSONException
        -
        Get the BigDecimal value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        Throws:
        -
        JSONException - If the key is not found or if the value cannot be converted - to a BigDecimal.
        -
        -
      • -
      - - - -
        -
      • -

        getBigInteger

        -
        public java.math.BigInteger getBigInteger(int index)
        -                                   throws JSONException
        -
        Get the BigInteger value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        Throws:
        -
        JSONException - If the key is not found or if the value cannot be converted - to a BigInteger.
        -
        -
      • -
      - - - -
        -
      • -

        getInt

        -
        public int getInt(int index)
        -           throws JSONException
        -
        Get the int value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        Throws:
        -
        JSONException - If the key is not found or if the value is not a number.
        -
        -
      • -
      - - - -
        -
      • -

        getJSONArray

        -
        public JSONArray getJSONArray(int index)
        -                       throws JSONException
        -
        Get the JSONArray associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        A JSONArray value.
        -
        Throws:
        -
        JSONException - If there is no value for the index. or if the value is not a - JSONArray
        -
        -
      • -
      - - - -
        -
      • -

        getJSONObject

        -
        public JSONObject getJSONObject(int index)
        -                         throws JSONException
        -
        Get the JSONObject associated with an index.
        -
        -
        Parameters:
        -
        index - subscript
        -
        Returns:
        -
        A JSONObject value.
        -
        Throws:
        -
        JSONException - If there is no value for the index or if the value is not a - JSONObject
        -
        -
      • -
      - - - -
        -
      • -

        getLong

        -
        public long getLong(int index)
        -             throws JSONException
        -
        Get the long value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        Throws:
        -
        JSONException - If the key is not found or if the value cannot be converted - to a number.
        -
        -
      • -
      - - - -
        -
      • -

        getString

        -
        public java.lang.String getString(int index)
        -                           throws JSONException
        -
        Get the string associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        A string value.
        -
        Throws:
        -
        JSONException - If there is no string value for the index.
        -
        -
      • -
      - - - -
        -
      • -

        isNull

        -
        public boolean isNull(int index)
        -
        Determine if the value is null.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        true if the value at the index is null, or if there is no value.
        -
        -
      • -
      - - - -
        -
      • -

        join

        -
        public java.lang.String join(java.lang.String separator)
        -                      throws JSONException
        -
        Make a string from the contents of this JSONArray. The - separator string is inserted between each element. Warning: - This method assumes that the data structure is acyclical.
        -
        -
        Parameters:
        -
        separator - A string that will be inserted between the elements.
        -
        Returns:
        -
        a string.
        -
        Throws:
        -
        JSONException - If the array contains an invalid number.
        -
        -
      • -
      - - - -
        -
      • -

        length

        -
        public int length()
        -
        Get the number of elements in the JSONArray, included nulls.
        -
        -
        Returns:
        -
        The length (or size).
        -
        -
      • -
      - - - -
        -
      • -

        opt

        -
        public java.lang.Object opt(int index)
        -
        Get the optional object value associated with an index.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        An object value, or null if there is no object at that index.
        -
        -
      • -
      - - - -
        -
      • -

        optBoolean

        -
        public boolean optBoolean(int index)
        -
        Get the optional boolean value associated with an index. It returns false - if there is no value at that index, or if the value is not Boolean.TRUE - or the String "true".
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The truth.
        -
        -
      • -
      - - - -
        -
      • -

        optBoolean

        -
        public boolean optBoolean(int index,
        -                          boolean defaultValue)
        -
        Get the optional boolean value associated with an index. It returns the - defaultValue if there is no value at that index or if it is not a Boolean - or the String "true" or "false" (case insensitive).
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - A boolean default.
        -
        Returns:
        -
        The truth.
        -
        -
      • -
      - - - -
        -
      • -

        optDouble

        -
        public double optDouble(int index)
        -
        Get the optional double value associated with an index. NaN is returned - if there is no value for the index, or if the value is not a number and - cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optDouble

        -
        public double optDouble(int index,
        -                        double defaultValue)
        -
        Get the optional double value associated with an index. The defaultValue - is returned if there is no value for the index, or if the value is not a - number and cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - subscript
        -
        defaultValue - The default value.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optInt

        -
        public int optInt(int index)
        -
        Get the optional int value associated with an index. Zero is returned if - there is no value for the index, or if the value is not a number and - cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optInt

        -
        public int optInt(int index,
        -                  int defaultValue)
        -
        Get the optional int value associated with an index. The defaultValue is - returned if there is no value for the index, or if the value is not a - number and cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - The default value.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optEnum

        -
        public <E extends java.lang.Enum<E>> E optEnum(java.lang.Class<E> clazz,
        -                                               int index)
        -
        Get the enum value associated with a key.
        -
        -
        Parameters:
        -
        clazz - The type of enum to retrieve.
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The enum value at the index location or null if not found
        -
        -
      • -
      - - - - - -
        -
      • -

        optEnum

        -
        public <E extends java.lang.Enum<E>> E optEnum(java.lang.Class<E> clazz,
        -                                               int index,
        -                                               E defaultValue)
        -
        Get the enum value associated with a key.
        -
        -
        Parameters:
        -
        clazz - The type of enum to retrieve.
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - The default in case the value is not found
        -
        Returns:
        -
        The enum value at the index location or defaultValue if - the value is not found or cannot be assigned to clazz
        -
        -
      • -
      - - - -
        -
      • -

        optBigInteger

        -
        public java.math.BigInteger optBigInteger(int index,
        -                                          java.math.BigInteger defaultValue)
        -
        Get the optional BigInteger value associated with an index. The - defaultValue is returned if there is no value for the index, or if the - value is not a number and cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - The default value.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optBigDecimal

        -
        public java.math.BigDecimal optBigDecimal(int index,
        -                                          java.math.BigDecimal defaultValue)
        -
        Get the optional BigDecimal value associated with an index. The - defaultValue is returned if there is no value for the index, or if the - value is not a number and cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - The default value.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optJSONArray

        -
        public JSONArray optJSONArray(int index)
        -
        Get the optional JSONArray associated with an index.
        -
        -
        Parameters:
        -
        index - subscript
        -
        Returns:
        -
        A JSONArray value, or null if the index has no value, or if the - value is not a JSONArray.
        -
        -
      • -
      - - - -
        -
      • -

        optJSONObject

        -
        public JSONObject optJSONObject(int index)
        -
        Get the optional JSONObject associated with an index. Null is returned if - the key is not found, or null if the index has no value, or if the value - is not a JSONObject.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        A JSONObject value.
        -
        -
      • -
      - - - -
        -
      • -

        optLong

        -
        public long optLong(int index)
        -
        Get the optional long value associated with an index. Zero is returned if - there is no value for the index, or if the value is not a number and - cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optLong

        -
        public long optLong(int index,
        -                    long defaultValue)
        -
        Get the optional long value associated with an index. The defaultValue is - returned if there is no value for the index, or if the value is not a - number and cannot be converted to a number.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - The default value.
        -
        Returns:
        -
        The value.
        -
        -
      • -
      - - - -
        -
      • -

        optString

        -
        public java.lang.String optString(int index)
        -
        Get the optional string value associated with an index. It returns an - empty string if there is no value at that index. If the value is not a - string and is not null, then it is coverted to a string.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        Returns:
        -
        A String value.
        -
        -
      • -
      - - - -
        -
      • -

        optString

        -
        public java.lang.String optString(int index,
        -                                  java.lang.String defaultValue)
        -
        Get the optional string associated with an index. The defaultValue is - returned if the key is not found.
        -
        -
        Parameters:
        -
        index - The index must be between 0 and length() - 1.
        -
        defaultValue - The default value.
        -
        Returns:
        -
        A String value.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(boolean value)
        -
        Append a boolean value. This increases the array's length by one.
        -
        -
        Parameters:
        -
        value - A boolean value.
        -
        Returns:
        -
        this.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(java.util.Collection<?> value)
        -
        Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
        -
        -
        Parameters:
        -
        value - A Collection value.
        -
        Returns:
        -
        this.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(double value)
        -              throws JSONException
        -
        Append a double value. This increases the array's length by one.
        -
        -
        Parameters:
        -
        value - A double value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - if the value is not finite.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int value)
        -
        Append an int value. This increases the array's length by one.
        -
        -
        Parameters:
        -
        value - An int value.
        -
        Returns:
        -
        this.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(long value)
        -
        Append an long value. This increases the array's length by one.
        -
        -
        Parameters:
        -
        value - A long value.
        -
        Returns:
        -
        this.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(java.util.Map<?,?> value)
        -
        Put a value in the JSONArray, where the value will be a JSONObject which - is produced from a Map.
        -
        -
        Parameters:
        -
        value - A Map value.
        -
        Returns:
        -
        this.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(java.lang.Object value)
        -
        Append an object value. This increases the array's length by one.
        -
        -
        Parameters:
        -
        value - An object value. The value should be a Boolean, Double, - Integer, JSONArray, JSONObject, Long, or String, or the - JSONObject.NULL object.
        -
        Returns:
        -
        this.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     boolean value)
        -              throws JSONException
        -
        Put or replace a boolean value in the JSONArray. If the index is greater - than the length of the JSONArray, then null elements will be added as - necessary to pad it out.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - A boolean value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     java.util.Collection<?> value)
        -              throws JSONException
        -
        Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - A Collection value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative or if the value is not finite.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     double value)
        -              throws JSONException
        -
        Put or replace a double value. If the index is greater than the length of - the JSONArray, then null elements will be added as necessary to pad it - out.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - A double value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative or if the value is not finite.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     int value)
        -              throws JSONException
        -
        Put or replace an int value. If the index is greater than the length of - the JSONArray, then null elements will be added as necessary to pad it - out.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - An int value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     long value)
        -              throws JSONException
        -
        Put or replace a long value. If the index is greater than the length of - the JSONArray, then null elements will be added as necessary to pad it - out.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - A long value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     java.util.Map<?,?> value)
        -              throws JSONException
        -
        Put a value in the JSONArray, where the value will be a JSONObject that - is produced from a Map.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - The Map value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative or if the the value is an invalid - number.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONArray put(int index,
        -                     java.lang.Object value)
        -              throws JSONException
        -
        Put or replace an object value in the JSONArray. If the index is greater - than the length of the JSONArray, then null elements will be added as - necessary to pad it out.
        -
        -
        Parameters:
        -
        index - The subscript.
        -
        value - The value to put into the array. The value should be a - Boolean, Double, Integer, JSONArray, JSONObject, Long, or - String, or the JSONObject.NULL object.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the index is negative or if the the value is an invalid - number.
        -
        -
      • -
      - - - -
        -
      • -

        remove

        -
        public java.lang.Object remove(int index)
        -
        Remove an index and close the hole.
        -
        -
        Parameters:
        -
        index - The index of the element to be removed.
        -
        Returns:
        -
        The value that was associated with the index, or null if there - was no value.
        -
        -
      • -
      - - - -
        -
      • -

        similar

        -
        public boolean similar(java.lang.Object other)
        -
        Determine if two JSONArrays are similar. - They must contain similar sequences.
        -
        -
        Parameters:
        -
        other - The other JSONArray
        -
        Returns:
        -
        true if they are equal
        -
        -
      • -
      - - - -
        -
      • -

        toJSONObject

        -
        public JSONObject toJSONObject(JSONArray names)
        -                        throws JSONException
        -
        Produce a JSONObject by combining a JSONArray of names with the values of - this JSONArray.
        -
        -
        Parameters:
        -
        names - A JSONArray containing a list of key strings. These will be - paired with the values.
        -
        Returns:
        -
        A JSONObject, or null if there are no names or if this JSONArray - has no values.
        -
        Throws:
        -
        JSONException - If any of the names are null.
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public java.lang.String toString()
        -
        Make a JSON text of this JSONArray. For compactness, no unnecessary - whitespace is added. If it is not possible to produce a syntactically - correct JSON text then null will be returned instead. This could occur if - the array contains an invalid number. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Overrides:
        -
        toString in class java.lang.Object
        -
        Returns:
        -
        a printable, displayable, transmittable representation of the - array.
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public java.lang.String toString(int indentFactor)
        -                          throws JSONException
        -
        Make a prettyprinted JSON text of this JSONArray. Warning: This method - assumes that the data structure is acyclical.
        -
        -
        Parameters:
        -
        indentFactor - The number of spaces to add to each level of indentation.
        -
        Returns:
        -
        a printable, displayable, transmittable representation of the - object, beginning with [ (left - bracket) and ending with ] -  (right bracket).
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        write

        -
        public java.io.Writer write(java.io.Writer writer)
        -                     throws JSONException
        -
        Write the contents of the JSONArray as JSON text to a writer. For - compactness, no whitespace is added. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Returns:
        -
        The writer.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        write

        -
        public java.io.Writer write(java.io.Writer writer,
        -                            int indentFactor,
        -                            int indent)
        -                     throws JSONException
        -
        Write the contents of the JSONArray as JSON text to a writer. For - compactness, no whitespace is added. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Parameters:
        -
        writer - Writes the serialized JSON
        -
        indentFactor - The number of spaces to add to each level of indentation.
        -
        indent - The indention of the top level.
        -
        Returns:
        -
        The writer.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONArray + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONArray

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Iterable<Object>
    +
    +
    +
    +
    public class JSONArray
    +extends Object
    +implements Iterable<Object>
    +
    A JSONArray is an ordered sequence of values. Its external text form is a + string wrapped in square brackets with commas separating the values. The + internal form is an object having get and opt + methods for accessing the values by index, and put methods for + adding or replacing values. The values can be any of these types: + Boolean, JSONArray, JSONObject, + Number, String, or the + JSONObject.NULL object. +

    + The constructor can convert a JSON text into a Java object. The + toString method converts to JSON text. +

    + A get method returns a value if one can be found, and throws an + exception if one cannot be found. An opt method returns a + default value instead of throwing an exception, and so is useful for + obtaining optional values. +

    + The generic get() and opt() methods return an + object which you can cast or query for type. There are also typed + get and opt methods that do type checking and type + coercion for you. +

    + The texts produced by the toString methods strictly conform to + JSON syntax rules. The constructors are more forgiving in the texts they will + accept: +

      +
    • An extra , (comma) may appear just + before the closing bracket.
    • +
    • The null value will be inserted when there is , +  (comma) elision.
    • +
    • Strings may be quoted with ' (single + quote).
    • +
    • Strings do not need to be quoted at all if they do not begin with a quote + or single quote, and if they do not contain leading or trailing spaces, and + if they do not contain any of these characters: + { } [ ] / \ : , # and if they do not look like numbers and + if they are not the reserved words true, false, or + null.
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      JSONArray() +
      Construct an empty JSONArray.
      +
      JSONArray(Collection<?> collection) +
      Construct a JSONArray from a Collection.
      +
      JSONArray(int initialCapacity) +
      Construct a JSONArray with the specified initial capacity.
      +
      JSONArray(Iterable<?> iter) +
      Construct a JSONArray from an Iterable.
      +
      JSONArray(JSONArray array) +
      Construct a JSONArray from another JSONArray.
      +
      JSONArray(JSONTokener x) +
      Construct a JSONArray from a JSONTokener.
      +
      JSONArray(Object array) +
      Construct a JSONArray from an array.
      +
      JSONArray(String source) +
      Construct a JSONArray from a source JSON text.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      Objectget(int index) +
      Get the object value associated with an index.
      +
      BigDecimalgetBigDecimal(int index) +
      Get the BigDecimal value associated with an index.
      +
      BigIntegergetBigInteger(int index) +
      Get the BigInteger value associated with an index.
      +
      booleangetBoolean(int index) +
      Get the boolean value associated with an index.
      +
      doublegetDouble(int index) +
      Get the double value associated with an index.
      +
      <E extends Enum<E>>
      E
      getEnum(Class<E> clazz, + int index) +
      Get the enum value associated with an index.
      +
      floatgetFloat(int index) +
      Get the float value associated with a key.
      +
      intgetInt(int index) +
      Get the int value associated with an index.
      +
      JSONArraygetJSONArray(int index) +
      Get the JSONArray associated with an index.
      +
      JSONObjectgetJSONObject(int index) +
      Get the JSONObject associated with an index.
      +
      longgetLong(int index) +
      Get the long value associated with an index.
      +
      NumbergetNumber(int index) +
      Get the Number value associated with a key.
      +
      StringgetString(int index) +
      Get the string associated with an index.
      +
      booleanisEmpty() +
      Check if JSONArray is empty.
      +
      booleanisNull(int index) +
      Determine if the value is null.
      +
      Iterator<Object>iterator() 
      Stringjoin(String separator) +
      Make a string from the contents of this JSONArray.
      +
      intlength() +
      Get the number of elements in the JSONArray, included nulls.
      +
      Objectopt(int index) +
      Get the optional object value associated with an index.
      +
      BigDecimaloptBigDecimal(int index, + BigDecimal defaultValue) +
      Get the optional BigDecimal value associated with an index.
      +
      BigIntegeroptBigInteger(int index, + BigInteger defaultValue) +
      Get the optional BigInteger value associated with an index.
      +
      booleanoptBoolean(int index) +
      Get the optional boolean value associated with an index.
      +
      booleanoptBoolean(int index, + boolean defaultValue) +
      Get the optional boolean value associated with an index.
      +
      doubleoptDouble(int index) +
      Get the optional double value associated with an index.
      +
      doubleoptDouble(int index, + double defaultValue) +
      Get the optional double value associated with an index.
      +
      <E extends Enum<E>>
      E
      optEnum(Class<E> clazz, + int index) +
      Get the enum value associated with a key.
      +
      <E extends Enum<E>>
      E
      optEnum(Class<E> clazz, + int index, + E defaultValue) +
      Get the enum value associated with a key.
      +
      floatoptFloat(int index) +
      Get the optional float value associated with an index.
      +
      floatoptFloat(int index, + float defaultValue) +
      Get the optional float value associated with an index.
      +
      intoptInt(int index) +
      Get the optional int value associated with an index.
      +
      intoptInt(int index, + int defaultValue) +
      Get the optional int value associated with an index.
      +
      JSONArrayoptJSONArray(int index) +
      Get the optional JSONArray associated with an index.
      +
      JSONObjectoptJSONObject(int index) +
      Get the optional JSONObject associated with an index.
      +
      longoptLong(int index) +
      Get the optional long value associated with an index.
      +
      longoptLong(int index, + long defaultValue) +
      Get the optional long value associated with an index.
      +
      NumberoptNumber(int index) +
      Get an optional Number value associated with a key, or null + if there is no such key or if the value is not a number.
      +
      NumberoptNumber(int index, + Number defaultValue) +
      Get an optional Number value associated with a key, or the default if there + is no such key or if the value is not a number.
      +
      ObjectoptQuery(JSONPointer jsonPointer) +
      Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
      +
      ObjectoptQuery(String jsonPointer) +
      Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
      +
      StringoptString(int index) +
      Get the optional string value associated with an index.
      +
      StringoptString(int index, + String defaultValue) +
      Get the optional string associated with an index.
      +
      JSONArrayput(boolean value) +
      Append a boolean value.
      +
      JSONArrayput(Collection<?> value) +
      Put a value in the JSONArray, where the value will be a JSONArray which + is produced from a Collection.
      +
      JSONArrayput(double value) +
      Append a double value.
      +
      JSONArrayput(float value) +
      Append a float value.
      +
      JSONArrayput(int value) +
      Append an int value.
      +
      JSONArrayput(int index, + boolean value) +
      Put or replace a boolean value in the JSONArray.
      +
      JSONArrayput(int index, + Collection<?> value) +
      Put a value in the JSONArray, where the value will be a JSONArray which + is produced from a Collection.
      +
      JSONArrayput(int index, + double value) +
      Put or replace a double value.
      +
      JSONArrayput(int index, + float value) +
      Put or replace a float value.
      +
      JSONArrayput(int index, + int value) +
      Put or replace an int value.
      +
      JSONArrayput(int index, + long value) +
      Put or replace a long value.
      +
      JSONArrayput(int index, + Map<?,?> value) +
      Put a value in the JSONArray, where the value will be a JSONObject that + is produced from a Map.
      +
      JSONArrayput(int index, + Object value) +
      Put or replace an object value in the JSONArray.
      +
      JSONArrayput(long value) +
      Append an long value.
      +
      JSONArrayput(Map<?,?> value) +
      Put a value in the JSONArray, where the value will be a JSONObject which + is produced from a Map.
      +
      JSONArrayput(Object value) +
      Append an object value.
      +
      JSONArrayputAll(Collection<?> collection) +
      Put a collection's elements in to the JSONArray.
      +
      JSONArrayputAll(Iterable<?> iter) +
      Put an Iterable's elements in to the JSONArray.
      +
      JSONArrayputAll(JSONArray array) +
      Put a JSONArray's elements in to the JSONArray.
      +
      JSONArrayputAll(Object array) +
      Put an array's elements in to the JSONArray.
      +
      Objectquery(JSONPointer jsonPointer) +
      Uses a user initialized JSONPointer and tries to + match it to an item within this JSONArray.
      +
      Objectquery(String jsonPointer) +
      Creates a JSONPointer using an initialization string and tries to + match it to an item within this JSONArray.
      +
      Objectremove(int index) +
      Remove an index and close the hole.
      +
      booleansimilar(Object other) +
      Determine if two JSONArrays are similar.
      +
      JSONObjecttoJSONObject(JSONArray names) +
      Produce a JSONObject by combining a JSONArray of names with the values of + this JSONArray.
      +
      List<Object>toList() +
      Returns a java.util.List containing all of the elements in this array.
      +
      StringtoString() +
      Make a JSON text of this JSONArray.
      +
      StringtoString(int indentFactor) +
      Make a pretty-printed JSON text of this JSONArray.
      +
      Writerwrite(Writer writer) +
      Write the contents of the JSONArray as JSON text to a writer.
      +
      Writerwrite(Writer writer, + int indentFactor, + int indent) +
      Write the contents of the JSONArray as JSON text to a writer.
      +
      + + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray()
        +
        Construct an empty JSONArray.
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(JSONTokener x)
        +          throws JSONException
        +
        Construct a JSONArray from a JSONTokener.
        +
        +
        Parameters:
        +
        x - A JSONTokener
        +
        Throws:
        +
        JSONException - If there is a syntax error.
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(String source)
        +          throws JSONException
        +
        Construct a JSONArray from a source JSON text.
        +
        +
        Parameters:
        +
        source - A string that begins with [ (left + bracket) and ends with ] +  (right bracket).
        +
        Throws:
        +
        JSONException - If there is a syntax error.
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(Collection<?> collection)
        +
        Construct a JSONArray from a Collection.
        +
        +
        Parameters:
        +
        collection - A Collection.
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(Iterable<?> iter)
        +
        Construct a JSONArray from an Iterable. This is a shallow copy.
        +
        +
        Parameters:
        +
        iter - A Iterable collection.
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(JSONArray array)
        +
        Construct a JSONArray from another JSONArray. This is a shallow copy.
        +
        +
        Parameters:
        +
        array - A array.
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(Object array)
        +          throws JSONException
        +
        Construct a JSONArray from an array.
        +
        +
        Parameters:
        +
        array - Array. If the parameter passed is null, or not an array, an + exception will be thrown.
        +
        Throws:
        +
        JSONException - If not an array or if an array value is non-finite number.
        +
        NullPointerException - Thrown if the array parameter is null.
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(int initialCapacity)
        +          throws JSONException
        +
        Construct a JSONArray with the specified initial capacity.
        +
        +
        Parameters:
        +
        initialCapacity - the initial capacity of the JSONArray.
        +
        Throws:
        +
        JSONException - If the initial capacity is negative.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        get

        +
        public Object get(int index)
        +           throws JSONException
        +
        Get the object value associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        An object value.
        +
        Throws:
        +
        JSONException - If there is no value for the index.
        +
        +
      • +
      + + + +
        +
      • +

        getBoolean

        +
        public boolean getBoolean(int index)
        +                   throws JSONException
        +
        Get the boolean value associated with an index. The string values "true" + and "false" are converted to boolean.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The truth.
        +
        Throws:
        +
        JSONException - If there is no value for the index or if the value is not + convertible to boolean.
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble(int index)
        +                 throws JSONException
        +
        Get the double value associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        Throws:
        +
        JSONException - If the key is not found or if the value cannot be converted + to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat(int index)
        +               throws JSONException
        +
        Get the float value associated with a key.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a Number + object and cannot be converted to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getNumber

        +
        public Number getNumber(int index)
        +                 throws JSONException
        +
        Get the Number value associated with a key.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a Number + object and cannot be converted to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getEnum

        +
        public <E extends Enum<E>> E getEnum(Class<E> clazz,
        +                                     int index)
        +                              throws JSONException
        +
        Get the enum value associated with an index.
        +
        +
        Type Parameters:
        +
        E - Enum Type
        +
        Parameters:
        +
        clazz - The type of enum to retrieve.
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The enum value at the index location
        +
        Throws:
        +
        JSONException - if the key is not found or if the value cannot be converted + to an enum.
        +
        +
      • +
      + + + +
        +
      • +

        getBigDecimal

        +
        public BigDecimal getBigDecimal(int index)
        +                         throws JSONException
        +
        Get the BigDecimal value associated with an index. If the value is float + or double, the the BigDecimal.BigDecimal(double) constructor + will be used. See notes on the constructor for conversion issues that + may arise.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        Throws:
        +
        JSONException - If the key is not found or if the value cannot be converted + to a BigDecimal.
        +
        +
      • +
      + + + +
        +
      • +

        getBigInteger

        +
        public BigInteger getBigInteger(int index)
        +                         throws JSONException
        +
        Get the BigInteger value associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        Throws:
        +
        JSONException - If the key is not found or if the value cannot be converted + to a BigInteger.
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt(int index)
        +           throws JSONException
        +
        Get the int value associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        Throws:
        +
        JSONException - If the key is not found or if the value is not a number.
        +
        +
      • +
      + + + +
        +
      • +

        getJSONArray

        +
        public JSONArray getJSONArray(int index)
        +                       throws JSONException
        +
        Get the JSONArray associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        A JSONArray value.
        +
        Throws:
        +
        JSONException - If there is no value for the index. or if the value is not a + JSONArray
        +
        +
      • +
      + + + +
        +
      • +

        getJSONObject

        +
        public JSONObject getJSONObject(int index)
        +                         throws JSONException
        +
        Get the JSONObject associated with an index.
        +
        +
        Parameters:
        +
        index - subscript
        +
        Returns:
        +
        A JSONObject value.
        +
        Throws:
        +
        JSONException - If there is no value for the index or if the value is not a + JSONObject
        +
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        public long getLong(int index)
        +             throws JSONException
        +
        Get the long value associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        Throws:
        +
        JSONException - If the key is not found or if the value cannot be converted + to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString(int index)
        +                 throws JSONException
        +
        Get the string associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        A string value.
        +
        Throws:
        +
        JSONException - If there is no string value for the index.
        +
        +
      • +
      + + + +
        +
      • +

        isNull

        +
        public boolean isNull(int index)
        +
        Determine if the value is null.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        true if the value at the index is null, or if there is no value.
        +
        +
      • +
      + + + +
        +
      • +

        join

        +
        public String join(String separator)
        +            throws JSONException
        +
        Make a string from the contents of this JSONArray. The + separator string is inserted between each element. Warning: + This method assumes that the data structure is acyclical.
        +
        +
        Parameters:
        +
        separator - A string that will be inserted between the elements.
        +
        Returns:
        +
        a string.
        +
        Throws:
        +
        JSONException - If the array contains an invalid number.
        +
        +
      • +
      + + + +
        +
      • +

        length

        +
        public int length()
        +
        Get the number of elements in the JSONArray, included nulls.
        +
        +
        Returns:
        +
        The length (or size).
        +
        +
      • +
      + + + +
        +
      • +

        opt

        +
        public Object opt(int index)
        +
        Get the optional object value associated with an index.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1. If not, null is returned.
        +
        Returns:
        +
        An object value, or null if there is no object at that index.
        +
        +
      • +
      + + + +
        +
      • +

        optBoolean

        +
        public boolean optBoolean(int index)
        +
        Get the optional boolean value associated with an index. It returns false + if there is no value at that index, or if the value is not Boolean.TRUE + or the String "true".
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The truth.
        +
        +
      • +
      + + + +
        +
      • +

        optBoolean

        +
        public boolean optBoolean(int index,
        +                          boolean defaultValue)
        +
        Get the optional boolean value associated with an index. It returns the + defaultValue if there is no value at that index or if it is not a Boolean + or the String "true" or "false" (case insensitive).
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - A boolean default.
        +
        Returns:
        +
        The truth.
        +
        +
      • +
      + + + +
        +
      • +

        optDouble

        +
        public double optDouble(int index)
        +
        Get the optional double value associated with an index. NaN is returned + if there is no value for the index, or if the value is not a number and + cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optDouble

        +
        public double optDouble(int index,
        +                        double defaultValue)
        +
        Get the optional double value associated with an index. The defaultValue + is returned if there is no value for the index, or if the value is not a + number and cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - subscript
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optFloat

        +
        public float optFloat(int index)
        +
        Get the optional float value associated with an index. NaN is returned + if there is no value for the index, or if the value is not a number and + cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optFloat

        +
        public float optFloat(int index,
        +                      float defaultValue)
        +
        Get the optional float value associated with an index. The defaultValue + is returned if there is no value for the index, or if the value is not a + number and cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - subscript
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optInt

        +
        public int optInt(int index)
        +
        Get the optional int value associated with an index. Zero is returned if + there is no value for the index, or if the value is not a number and + cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optInt

        +
        public int optInt(int index,
        +                  int defaultValue)
        +
        Get the optional int value associated with an index. The defaultValue is + returned if there is no value for the index, or if the value is not a + number and cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optEnum

        +
        public <E extends Enum<E>> E optEnum(Class<E> clazz,
        +                                     int index)
        +
        Get the enum value associated with a key.
        +
        +
        Type Parameters:
        +
        E - Enum Type
        +
        Parameters:
        +
        clazz - The type of enum to retrieve.
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The enum value at the index location or null if not found
        +
        +
      • +
      + + + + + +
        +
      • +

        optEnum

        +
        public <E extends Enum<E>> E optEnum(Class<E> clazz,
        +                                     int index,
        +                                     E defaultValue)
        +
        Get the enum value associated with a key.
        +
        +
        Type Parameters:
        +
        E - Enum Type
        +
        Parameters:
        +
        clazz - The type of enum to retrieve.
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default in case the value is not found
        +
        Returns:
        +
        The enum value at the index location or defaultValue if + the value is not found or cannot be assigned to clazz
        +
        +
      • +
      + + + +
        +
      • +

        optBigInteger

        +
        public BigInteger optBigInteger(int index,
        +                                BigInteger defaultValue)
        +
        Get the optional BigInteger value associated with an index. The + defaultValue is returned if there is no value for the index, or if the + value is not a number and cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optBigDecimal

        +
        public BigDecimal optBigDecimal(int index,
        +                                BigDecimal defaultValue)
        +
        Get the optional BigDecimal value associated with an index. The + defaultValue is returned if there is no value for the index, or if the + value is not a number and cannot be converted to a number. If the value + is float or double, the the BigDecimal.BigDecimal(double) + constructor will be used. See notes on the constructor for conversion + issues that may arise.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optJSONArray

        +
        public JSONArray optJSONArray(int index)
        +
        Get the optional JSONArray associated with an index.
        +
        +
        Parameters:
        +
        index - subscript
        +
        Returns:
        +
        A JSONArray value, or null if the index has no value, or if the + value is not a JSONArray.
        +
        +
      • +
      + + + +
        +
      • +

        optJSONObject

        +
        public JSONObject optJSONObject(int index)
        +
        Get the optional JSONObject associated with an index. Null is returned if + the key is not found, or null if the index has no value, or if the value + is not a JSONObject.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        A JSONObject value.
        +
        +
      • +
      + + + +
        +
      • +

        optLong

        +
        public long optLong(int index)
        +
        Get the optional long value associated with an index. Zero is returned if + there is no value for the index, or if the value is not a number and + cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optLong

        +
        public long optLong(int index,
        +                    long defaultValue)
        +
        Get the optional long value associated with an index. The defaultValue is + returned if there is no value for the index, or if the value is not a + number and cannot be converted to a number.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optNumber

        +
        public Number optNumber(int index)
        +
        Get an optional Number value associated with a key, or null + if there is no such key or if the value is not a number. If the value is a string, + an attempt will be made to evaluate it as a number (BigDecimal). This method + would be used in cases where type coercion of the number value is unwanted.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optNumber

        +
        public Number optNumber(int index,
        +                        Number defaultValue)
        +
        Get an optional Number value associated with a key, or the default if there + is no such key or if the value is not a number. If the value is a string, + an attempt will be made to evaluate it as a number (BigDecimal). This method + would be used in cases where type coercion of the number value is unwanted.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optString

        +
        public String optString(int index)
        +
        Get the optional string value associated with an index. It returns an + empty string if there is no value at that index. If the value is not a + string and is not null, then it is converted to a string.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        Returns:
        +
        A String value.
        +
        +
      • +
      + + + +
        +
      • +

        optString

        +
        public String optString(int index,
        +                        String defaultValue)
        +
        Get the optional string associated with an index. The defaultValue is + returned if the key is not found.
        +
        +
        Parameters:
        +
        index - The index must be between 0 and length() - 1.
        +
        defaultValue - The default value.
        +
        Returns:
        +
        A String value.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(boolean value)
        +
        Append a boolean value. This increases the array's length by one.
        +
        +
        Parameters:
        +
        value - A boolean value.
        +
        Returns:
        +
        this.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(Collection<?> value)
        +
        Put a value in the JSONArray, where the value will be a JSONArray which + is produced from a Collection.
        +
        +
        Parameters:
        +
        value - A Collection value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(double value)
        +              throws JSONException
        +
        Append a double value. This increases the array's length by one.
        +
        +
        Parameters:
        +
        value - A double value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - if the value is not finite.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(float value)
        +              throws JSONException
        +
        Append a float value. This increases the array's length by one.
        +
        +
        Parameters:
        +
        value - A float value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - if the value is not finite.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int value)
        +
        Append an int value. This increases the array's length by one.
        +
        +
        Parameters:
        +
        value - An int value.
        +
        Returns:
        +
        this.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(long value)
        +
        Append an long value. This increases the array's length by one.
        +
        +
        Parameters:
        +
        value - A long value.
        +
        Returns:
        +
        this.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(Map<?,?> value)
        +
        Put a value in the JSONArray, where the value will be a JSONObject which + is produced from a Map.
        +
        +
        Parameters:
        +
        value - A Map value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If a value in the map is non-finite number.
        +
        NullPointerException - If a key in the map is null
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(Object value)
        +
        Append an object value. This increases the array's length by one.
        +
        +
        Parameters:
        +
        value - An object value. The value should be a Boolean, Double, + Integer, JSONArray, JSONObject, Long, or String, or the + JSONObject.NULL object.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     boolean value)
        +              throws JSONException
        +
        Put or replace a boolean value in the JSONArray. If the index is greater + than the length of the JSONArray, then null elements will be added as + necessary to pad it out.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - A boolean value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     Collection<?> value)
        +              throws JSONException
        +
        Put a value in the JSONArray, where the value will be a JSONArray which + is produced from a Collection.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - A Collection value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative or if the value is non-finite.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     double value)
        +              throws JSONException
        +
        Put or replace a double value. If the index is greater than the length of + the JSONArray, then null elements will be added as necessary to pad it + out.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - A double value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative or if the value is non-finite.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     float value)
        +              throws JSONException
        +
        Put or replace a float value. If the index is greater than the length of + the JSONArray, then null elements will be added as necessary to pad it + out.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - A float value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative or if the value is non-finite.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     int value)
        +              throws JSONException
        +
        Put or replace an int value. If the index is greater than the length of + the JSONArray, then null elements will be added as necessary to pad it + out.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - An int value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     long value)
        +              throws JSONException
        +
        Put or replace a long value. If the index is greater than the length of + the JSONArray, then null elements will be added as necessary to pad it + out.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - A long value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     Map<?,?> value)
        +              throws JSONException
        +
        Put a value in the JSONArray, where the value will be a JSONObject that + is produced from a Map.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - The Map value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative or if the the value is an invalid + number.
        +
        NullPointerException - If a key in the map is null
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONArray put(int index,
        +                     Object value)
        +              throws JSONException
        +
        Put or replace an object value in the JSONArray. If the index is greater + than the length of the JSONArray, then null elements will be added as + necessary to pad it out.
        +
        +
        Parameters:
        +
        index - The subscript.
        +
        value - The value to put into the array. The value should be a + Boolean, Double, Integer, JSONArray, JSONObject, Long, or + String, or the JSONObject.NULL object.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the index is negative or if the the value is an invalid + number.
        +
        +
      • +
      + + + +
        +
      • +

        putAll

        +
        public JSONArray putAll(Collection<?> collection)
        +
        Put a collection's elements in to the JSONArray.
        +
        +
        Parameters:
        +
        collection - A Collection.
        +
        Returns:
        +
        this.
        +
        +
      • +
      + + + +
        +
      • +

        putAll

        +
        public JSONArray putAll(Iterable<?> iter)
        +
        Put an Iterable's elements in to the JSONArray.
        +
        +
        Parameters:
        +
        iter - An Iterable.
        +
        Returns:
        +
        this.
        +
        +
      • +
      + + + +
        +
      • +

        putAll

        +
        public JSONArray putAll(JSONArray array)
        +
        Put a JSONArray's elements in to the JSONArray.
        +
        +
        Parameters:
        +
        array - A JSONArray.
        +
        Returns:
        +
        this.
        +
        +
      • +
      + + + +
        +
      • +

        putAll

        +
        public JSONArray putAll(Object array)
        +                 throws JSONException
        +
        Put an array's elements in to the JSONArray.
        +
        +
        Parameters:
        +
        array - Array. If the parameter passed is null, or not an array or Iterable, an + exception will be thrown.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If not an array, JSONArray, Iterable or if an value is non-finite number.
        +
        NullPointerException - Thrown if the array parameter is null.
        +
        +
      • +
      + + + +
        +
      • +

        query

        +
        public Object query(String jsonPointer)
        +
        Creates a JSONPointer using an initialization string and tries to + match it to an item within this JSONArray. For example, given a + JSONArray initialized with this document: +
        + [
        +     {"b":"c"}
        + ]
        + 
        + and this JSONPointer string: +
        + "/0/b"
        + 
        + Then this method will return the String "c" + A JSONPointerException may be thrown from code called by this method.
        +
        +
        Parameters:
        +
        jsonPointer - string that can be used to create a JSONPointer
        +
        Returns:
        +
        the item matched by the JSONPointer, otherwise null
        +
        +
      • +
      + + + +
        +
      • +

        query

        +
        public Object query(JSONPointer jsonPointer)
        +
        Uses a user initialized JSONPointer and tries to + match it to an item within this JSONArray. For example, given a + JSONArray initialized with this document: +
        + [
        +     {"b":"c"}
        + ]
        + 
        + and this JSONPointer: +
        + "/0/b"
        + 
        + Then this method will return the String "c" + A JSONPointerException may be thrown from code called by this method.
        +
        +
        Parameters:
        +
        jsonPointer - string that can be used to create a JSONPointer
        +
        Returns:
        +
        the item matched by the JSONPointer, otherwise null
        +
        +
      • +
      + + + +
        +
      • +

        optQuery

        +
        public Object optQuery(String jsonPointer)
        +
        Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
        +
        +
        Parameters:
        +
        jsonPointer - the string representation of the JSON pointer
        +
        Returns:
        +
        the queried value or null
        +
        Throws:
        +
        IllegalArgumentException - if jsonPointer has invalid syntax
        +
        +
      • +
      + + + +
        +
      • +

        optQuery

        +
        public Object optQuery(JSONPointer jsonPointer)
        +
        Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
        +
        +
        Parameters:
        +
        jsonPointer - The JSON pointer
        +
        Returns:
        +
        the queried value or null
        +
        Throws:
        +
        IllegalArgumentException - if jsonPointer has invalid syntax
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public Object remove(int index)
        +
        Remove an index and close the hole.
        +
        +
        Parameters:
        +
        index - The index of the element to be removed.
        +
        Returns:
        +
        The value that was associated with the index, or null if there + was no value.
        +
        +
      • +
      + + + +
        +
      • +

        similar

        +
        public boolean similar(Object other)
        +
        Determine if two JSONArrays are similar. + They must contain similar sequences.
        +
        +
        Parameters:
        +
        other - The other JSONArray
        +
        Returns:
        +
        true if they are equal
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public JSONObject toJSONObject(JSONArray names)
        +                        throws JSONException
        +
        Produce a JSONObject by combining a JSONArray of names with the values of + this JSONArray.
        +
        +
        Parameters:
        +
        names - A JSONArray containing a list of key strings. These will be + paired with the values.
        +
        Returns:
        +
        A JSONObject, or null if there are no names or if this JSONArray + has no values.
        +
        Throws:
        +
        JSONException - If any of the names are null.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Make a JSON text of this JSONArray. For compactness, no unnecessary + whitespace is added. If it is not possible to produce a syntactically + correct JSON text then null will be returned instead. This could occur if + the array contains an invalid number. +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a printable, displayable, transmittable representation of the + array.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString(int indentFactor)
        +                throws JSONException
        +
        Make a pretty-printed JSON text of this JSONArray. + +

        If

          indentFactor > 0
        and the JSONArray has only + one element, then the array will be output on a single line: +
         [1]
        + +

        If an array has 2 or more elements, then it will be output across + multiple lines:

        
        + [
        + 1,
        + "value 2",
        + 3
        + ]
        + 
        +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Parameters:
        +
        indentFactor - The number of spaces to add to each level of indentation.
        +
        Returns:
        +
        a printable, displayable, transmittable representation of the + object, beginning with [ (left + bracket) and ending with ] +  (right bracket).
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        write

        +
        public Writer write(Writer writer)
        +             throws JSONException
        +
        Write the contents of the JSONArray as JSON text to a writer. For + compactness, no whitespace is added. +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Parameters:
        +
        writer - the writer object
        +
        Returns:
        +
        The writer.
        +
        Throws:
        +
        JSONException - if a called function fails
        +
        +
      • +
      + + + +
        +
      • +

        write

        +
        public Writer write(Writer writer,
        +                    int indentFactor,
        +                    int indent)
        +             throws JSONException
        +
        Write the contents of the JSONArray as JSON text to a writer. + +

        If

         indentFactor > 0
        and the JSONArray has only + one element, then the array will be output on a single line: +
         [1]
        + +

        If an array has 2 or more elements, then it will be output across + multiple lines:

        
        + [
        + 1,
        + "value 2",
        + 3
        + ]
        + 
        +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Parameters:
        +
        writer - Writes the serialized JSON
        +
        indentFactor - The number of spaces to add to each level of indentation.
        +
        indent - The indentation of the top level.
        +
        Returns:
        +
        The writer.
        +
        Throws:
        +
        JSONException - if a called function fails or unable to write
        +
        +
      • +
      + + + +
        +
      • +

        toList

        +
        public List<Object> toList()
        +
        Returns a java.util.List containing all of the elements in this array. + If an element in the array is a JSONArray or JSONObject it will also + be converted to a List and a Map respectively. +

        + Warning: This method assumes that the data structure is acyclical.

        +
        +
        Returns:
        +
        a java.util.List containing the elements of this array
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Check if JSONArray is empty.
        +
        +
        Returns:
        +
        true if JSONArray is empty, otherwise false.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONException.html b/docs/org/json/JSONException.html similarity index 53% rename from org/json/JSONException.html rename to docs/org/json/JSONException.html index 3b4c095..0a9db66 100644 --- a/org/json/JSONException.html +++ b/docs/org/json/JSONException.html @@ -1,320 +1,316 @@ - - - - - - -JSONException (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONException

-
-
- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable
    -
    -
    -
    -
    public class JSONException
    -extends java.lang.RuntimeException
    -
    The JSONException is thrown by the JSON.org classes when things are amiss.
    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    See Also:
    -
    Serialized Form
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - - - - - - - -
      Constructors 
      Constructor and Description
      JSONException(java.lang.String message) -
      Constructs a JSONException with an explanatory message.
      -
      JSONException(java.lang.String message, - java.lang.Throwable cause) -
      Constructs a JSONException with an explanatory message and cause.
      -
      JSONException(java.lang.Throwable cause) -
      Constructs a new JSONException with the specified cause.
      -
      -
    • -
    - -
      -
    • - - -

      Method Summary

      -
        -
      • - - -

        Methods inherited from class java.lang.Throwable

        -addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONException

        -
        public JSONException(java.lang.String message)
        -
        Constructs a JSONException with an explanatory message.
        -
        -
        Parameters:
        -
        message - Detail about the reason for the exception.
        -
        -
      • -
      - - - -
        -
      • -

        JSONException

        -
        public JSONException(java.lang.String message,
        -                     java.lang.Throwable cause)
        -
        Constructs a JSONException with an explanatory message and cause.
        -
        -
        Parameters:
        -
        message - Detail about the reason for the exception.
        -
        cause - The cause.
        -
        -
      • -
      - - - -
        -
      • -

        JSONException

        -
        public JSONException(java.lang.Throwable cause)
        -
        Constructs a new JSONException with the specified cause.
        -
        -
        Parameters:
        -
        cause - The cause.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONException + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONException

        +
        public JSONException(String message)
        +
        Constructs a JSONException with an explanatory message.
        +
        +
        Parameters:
        +
        message - Detail about the reason for the exception.
        +
        +
      • +
      + + + +
        +
      • +

        JSONException

        +
        public JSONException(String message,
        +                     Throwable cause)
        +
        Constructs a JSONException with an explanatory message and cause.
        +
        +
        Parameters:
        +
        message - Detail about the reason for the exception.
        +
        cause - The cause.
        +
        +
      • +
      + + + +
        +
      • +

        JSONException

        +
        public JSONException(Throwable cause)
        +
        Constructs a new JSONException with the specified cause.
        +
        +
        Parameters:
        +
        cause - The cause.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONML.html b/docs/org/json/JSONML.html similarity index 51% rename from org/json/JSONML.html rename to docs/org/json/JSONML.html index 48af638..a91934a 100644 --- a/org/json/JSONML.html +++ b/docs/org/json/JSONML.html @@ -1,450 +1,592 @@ - - - - - - -JSONML (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONML

-
-
- -
-
    -
  • -
    -
    -
    public class JSONML
    -extends java.lang.Object
    -
    This provides static methods to convert an XML text into a JSONArray or - JSONObject, and to covert a JSONArray or JSONObject into an XML text using - the JsonML transform.
    -
    -
    Version:
    -
    2016-01-30
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      JSONML() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static JSONArraytoJSONArray(java.lang.String string) -
      Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform.
      -
      static JSONArraytoJSONArray(XMLTokener x) -
      Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform.
      -
      static JSONObjecttoJSONObject(java.lang.String string) -
      Convert a well-formed (but not necessarily valid) XML string into a - JSONObject using the JsonML transform.
      -
      static JSONObjecttoJSONObject(XMLTokener x) -
      Convert a well-formed (but not necessarily valid) XML string into a - JSONObject using the JsonML transform.
      -
      static java.lang.StringtoString(JSONArray ja) -
      Reverse the JSONML transformation, making an XML text from a JSONArray.
      -
      static java.lang.StringtoString(JSONObject jo) -
      Reverse the JSONML transformation, making an XML text from a JSONObject.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONML

        -
        public JSONML()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        toJSONArray

        -
        public static JSONArray toJSONArray(java.lang.String string)
        -                             throws JSONException
        -
        Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform. Each XML tag is represented as - a JSONArray in which the first element is the tag name. If the tag has - attributes, then the second element will be JSONObject containing the - name/value pairs. If the tag contains children, then strings and - JSONArrays will represent the child tags. - Comments, prologs, DTDs, and <[ [ ]]> are ignored.
        -
        -
        Parameters:
        -
        string - The source string.
        -
        Returns:
        -
        A JSONArray containing the structured data from the XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toJSONArray

        -
        public static JSONArray toJSONArray(XMLTokener x)
        -                             throws JSONException
        -
        Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform. Each XML tag is represented as - a JSONArray in which the first element is the tag name. If the tag has - attributes, then the second element will be JSONObject containing the - name/value pairs. If the tag contains children, then strings and - JSONArrays will represent the child content and tags. - Comments, prologs, DTDs, and <[ [ ]]> are ignored.
        -
        -
        Parameters:
        -
        x - An XMLTokener.
        -
        Returns:
        -
        A JSONArray containing the structured data from the XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(XMLTokener x)
        -                               throws JSONException
        -
        Convert a well-formed (but not necessarily valid) XML string into a - JSONObject using the JsonML transform. Each XML tag is represented as - a JSONObject with a "tagName" property. If the tag has attributes, then - the attributes will be in the JSONObject as properties. If the tag - contains children, the object will have a "childNodes" property which - will be an array of strings and JsonML JSONObjects. - - Comments, prologs, DTDs, and <[ [ ]]> are ignored.
        -
        -
        Parameters:
        -
        x - An XMLTokener of the XML source text.
        -
        Returns:
        -
        A JSONObject containing the structured data from the XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(java.lang.String string)
        -                               throws JSONException
        -
        Convert a well-formed (but not necessarily valid) XML string into a - JSONObject using the JsonML transform. Each XML tag is represented as - a JSONObject with a "tagName" property. If the tag has attributes, then - the attributes will be in the JSONObject as properties. If the tag - contains children, the object will have a "childNodes" property which - will be an array of strings and JsonML JSONObjects. - - Comments, prologs, DTDs, and <[ [ ]]> are ignored.
        -
        -
        Parameters:
        -
        string - The XML source text.
        -
        Returns:
        -
        A JSONObject containing the structured data from the XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONArray ja)
        -                                 throws JSONException
        -
        Reverse the JSONML transformation, making an XML text from a JSONArray.
        -
        -
        Parameters:
        -
        ja - A JSONArray.
        -
        Returns:
        -
        An XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(JSONObject jo)
        -                                 throws JSONException
        -
        Reverse the JSONML transformation, making an XML text from a JSONObject. - The JSONObject must contain a "tagName" property. If it has children, - then it must have a "childNodes" property containing an array of objects. - The other properties are attributes with string values.
        -
        -
        Parameters:
        -
        jo - A JSONObject.
        -
        Returns:
        -
        An XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONML + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONML

+
+
+ +
+
    +
  • +
    +
    +
    public class JSONML
    +extends Object
    +
    This provides static methods to convert an XML text into a JSONArray or + JSONObject, and to covert a JSONArray or JSONObject into an XML text using + the JsonML transform.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      JSONML() 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONML

        +
        public JSONML()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(String string)
        +                             throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform. Each XML tag is represented as + a JSONArray in which the first element is the tag name. If the tag has + attributes, then the second element will be JSONObject containing the + name/value pairs. If the tag contains children, then strings and + JSONArrays will represent the child tags. + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        string - The source string.
        +
        Returns:
        +
        A JSONArray containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONArray
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(String string,
        +                                    boolean keepStrings)
        +                             throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform. Each XML tag is represented as + a JSONArray in which the first element is the tag name. If the tag has + attributes, then the second element will be JSONObject containing the + name/value pairs. If the tag contains children, then strings and + JSONArrays will represent the child tags. + As opposed to toJSONArray this method does not attempt to convert + any text node or attribute value to any type + but just leaves it as a string. + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        string - The source string.
        +
        keepStrings - If true, then values will not be coerced into boolean + or numeric values and will instead be left as strings
        +
        Returns:
        +
        A JSONArray containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONArray
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(XMLTokener x,
        +                                    boolean keepStrings)
        +                             throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform. Each XML tag is represented as + a JSONArray in which the first element is the tag name. If the tag has + attributes, then the second element will be JSONObject containing the + name/value pairs. If the tag contains children, then strings and + JSONArrays will represent the child content and tags. + As opposed to toJSONArray this method does not attempt to convert + any text node or attribute value to any type + but just leaves it as a string. + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        x - An XMLTokener.
        +
        keepStrings - If true, then values will not be coerced into boolean + or numeric values and will instead be left as strings
        +
        Returns:
        +
        A JSONArray containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONArray
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public static JSONArray toJSONArray(XMLTokener x)
        +                             throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONArray using the JsonML transform. Each XML tag is represented as + a JSONArray in which the first element is the tag name. If the tag has + attributes, then the second element will be JSONObject containing the + name/value pairs. If the tag contains children, then strings and + JSONArrays will represent the child content and tags. + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        x - An XMLTokener.
        +
        Returns:
        +
        A JSONArray containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONArray
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform. Each XML tag is represented as + a JSONObject with a "tagName" property. If the tag has attributes, then + the attributes will be in the JSONObject as properties. If the tag + contains children, the object will have a "childNodes" property which + will be an array of strings and JsonML JSONObjects. + + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        string - The XML source text.
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONObject
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string,
        +                                      boolean keepStrings)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform. Each XML tag is represented as + a JSONObject with a "tagName" property. If the tag has attributes, then + the attributes will be in the JSONObject as properties. If the tag + contains children, the object will have a "childNodes" property which + will be an array of strings and JsonML JSONObjects. + + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        string - The XML source text.
        +
        keepStrings - If true, then values will not be coerced into boolean + or numeric values and will instead be left as strings
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONObject
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(XMLTokener x)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform. Each XML tag is represented as + a JSONObject with a "tagName" property. If the tag has attributes, then + the attributes will be in the JSONObject as properties. If the tag + contains children, the object will have a "childNodes" property which + will be an array of strings and JsonML JSONObjects. + + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        x - An XMLTokener of the XML source text.
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONObject
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(XMLTokener x,
        +                                      boolean keepStrings)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject using the JsonML transform. Each XML tag is represented as + a JSONObject with a "tagName" property. If the tag has attributes, then + the attributes will be in the JSONObject as properties. If the tag + contains children, the object will have a "childNodes" property which + will be an array of strings and JsonML JSONObjects. + + Comments, prologs, DTDs, and
         &lt;[ [ ]]>
        are ignored.
        +
        +
        Parameters:
        +
        x - An XMLTokener of the XML source text.
        +
        keepStrings - If true, then values will not be coerced into boolean + or numeric values and will instead be left as strings
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a JSONObject
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONArray ja)
        +                       throws JSONException
        +
        Reverse the JSONML transformation, making an XML text from a JSONArray.
        +
        +
        Parameters:
        +
        ja - A JSONArray.
        +
        Returns:
        +
        An XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a string
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(JSONObject jo)
        +                       throws JSONException
        +
        Reverse the JSONML transformation, making an XML text from a JSONObject. + The JSONObject must contain a "tagName" property. If it has children, + then it must have a "childNodes" property containing an array of objects. + The other properties are attributes with string values.
        +
        +
        Parameters:
        +
        jo - A JSONObject.
        +
        Returns:
        +
        An XML string.
        +
        Throws:
        +
        JSONException - Thrown on error converting to a string
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/JSONObject.html b/docs/org/json/JSONObject.html new file mode 100644 index 0000000..ac070d8 --- /dev/null +++ b/docs/org/json/JSONObject.html @@ -0,0 +1,2755 @@ + + + + + +JSONObject + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONObject

+
+
+ +
+
    +
  • +
    +
    +
    public class JSONObject
    +extends Object
    +
    A JSONObject is an unordered collection of name/value pairs. Its external + form is a string wrapped in curly braces with colons between the names and + values, and commas between the values and names. The internal form is an + object having get and opt methods for accessing + the values by name, and put methods for adding or replacing + values by name. The values can be any of these types: Boolean, + JSONArray, JSONObject, Number, + String, or the JSONObject.NULL object. A + JSONObject constructor can be used to convert an external form JSON text + into an internal form whose values can be retrieved with the + get and opt methods, or to convert values into a + JSON text using the put and toString methods. A + get method returns a value if one can be found, and throws an + exception if one cannot be found. An opt method returns a + default value instead of throwing an exception, and so is useful for + obtaining optional values. +

    + The generic get() and opt() methods return an + object, which you can cast or query for type. There are also typed + get and opt methods that do type checking and type + coercion for you. The opt methods differ from the get methods in that they + do not throw. Instead, they return a specified value, such as null. +

    + The put methods add or replace values in an object. For + example, + +

    + myString = new JSONObject()
    +         .put("JSON", "Hello, World!").toString();
    + 
    + + produces the string {"JSON": "Hello, World"}. +

    + The texts produced by the toString methods strictly conform to + the JSON syntax rules. The constructors are more forgiving in the texts they + will accept: +

      +
    • An extra , (comma) may appear just + before the closing brace.
    • +
    • Strings may be quoted with ' (single + quote).
    • +
    • Strings do not need to be quoted at all if they do not begin with a + quote or single quote, and if they do not contain leading or trailing + spaces, and if they do not contain any of these characters: + { } [ ] / \ : , # and if they do not look like numbers and + if they are not the reserved words true, false, + or null.
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static ObjectNULL +
      It is sometimes more convenient and less ambiguous to have a + NULL object than to use Java's null value.
      +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ModifierConstructor and Description
       JSONObject() +
      Construct an empty JSONObject.
      +
      protected JSONObject(int initialCapacity) +
      Constructor to specify an initial capacity of the internal map.
      +
       JSONObject(JSONObject jo, + String... names) +
      Construct a JSONObject from a subset of another JSONObject.
      +
       JSONObject(JSONTokener x) +
      Construct a JSONObject from a JSONTokener.
      +
       JSONObject(Map<?,?> m) +
      Construct a JSONObject from a Map.
      +
       JSONObject(Object bean) +
      Construct a JSONObject from an Object using bean getters.
      +
       JSONObject(Object object, + String... names) +
      Construct a JSONObject from an Object, using reflection to find the + public members.
      +
       JSONObject(String source) +
      Construct a JSONObject from a source JSON text string.
      +
       JSONObject(String baseName, + Locale locale) +
      Construct a JSONObject from a ResourceBundle.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      JSONObjectaccumulate(String key, + Object value) +
      Accumulate values under a key.
      +
      JSONObjectappend(String key, + Object value) +
      Append values to the array under a key.
      +
      static StringdoubleToString(double d) +
      Produce a string from a double.
      +
      protected Set<Map.Entry<String,Object>>entrySet() +
      Get a set of entries of the JSONObject.
      +
      Objectget(String key) +
      Get the value object associated with a key.
      +
      BigDecimalgetBigDecimal(String key) +
      Get the BigDecimal value associated with a key.
      +
      BigIntegergetBigInteger(String key) +
      Get the BigInteger value associated with a key.
      +
      booleangetBoolean(String key) +
      Get the boolean value associated with a key.
      +
      doublegetDouble(String key) +
      Get the double value associated with a key.
      +
      <E extends Enum<E>>
      E
      getEnum(Class<E> clazz, + String key) +
      Get the enum value associated with a key.
      +
      floatgetFloat(String key) +
      Get the float value associated with a key.
      +
      intgetInt(String key) +
      Get the int value associated with a key.
      +
      JSONArraygetJSONArray(String key) +
      Get the JSONArray value associated with a key.
      +
      JSONObjectgetJSONObject(String key) +
      Get the JSONObject value associated with a key.
      +
      longgetLong(String key) +
      Get the long value associated with a key.
      +
      static String[]getNames(JSONObject jo) +
      Get an array of field names from a JSONObject.
      +
      static String[]getNames(Object object) +
      Get an array of public field names from an Object.
      +
      NumbergetNumber(String key) +
      Get the Number value associated with a key.
      +
      StringgetString(String key) +
      Get the string associated with a key.
      +
      booleanhas(String key) +
      Determine if the JSONObject contains a specific key.
      +
      JSONObjectincrement(String key) +
      Increment a property of a JSONObject.
      +
      protected static booleanisDecimalNotation(String val) +
      Tests if the value should be tried as a decimal.
      +
      booleanisEmpty() +
      Check if JSONObject is empty.
      +
      booleanisNull(String key) +
      Determine if the value associated with the key is null or if there is no + value.
      +
      Iterator<String>keys() +
      Get an enumeration of the keys of the JSONObject.
      +
      Set<String>keySet() +
      Get a set of keys of the JSONObject.
      +
      intlength() +
      Get the number of keys stored in the JSONObject.
      +
      JSONArraynames() +
      Produce a JSONArray containing the names of the elements of this + JSONObject.
      +
      static StringnumberToString(Number number) +
      Produce a string from a Number.
      +
      Objectopt(String key) +
      Get an optional value associated with a key.
      +
      BigDecimaloptBigDecimal(String key, + BigDecimal defaultValue) +
      Get an optional BigDecimal associated with a key, or the defaultValue if + there is no such key or if its value is not a number.
      +
      BigIntegeroptBigInteger(String key, + BigInteger defaultValue) +
      Get an optional BigInteger associated with a key, or the defaultValue if + there is no such key or if its value is not a number.
      +
      booleanoptBoolean(String key) +
      Get an optional boolean associated with a key.
      +
      booleanoptBoolean(String key, + boolean defaultValue) +
      Get an optional boolean associated with a key.
      +
      doubleoptDouble(String key) +
      Get an optional double associated with a key, or NaN if there is no such + key or if its value is not a number.
      +
      doubleoptDouble(String key, + double defaultValue) +
      Get an optional double associated with a key, or the defaultValue if + there is no such key or if its value is not a number.
      +
      <E extends Enum<E>>
      E
      optEnum(Class<E> clazz, + String key) +
      Get the enum value associated with a key.
      +
      <E extends Enum<E>>
      E
      optEnum(Class<E> clazz, + String key, + E defaultValue) +
      Get the enum value associated with a key.
      +
      floatoptFloat(String key) +
      Get the optional double value associated with an index.
      +
      floatoptFloat(String key, + float defaultValue) +
      Get the optional double value associated with an index.
      +
      intoptInt(String key) +
      Get an optional int value associated with a key, or zero if there is no + such key or if the value is not a number.
      +
      intoptInt(String key, + int defaultValue) +
      Get an optional int value associated with a key, or the default if there + is no such key or if the value is not a number.
      +
      JSONArrayoptJSONArray(String key) +
      Get an optional JSONArray associated with a key.
      +
      JSONObjectoptJSONObject(String key) +
      Get an optional JSONObject associated with a key.
      +
      longoptLong(String key) +
      Get an optional long value associated with a key, or zero if there is no + such key or if the value is not a number.
      +
      longoptLong(String key, + long defaultValue) +
      Get an optional long value associated with a key, or the default if there + is no such key or if the value is not a number.
      +
      NumberoptNumber(String key) +
      Get an optional Number value associated with a key, or null + if there is no such key or if the value is not a number.
      +
      NumberoptNumber(String key, + Number defaultValue) +
      Get an optional Number value associated with a key, or the default if there + is no such key or if the value is not a number.
      +
      ObjectoptQuery(JSONPointer jsonPointer) +
      Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
      +
      ObjectoptQuery(String jsonPointer) +
      Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
      +
      StringoptString(String key) +
      Get an optional string associated with a key.
      +
      StringoptString(String key, + String defaultValue) +
      Get an optional string associated with a key.
      +
      JSONObjectput(String key, + boolean value) +
      Put a key/boolean pair in the JSONObject.
      +
      JSONObjectput(String key, + Collection<?> value) +
      Put a key/value pair in the JSONObject, where the value will be a + JSONArray which is produced from a Collection.
      +
      JSONObjectput(String key, + double value) +
      Put a key/double pair in the JSONObject.
      +
      JSONObjectput(String key, + float value) +
      Put a key/float pair in the JSONObject.
      +
      JSONObjectput(String key, + int value) +
      Put a key/int pair in the JSONObject.
      +
      JSONObjectput(String key, + long value) +
      Put a key/long pair in the JSONObject.
      +
      JSONObjectput(String key, + Map<?,?> value) +
      Put a key/value pair in the JSONObject, where the value will be a + JSONObject which is produced from a Map.
      +
      JSONObjectput(String key, + Object value) +
      Put a key/value pair in the JSONObject.
      +
      JSONObjectputOnce(String key, + Object value) +
      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.
      +
      JSONObjectputOpt(String key, + Object value) +
      Put a key/value pair in the JSONObject, but only if the key and the value + are both non-null.
      +
      Objectquery(JSONPointer jsonPointer) +
      Uses a user initialized JSONPointer and tries to + match it to an item within this JSONObject.
      +
      Objectquery(String jsonPointer) +
      Creates a JSONPointer using an initialization string and tries to + match it to an item within this JSONObject.
      +
      static Stringquote(String string) +
      Produce a string in double quotes with backslash sequences in all the + right places.
      +
      static Writerquote(String string, + Writer w) 
      Objectremove(String key) +
      Remove a name and its value, if present.
      +
      booleansimilar(Object other) +
      Determine if two JSONObjects are similar.
      +
      protected static NumberstringToNumber(String val) +
      Converts a string to a number using the narrowest possible type.
      +
      static ObjectstringToValue(String string) +
      Try to convert a string into a number, boolean, or null.
      +
      static voidtestValidity(Object o) +
      Throw an exception if the object is a NaN or infinite number.
      +
      JSONArraytoJSONArray(JSONArray names) +
      Produce a JSONArray containing the values of the members of this + JSONObject.
      +
      Map<String,Object>toMap() +
      Returns a java.util.Map containing all of the entries in this object.
      +
      StringtoString() +
      Make a JSON text of this JSONObject.
      +
      StringtoString(int indentFactor) +
      Make a pretty-printed JSON text of this JSONObject.
      +
      static StringvalueToString(Object value) +
      Make a JSON text of an Object value.
      +
      static Objectwrap(Object object) +
      Wrap an object, if necessary.
      +
      Writerwrite(Writer writer) +
      Write the contents of the JSONObject as JSON text to a writer.
      +
      Writerwrite(Writer writer, + int indentFactor, + int indent) +
      Write the contents of the JSONObject as JSON text to a writer.
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        NULL

        +
        public static final Object NULL
        +
        It is sometimes more convenient and less ambiguous to have a + NULL object than to use Java's null value. + JSONObject.NULL.equals(null) returns true. + JSONObject.NULL.toString() returns "null".
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject()
        +
        Construct an empty JSONObject.
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(JSONObject jo,
        +                  String... names)
        +
        Construct a JSONObject from a subset of another JSONObject. An array of + strings is used to identify the keys that should be copied. Missing keys + are ignored.
        +
        +
        Parameters:
        +
        jo - A JSONObject.
        +
        names - An array of strings.
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(JSONTokener x)
        +           throws JSONException
        +
        Construct a JSONObject from a JSONTokener.
        +
        +
        Parameters:
        +
        x - A JSONTokener object containing the source string.
        +
        Throws:
        +
        JSONException - If there is a syntax error in the source string or a + duplicated key.
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(Map<?,?> m)
        +
        Construct a JSONObject from a Map.
        +
        +
        Parameters:
        +
        m - A map object that can be used to initialize the contents of + the JSONObject.
        +
        Throws:
        +
        JSONException - If a value in the map is non-finite number.
        +
        NullPointerException - If a key in the map is null
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(Object bean)
        +
        Construct a JSONObject from an Object using bean getters. It reflects on + all of the public methods of the object. For each of the methods with no + parameters and a name starting with "get" or + "is" followed by an uppercase letter, the method is invoked, + and a key and the value returned from the getter method are put into the + new JSONObject. +

        + The key is formed by removing the "get" or "is" + prefix. If the second remaining character is not upper case, then the + first character is converted to lower case. +

        + Methods that are static, return void, + have parameters, or are "bridge" methods, are ignored. +

        + For example, if an object has a method named "getName", and + if the result of calling object.getName() is + "Larry Fine", then the JSONObject will contain + "name": "Larry Fine". +

        + The JSONPropertyName annotation can be used on a bean getter to + override key name used in the JSONObject. For example, using the object + above with the getName method, if we annotated it with: +

        + @JSONPropertyName("FullName")
        + public String getName() { return this.name; }
        + 
        + The resulting JSON object would contain "FullName": "Larry Fine" +

        + Similarly, the JSONPropertyName annotation can be used on non- + get and is methods. We can also override key + name used in the JSONObject as seen below even though the field would normally + be ignored: +

        + @JSONPropertyName("FullName")
        + public String fullName() { return this.name; }
        + 
        + The resulting JSON object would contain "FullName": "Larry Fine" +

        + The JSONPropertyIgnore annotation can be used to force the bean property + to not be serialized into JSON. If both JSONPropertyIgnore and + JSONPropertyName are defined on the same method, a depth comparison is + performed and the one closest to the concrete class being serialized is used. + If both annotations are at the same level, then the JSONPropertyIgnore + annotation takes precedent and the field is not serialized. + For example, the following declaration would prevent the getName + method from being serialized: +

        + @JSONPropertyName("FullName")
        + @JSONPropertyIgnore 
        + public String getName() { return this.name; }
        + 
        +

        +
        +
        Parameters:
        +
        bean - An object that has getter methods that should be used to make + a JSONObject.
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(Object object,
        +                  String... names)
        +
        Construct a JSONObject from an Object, using reflection to find the + public members. The resulting JSONObject's keys will be the strings from + the names array, and the values will be the field values associated with + those keys in the object. If a key is not found or not visible, then it + will not be copied into the new JSONObject.
        +
        +
        Parameters:
        +
        object - An object that has fields that should be used to make a + JSONObject.
        +
        names - An array of strings, the names of the fields to be obtained + from the object.
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(String source)
        +           throws JSONException
        +
        Construct a JSONObject from a source JSON text string. This is the most + commonly used JSONObject constructor.
        +
        +
        Parameters:
        +
        source - A string beginning with { (left + brace) and ending with } +  (right brace).
        +
        Throws:
        +
        JSONException - If there is a syntax error in the source string or a + duplicated key.
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(String baseName,
        +                  Locale locale)
        +           throws JSONException
        +
        Construct a JSONObject from a ResourceBundle.
        +
        +
        Parameters:
        +
        baseName - The ResourceBundle base name.
        +
        locale - The Locale to load the ResourceBundle for.
        +
        Throws:
        +
        JSONException - If any JSONExceptions are detected.
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        protected JSONObject(int initialCapacity)
        +
        Constructor to specify an initial capacity of the internal map. Useful for library + internal calls where we know, or at least can best guess, how big this JSONObject + will be.
        +
        +
        Parameters:
        +
        initialCapacity - initial capacity of the internal map.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        accumulate

        +
        public JSONObject accumulate(String key,
        +                             Object value)
        +                      throws JSONException
        +
        Accumulate values under a key. It is similar to the put method except + that if there is already an object stored under the key then a JSONArray + is stored under the key to hold all of the accumulated values. If there + is already a JSONArray, then the new value is appended to it. In + contrast, the put method replaces the previous value. + + If only one value is accumulated that is not a JSONArray, then the result + will be the same as using put. But if multiple values are accumulated, + then the result will be like append.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - An object to be accumulated under the key.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        append

        +
        public JSONObject append(String key,
        +                         Object value)
        +                  throws JSONException
        +
        Append values to the array under a key. If the key does not exist in the + JSONObject, then the key is put in the JSONObject with its value being a + JSONArray containing the value parameter. If the key was already + associated with a JSONArray, then the value parameter is appended to it.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - An object to be accumulated under the key.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number or if the current value associated with + the key is not a JSONArray.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        doubleToString

        +
        public static String doubleToString(double d)
        +
        Produce a string from a double. The string "null" will be returned if the + number is not finite.
        +
        +
        Parameters:
        +
        d - A double.
        +
        Returns:
        +
        A String.
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public Object get(String key)
        +           throws JSONException
        +
        Get the value object associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The object associated with the key.
        +
        Throws:
        +
        JSONException - if the key is not found.
        +
        +
      • +
      + + + +
        +
      • +

        getEnum

        +
        public <E extends Enum<E>> E getEnum(Class<E> clazz,
        +                                     String key)
        +                              throws JSONException
        +
        Get the enum value associated with a key.
        +
        +
        Type Parameters:
        +
        E - Enum Type
        +
        Parameters:
        +
        clazz - The type of enum to retrieve.
        +
        key - A key string.
        +
        Returns:
        +
        The enum value associated with the key
        +
        Throws:
        +
        JSONException - if the key is not found or if the value cannot be converted + to an enum.
        +
        +
      • +
      + + + +
        +
      • +

        getBoolean

        +
        public boolean getBoolean(String key)
        +                   throws JSONException
        +
        Get the boolean value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The truth.
        +
        Throws:
        +
        JSONException - if the value is not a Boolean or the String "true" or + "false".
        +
        +
      • +
      + + + +
        +
      • +

        getBigInteger

        +
        public BigInteger getBigInteger(String key)
        +                         throws JSONException
        +
        Get the BigInteger value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value cannot + be converted to BigInteger.
        +
        +
      • +
      + + + +
        +
      • +

        getBigDecimal

        +
        public BigDecimal getBigDecimal(String key)
        +                         throws JSONException
        +
        Get the BigDecimal value associated with a key. If the value is float or + double, the the BigDecimal.BigDecimal(double) constructor will + be used. See notes on the constructor for conversion issues that may + arise.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value + cannot be converted to BigDecimal.
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble(String key)
        +                 throws JSONException
        +
        Get the double value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a Number + object and cannot be converted to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public float getFloat(String key)
        +               throws JSONException
        +
        Get the float value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a Number + object and cannot be converted to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getNumber

        +
        public Number getNumber(String key)
        +                 throws JSONException
        +
        Get the Number value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The numeric value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a Number + object and cannot be converted to a number.
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt(String key)
        +           throws JSONException
        +
        Get the int value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The integer value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value cannot be converted + to an integer.
        +
        +
      • +
      + + + +
        +
      • +

        getJSONArray

        +
        public JSONArray getJSONArray(String key)
        +                       throws JSONException
        +
        Get the JSONArray value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        A JSONArray which is the value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a JSONArray.
        +
        +
      • +
      + + + +
        +
      • +

        getJSONObject

        +
        public JSONObject getJSONObject(String key)
        +                         throws JSONException
        +
        Get the JSONObject value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        A JSONObject which is the value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value is not a JSONObject.
        +
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        public long getLong(String key)
        +             throws JSONException
        +
        Get the long value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The long value.
        +
        Throws:
        +
        JSONException - if the key is not found or if the value cannot be converted + to a long.
        +
        +
      • +
      + + + +
        +
      • +

        getNames

        +
        public static String[] getNames(JSONObject jo)
        +
        Get an array of field names from a JSONObject.
        +
        +
        Parameters:
        +
        jo - JSON object
        +
        Returns:
        +
        An array of field names, or null if there are no names.
        +
        +
      • +
      + + + +
        +
      • +

        getNames

        +
        public static String[] getNames(Object object)
        +
        Get an array of public field names from an Object.
        +
        +
        Parameters:
        +
        object - object to read
        +
        Returns:
        +
        An array of field names, or null if there are no names.
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public String getString(String key)
        +                 throws JSONException
        +
        Get the string associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        A string which is the value.
        +
        Throws:
        +
        JSONException - if there is no string value for the key.
        +
        +
      • +
      + + + +
        +
      • +

        has

        +
        public boolean has(String key)
        +
        Determine if the JSONObject contains a specific key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        true if the key exists in the JSONObject.
        +
        +
      • +
      + + + +
        +
      • +

        increment

        +
        public JSONObject increment(String key)
        +                     throws JSONException
        +
        Increment a property of a JSONObject. If there is no such property, + create one with a value of 1 (Integer). If there is such a property, and if it is + an Integer, Long, Double, Float, BigInteger, or BigDecimal then add one to it. + No overflow bounds checking is performed, so callers should initialize the key + prior to this call with an appropriate type that can handle the maximum expected + value.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If there is already a property with this name that is not an + Integer, Long, Double, or Float.
        +
        +
      • +
      + + + +
        +
      • +

        isNull

        +
        public boolean isNull(String key)
        +
        Determine if the value associated with the key is null or if there is no + value.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        true if there is no value associated with the key or if the value + is the JSONObject.NULL object.
        +
        +
      • +
      + + + +
        +
      • +

        keys

        +
        public Iterator<String> keys()
        +
        Get an enumeration of the keys of the JSONObject. Modifying this key Set will also + modify the JSONObject. Use with caution.
        +
        +
        Returns:
        +
        An iterator of the keys.
        +
        See Also:
        +
        Set.iterator()
        +
        +
      • +
      + + + +
        +
      • +

        keySet

        +
        public Set<String> keySet()
        +
        Get a set of keys of the JSONObject. Modifying this key Set will also modify the + JSONObject. Use with caution.
        +
        +
        Returns:
        +
        A keySet.
        +
        See Also:
        +
        Map.keySet()
        +
        +
      • +
      + + + +
        +
      • +

        entrySet

        +
        protected Set<Map.Entry<String,Object>> entrySet()
        +
        Get a set of entries of the JSONObject. These are raw values and may not + match what is returned by the JSONObject get* and opt* functions. Modifying + the returned EntrySet or the Entry objects contained therein will modify the + backing JSONObject. This does not return a clone or a read-only view. + + Use with caution.
        +
        +
        Returns:
        +
        An Entry Set
        +
        See Also:
        +
        Map.entrySet()
        +
        +
      • +
      + + + +
        +
      • +

        length

        +
        public int length()
        +
        Get the number of keys stored in the JSONObject.
        +
        +
        Returns:
        +
        The number of keys in the JSONObject.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        Check if JSONObject is empty.
        +
        +
        Returns:
        +
        true if JSONObject is empty, otherwise false.
        +
        +
      • +
      + + + +
        +
      • +

        names

        +
        public JSONArray names()
        +
        Produce a JSONArray containing the names of the elements of this + JSONObject.
        +
        +
        Returns:
        +
        A JSONArray containing the key strings, or null if the JSONObject + is empty.
        +
        +
      • +
      + + + +
        +
      • +

        numberToString

        +
        public static String numberToString(Number number)
        +                             throws JSONException
        +
        Produce a string from a Number.
        +
        +
        Parameters:
        +
        number - A Number
        +
        Returns:
        +
        A String.
        +
        Throws:
        +
        JSONException - If n is a non-finite number.
        +
        +
      • +
      + + + +
        +
      • +

        opt

        +
        public Object opt(String key)
        +
        Get an optional value associated with a key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        An object which is the value, or null if there is no value.
        +
        +
      • +
      + + + +
        +
      • +

        optEnum

        +
        public <E extends Enum<E>> E optEnum(Class<E> clazz,
        +                                     String key)
        +
        Get the enum value associated with a key.
        +
        +
        Type Parameters:
        +
        E - Enum Type
        +
        Parameters:
        +
        clazz - The type of enum to retrieve.
        +
        key - A key string.
        +
        Returns:
        +
        The enum value associated with the key or null if not found
        +
        +
      • +
      + + + + + +
        +
      • +

        optEnum

        +
        public <E extends Enum<E>> E optEnum(Class<E> clazz,
        +                                     String key,
        +                                     E defaultValue)
        +
        Get the enum value associated with a key.
        +
        +
        Type Parameters:
        +
        E - Enum Type
        +
        Parameters:
        +
        clazz - The type of enum to retrieve.
        +
        key - A key string.
        +
        defaultValue - The default in case the value is not found
        +
        Returns:
        +
        The enum value associated with the key or defaultValue + if the value is not found or cannot be assigned to clazz
        +
        +
      • +
      + + + +
        +
      • +

        optBoolean

        +
        public boolean optBoolean(String key)
        +
        Get an optional boolean associated with a key. It returns false if there + is no such key, or if the value is not Boolean.TRUE or the String "true".
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The truth.
        +
        +
      • +
      + + + +
        +
      • +

        optBoolean

        +
        public boolean optBoolean(String key,
        +                          boolean defaultValue)
        +
        Get an optional boolean associated with a key. It returns the + defaultValue if there is no such key, or if it is not a Boolean or the + String "true" or "false" (case insensitive).
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        The truth.
        +
        +
      • +
      + + + +
        +
      • +

        optBigDecimal

        +
        public BigDecimal optBigDecimal(String key,
        +                                BigDecimal defaultValue)
        +
        Get an optional BigDecimal associated with a key, or the defaultValue if + there is no such key or if its value is not a number. If the value is a + string, an attempt will be made to evaluate it as a number. If the value + is float or double, then the BigDecimal.BigDecimal(double) + constructor will be used. See notes on the constructor for conversion + issues that may arise.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optBigInteger

        +
        public BigInteger optBigInteger(String key,
        +                                BigInteger defaultValue)
        +
        Get an optional BigInteger associated with a key, or the defaultValue if + there is no such key or if its value is not a number. If the value is a + string, an attempt will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optDouble

        +
        public double optDouble(String key)
        +
        Get an optional double associated with a key, or NaN if there is no such + key or if its value is not a number. If the value is a string, an attempt + will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A string which is the key.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optDouble

        +
        public double optDouble(String key,
        +                        double defaultValue)
        +
        Get an optional double associated with a key, or the defaultValue if + there is no such key or if its value is not a number. If the value is a + string, an attempt will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optFloat

        +
        public float optFloat(String key)
        +
        Get the optional double value associated with an index. NaN is returned + if there is no value for the index, or if the value is not a number and + cannot be converted to a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optFloat

        +
        public float optFloat(String key,
        +                      float defaultValue)
        +
        Get the optional double value associated with an index. The defaultValue + is returned if there is no value for the index, or if the value is not a + number and cannot be converted to a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default value.
        +
        Returns:
        +
        The value.
        +
        +
      • +
      + + + +
        +
      • +

        optInt

        +
        public int optInt(String key)
        +
        Get an optional int value associated with a key, or zero if there is no + such key or if the value is not a number. If the value is a string, an + attempt will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optInt

        +
        public int optInt(String key,
        +                  int defaultValue)
        +
        Get an optional int value associated with a key, or the default if there + is no such key or if the value is not a number. If the value is a string, + an attempt will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optJSONArray

        +
        public JSONArray optJSONArray(String key)
        +
        Get an optional JSONArray associated with a key. It returns null if there + is no such key, or if its value is not a JSONArray.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        A JSONArray which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optJSONObject

        +
        public JSONObject optJSONObject(String key)
        +
        Get an optional JSONObject associated with a key. It returns null if + there is no such key, or if its value is not a JSONObject.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        A JSONObject which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optLong

        +
        public long optLong(String key)
        +
        Get an optional long value associated with a key, or zero if there is no + such key or if the value is not a number. If the value is a string, an + attempt will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optLong

        +
        public long optLong(String key,
        +                    long defaultValue)
        +
        Get an optional long value associated with a key, or the default if there + is no such key or if the value is not a number. If the value is a string, + an attempt will be made to evaluate it as a number.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optNumber

        +
        public Number optNumber(String key)
        +
        Get an optional Number value associated with a key, or null + if there is no such key or if the value is not a number. If the value is a string, + an attempt will be made to evaluate it as a number (BigDecimal). This method + would be used in cases where type coercion of the number value is unwanted.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optNumber

        +
        public Number optNumber(String key,
        +                        Number defaultValue)
        +
        Get an optional Number value associated with a key, or the default if there + is no such key or if the value is not a number. If the value is a string, + an attempt will be made to evaluate it as a number. This method + would be used in cases where type coercion of the number value is unwanted.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        An object which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optString

        +
        public String optString(String key)
        +
        Get an optional string associated with a key. It returns an empty string + if there is no such key. If the value is not a string and is not null, + then it is converted to a string.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        Returns:
        +
        A string which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        optString

        +
        public String optString(String key,
        +                        String defaultValue)
        +
        Get an optional string associated with a key. It returns the defaultValue + if there is no such key.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        defaultValue - The default.
        +
        Returns:
        +
        A string which is the value.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      boolean value)
        +               throws JSONException
        +
        Put a key/boolean pair in the JSONObject.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - A boolean which is the value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      Collection<?> value)
        +               throws JSONException
        +
        Put a key/value pair in the JSONObject, where the value will be a + JSONArray which is produced from a Collection.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - A Collection value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      double value)
        +               throws JSONException
        +
        Put a key/double pair in the JSONObject.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - A double which is the value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      float value)
        +               throws JSONException
        +
        Put a key/float pair in the JSONObject.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - A float which is the value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      int value)
        +               throws JSONException
        +
        Put a key/int pair in the JSONObject.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - An int which is the value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      long value)
        +               throws JSONException
        +
        Put a key/long pair in the JSONObject.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - A long which is the value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      Map<?,?> value)
        +               throws JSONException
        +
        Put a key/value pair in the JSONObject, where the value will be a + JSONObject which is produced from a Map.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - A Map value.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public JSONObject put(String key,
        +                      Object value)
        +               throws JSONException
        +
        Put a key/value pair in the JSONObject. If the value is null, then the + key will be removed from the JSONObject if it is present.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - An object which is the value. It should be of one of these + types: Boolean, Double, Integer, JSONArray, JSONObject, Long, + String, or the JSONObject.NULL object.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is non-finite number.
        +
        NullPointerException - If the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        putOnce

        +
        public JSONObject putOnce(String key,
        +                          Object value)
        +                   throws JSONException
        +
        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.
        +
        +
        Parameters:
        +
        key - key to insert into
        +
        value - value to insert
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - if the key is a duplicate
        +
        +
      • +
      + + + +
        +
      • +

        putOpt

        +
        public JSONObject putOpt(String key,
        +                         Object value)
        +                  throws JSONException
        +
        Put a key/value pair in the JSONObject, but only if the key and the value + are both non-null.
        +
        +
        Parameters:
        +
        key - A key string.
        +
        value - An object which is the value. It should be of one of these + types: Boolean, Double, Integer, JSONArray, JSONObject, Long, + String, or the JSONObject.NULL object.
        +
        Returns:
        +
        this.
        +
        Throws:
        +
        JSONException - If the value is a non-finite number.
        +
        +
      • +
      + + + +
        +
      • +

        query

        +
        public Object query(String jsonPointer)
        +
        Creates a JSONPointer using an initialization string and tries to + match it to an item within this JSONObject. For example, given a + JSONObject initialized with this document: +
        + {
        +     "a":{"b":"c"}
        + }
        + 
        + and this JSONPointer string: +
        + "/a/b"
        + 
        + Then this method will return the String "c". + A JSONPointerException may be thrown from code called by this method.
        +
        +
        Parameters:
        +
        jsonPointer - string that can be used to create a JSONPointer
        +
        Returns:
        +
        the item matched by the JSONPointer, otherwise null
        +
        +
      • +
      + + + +
        +
      • +

        query

        +
        public Object query(JSONPointer jsonPointer)
        +
        Uses a user initialized JSONPointer and tries to + match it to an item within this JSONObject. For example, given a + JSONObject initialized with this document: +
        + {
        +     "a":{"b":"c"}
        + }
        + 
        + and this JSONPointer: +
        + "/a/b"
        + 
        + Then this method will return the String "c". + A JSONPointerException may be thrown from code called by this method.
        +
        +
        Parameters:
        +
        jsonPointer - string that can be used to create a JSONPointer
        +
        Returns:
        +
        the item matched by the JSONPointer, otherwise null
        +
        +
      • +
      + + + +
        +
      • +

        optQuery

        +
        public Object optQuery(String jsonPointer)
        +
        Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
        +
        +
        Parameters:
        +
        jsonPointer - the string representation of the JSON pointer
        +
        Returns:
        +
        the queried value or null
        +
        Throws:
        +
        IllegalArgumentException - if jsonPointer has invalid syntax
        +
        +
      • +
      + + + +
        +
      • +

        optQuery

        +
        public Object optQuery(JSONPointer jsonPointer)
        +
        Queries and returns a value from this object using jsonPointer, or + returns null if the query fails due to a missing key.
        +
        +
        Parameters:
        +
        jsonPointer - The JSON pointer
        +
        Returns:
        +
        the queried value or null
        +
        Throws:
        +
        IllegalArgumentException - if jsonPointer has invalid syntax
        +
        +
      • +
      + + + +
        +
      • +

        quote

        +
        public static String quote(String string)
        +
        Produce a string in double quotes with backslash sequences in all the + right places. A backslash will be inserted within </, producing + <\/, allowing JSON text to be delivered in HTML. In JSON text, a + string cannot contain a control character or an unescaped quote or + backslash.
        +
        +
        Parameters:
        +
        string - A String
        +
        Returns:
        +
        A String correctly formatted for insertion in a JSON text.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        remove

        +
        public Object remove(String key)
        +
        Remove a name and its value, if present.
        +
        +
        Parameters:
        +
        key - The name to be removed.
        +
        Returns:
        +
        The value that was associated with the name, or null if there was + no value.
        +
        +
      • +
      + + + +
        +
      • +

        similar

        +
        public boolean similar(Object other)
        +
        Determine if two JSONObjects are similar. + They must contain the same set of names which must be associated with + similar values.
        +
        +
        Parameters:
        +
        other - The other JSONObject
        +
        Returns:
        +
        true if they are equal
        +
        +
      • +
      + + + +
        +
      • +

        isDecimalNotation

        +
        protected static boolean isDecimalNotation(String val)
        +
        Tests if the value should be tried as a decimal. It makes no test if there are actual digits.
        +
        +
        Parameters:
        +
        val - value to test
        +
        Returns:
        +
        true if the string is "-0" or if it contains '.', 'e', or 'E', false otherwise.
        +
        +
      • +
      + + + +
        +
      • +

        stringToNumber

        +
        protected static Number stringToNumber(String val)
        +                                throws NumberFormatException
        +
        Converts a string to a number using the narrowest possible type. Possible + returns for this function are BigDecimal, Double, BigInteger, Long, and Integer. + When a Double is returned, it should always be a valid Double and not NaN or +-infinity.
        +
        +
        Parameters:
        +
        val - value to convert
        +
        Returns:
        +
        Number representation of the value.
        +
        Throws:
        +
        NumberFormatException - thrown if the value is not a valid number. A public + caller should catch this and wrap it in a JSONException if applicable.
        +
        +
      • +
      + + + +
        +
      • +

        stringToValue

        +
        public static Object stringToValue(String string)
        +
        Try to convert a string into a number, boolean, or null. If the string + can't be converted, return the string.
        +
        +
        Parameters:
        +
        string - A String. can not be null.
        +
        Returns:
        +
        A simple JSON value.
        +
        Throws:
        +
        NullPointerException - Thrown if the string is null.
        +
        +
      • +
      + + + +
        +
      • +

        testValidity

        +
        public static void testValidity(Object o)
        +                         throws JSONException
        +
        Throw an exception if the object is a NaN or infinite number.
        +
        +
        Parameters:
        +
        o - The object to test.
        +
        Throws:
        +
        JSONException - If o is a non-finite number.
        +
        +
      • +
      + + + +
        +
      • +

        toJSONArray

        +
        public JSONArray toJSONArray(JSONArray names)
        +                      throws JSONException
        +
        Produce a JSONArray containing the values of the members of this + JSONObject.
        +
        +
        Parameters:
        +
        names - A JSONArray containing a list of key strings. This determines + the sequence of the values in the result.
        +
        Returns:
        +
        A JSONArray of values.
        +
        Throws:
        +
        JSONException - If any of the values are non-finite numbers.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Make a JSON text of this JSONObject. For compactness, no whitespace is + added. If this would not result in a syntactically correct JSON text, + then null will be returned instead. +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        a printable, displayable, portable, transmittable representation + of the object, beginning with { (left + brace) and ending with } (right + brace).
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString(int indentFactor)
        +                throws JSONException
        +
        Make a pretty-printed JSON text of this JSONObject. + +

        If

         indentFactor > 0
        and the JSONObject + has only one key, then the object will be output on a single line: +
         {"key": 1}
        + +

        If an object has 2 or more keys, then it will be output across + multiple lines:

         {
        +  "key1": 1,
        +  "key2": "value 2",
        +  "key3": 3
        + }
        +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Parameters:
        +
        indentFactor - The number of spaces to add to each level of indentation.
        +
        Returns:
        +
        a printable, displayable, portable, transmittable representation + of the object, beginning with { (left + brace) and ending with } (right + brace).
        +
        Throws:
        +
        JSONException - If the object contains an invalid number.
        +
        +
      • +
      + + + +
        +
      • +

        valueToString

        +
        public static String valueToString(Object value)
        +                            throws JSONException
        +
        Make a JSON text of an Object value. If the object has an + value.toJSONString() method, then that method will be used to produce the + JSON text. The method is required to produce a strictly conforming text. + If the object does not contain a toJSONString method (which is the most + common case), then a text will be produced by other means. If the value + is an array or Collection, then a JSONArray will be made from it and its + toJSONString method will be called. If the value is a MAP, then a + JSONObject will be made from it and its toJSONString method will be + called. Otherwise, the value's toString method will be called, and the + result will be quoted. + +

        + Warning: This method assumes that the data structure is acyclical.

        +
        +
        Parameters:
        +
        value - The value to be serialized.
        +
        Returns:
        +
        a printable, displayable, transmittable representation of the + object, beginning with { (left + brace) and ending with } (right + brace).
        +
        Throws:
        +
        JSONException - If the value is or contains an invalid number.
        +
        +
      • +
      + + + +
        +
      • +

        wrap

        +
        public static Object wrap(Object object)
        +
        Wrap an object, if necessary. If the object is null, return the NULL + object. If it is an array or collection, wrap it in a JSONArray. If it is + a map, wrap it in a JSONObject. If it is a standard property (Double, + String, et al) then it is already wrapped. Otherwise, if it comes from + one of the java packages, turn it into a string. And if it doesn't, try + to wrap it in a JSONObject. If the wrapping fails, then null is returned.
        +
        +
        Parameters:
        +
        object - The object to wrap
        +
        Returns:
        +
        The wrapped value
        +
        +
      • +
      + + + +
        +
      • +

        write

        +
        public Writer write(Writer writer)
        +             throws JSONException
        +
        Write the contents of the JSONObject as JSON text to a writer. For + compactness, no whitespace is added. +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Parameters:
        +
        writer - the writer object
        +
        Returns:
        +
        The writer.
        +
        Throws:
        +
        JSONException - if a called function has an error
        +
        +
      • +
      + + + +
        +
      • +

        write

        +
        public Writer write(Writer writer,
        +                    int indentFactor,
        +                    int indent)
        +             throws JSONException
        +
        Write the contents of the JSONObject as JSON text to a writer. + +

        If

         indentFactor > 0
        and the JSONObject + has only one key, then the object will be output on a single line: +
         {"key": 1}
        + +

        If an object has 2 or more keys, then it will be output across + multiple lines:

         {
        +  "key1": 1,
        +  "key2": "value 2",
        +  "key3": 3
        + }
        +

        + Warning: This method assumes that the data structure is acyclical. +

        +
        +
        Parameters:
        +
        writer - Writes the serialized JSON
        +
        indentFactor - The number of spaces to add to each level of indentation.
        +
        indent - The indentation of the top level.
        +
        Returns:
        +
        The writer.
        +
        Throws:
        +
        JSONException - if a called function has an error or a write error + occurs
        +
        +
      • +
      + + + +
        +
      • +

        toMap

        +
        public Map<String,Object> toMap()
        +
        Returns a java.util.Map containing all of the entries in this object. + If an entry in the object is a JSONArray or JSONObject it will also + be converted. +

        + Warning: This method assumes that the data structure is acyclical.

        +
        +
        Returns:
        +
        a java.util.Map containing the entries of this object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/JSONPointer.Builder.html b/docs/org/json/JSONPointer.Builder.html new file mode 100644 index 0000000..5fa9be7 --- /dev/null +++ b/docs/org/json/JSONPointer.Builder.html @@ -0,0 +1,334 @@ + + + + + +JSONPointer.Builder + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONPointer.Builder

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    JSONPointer
    +
    +
    +
    +
    public static class JSONPointer.Builder
    +extends Object
    +
    This class allows the user to build a JSONPointer in steps, using + exactly one segment in each step.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Builder

        +
        public Builder()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        build

        +
        public JSONPointer build()
        +
        Creates a JSONPointer instance using the tokens previously set using the + append(String) method calls.
        +
        +
        Returns:
        +
        a JSONPointer object
        +
        +
      • +
      + + + +
        +
      • +

        append

        +
        public JSONPointer.Builder append(String token)
        +
        Adds an arbitrary token to the list of reference tokens. It can be any non-null value. + + Unlike in the case of JSON string or URI fragment representation of JSON pointers, the + argument of this method MUST NOT be escaped. If you want to query the property called + "a~b" then you should simply pass the "a~b" string as-is, there is no + need to escape it as "a~0b".
        +
        +
        Parameters:
        +
        token - the new token to be appended to the list
        +
        Returns:
        +
        this
        +
        Throws:
        +
        NullPointerException - if token is null
        +
        +
      • +
      + + + +
        +
      • +

        append

        +
        public JSONPointer.Builder append(int arrayIndex)
        +
        Adds an integer to the reference token list. Although not necessarily, mostly this token will + denote an array index.
        +
        +
        Parameters:
        +
        arrayIndex - the array index to be added to the token list
        +
        Returns:
        +
        this
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/JSONPointer.html b/docs/org/json/JSONPointer.html new file mode 100644 index 0000000..61ab637 --- /dev/null +++ b/docs/org/json/JSONPointer.html @@ -0,0 +1,414 @@ + + + + + +JSONPointer + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONPointer

+
+
+ +
+
    +
  • +
    +
    +
    public class JSONPointer
    +extends Object
    +
    A JSON Pointer is a simple query language defined for JSON documents by + RFC 6901. + + In a nutshell, JSONPointer allows the user to navigate into a JSON document + using strings, and retrieve targeted objects, like a simple form of XPATH. + Path segments are separated by the '/' char, which signifies the root of + the document when it appears as the first char of the string. Array + elements are navigated using ordinals, counting from 0. JSONPointer strings + may be extended to any arbitrary number of segments. If the navigation + is successful, the matched item is returned. A matched item may be a + JSONObject, a JSONArray, or a JSON value. If the JSONPointer string building + fails, an appropriate exception is thrown. If the navigation fails to find + a match, a JSONPointerException is thrown.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONPointer

        +
        public JSONPointer(String pointer)
        +
        Pre-parses and initializes a new JSONPointer instance. If you want to + evaluate the same JSON Pointer on different JSON documents then it is recommended + to keep the JSONPointer instances due to performance considerations.
        +
        +
        Parameters:
        +
        pointer - the JSON String or URI Fragment representation of the JSON pointer.
        +
        Throws:
        +
        IllegalArgumentException - if pointer is not a valid JSON pointer
        +
        +
      • +
      + + + +
        +
      • +

        JSONPointer

        +
        public JSONPointer(List<String> refTokens)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        builder

        +
        public static JSONPointer.Builder builder()
        +
        Static factory method for JSONPointer.Builder. Example usage: + +
        
        + JSONPointer pointer = JSONPointer.builder()
        +       .append("obj")
        +       .append("other~key").append("another/key")
        +       .append("\"")
        +       .append(0)
        +       .build();
        + 
        +
        +
        Returns:
        +
        a builder instance which can be used to construct a JSONPointer instance by chained + JSONPointer.Builder.append(String) calls.
        +
        +
      • +
      + + + +
        +
      • +

        queryFrom

        +
        public Object queryFrom(Object document)
        +                 throws JSONPointerException
        +
        Evaluates this JSON Pointer on the given document. The document + is usually a JSONObject or a JSONArray instance, but the empty + JSON Pointer ("") can be evaluated on any JSON values and in such case the + returned value will be document itself.
        +
        +
        Parameters:
        +
        document - the JSON document which should be the subject of querying.
        +
        Returns:
        +
        the result of the evaluation
        +
        Throws:
        +
        JSONPointerException - if an error occurs during evaluation
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Returns a string representing the JSONPointer path value using string + representation
        +
        +
        Overrides:
        +
        toString in class Object
        +
        +
      • +
      + + + +
        +
      • +

        toURIFragment

        +
        public String toURIFragment()
        +
        Returns a string representing the JSONPointer path value using URI + fragment identifier representation
        +
        +
        Returns:
        +
        a uri fragment string
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/JSONPointerException.html b/docs/org/json/JSONPointerException.html new file mode 100644 index 0000000..399d005 --- /dev/null +++ b/docs/org/json/JSONPointerException.html @@ -0,0 +1,284 @@ + + + + + +JSONPointerException + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONPointerException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONPointerException

        +
        public JSONPointerException(String message)
        +
      • +
      + + + +
        +
      • +

        JSONPointerException

        +
        public JSONPointerException(String message,
        +                            Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/JSONPropertyIgnore.html b/docs/org/json/JSONPropertyIgnore.html new file mode 100644 index 0000000..269571e --- /dev/null +++ b/docs/org/json/JSONPropertyIgnore.html @@ -0,0 +1,162 @@ + + + + + +JSONPropertyIgnore + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Annotation Type JSONPropertyIgnore

+
+
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/JSONPropertyName.html b/docs/org/json/JSONPropertyName.html new file mode 100644 index 0000000..dbd43dd --- /dev/null +++ b/docs/org/json/JSONPropertyName.html @@ -0,0 +1,214 @@ + + + + + +JSONPropertyName + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Annotation Type JSONPropertyName

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      Stringvalue 
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        value

        +
        public abstract String value
        +
        +
        Returns:
        +
        The name of the property as to be used in the JSON Object.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONString.html b/docs/org/json/JSONString.html similarity index 86% rename from org/json/JSONString.html rename to docs/org/json/JSONString.html index c88509b..39e4d42 100644 --- a/org/json/JSONString.html +++ b/docs/org/json/JSONString.html @@ -1,236 +1,232 @@ - - - - - - -JSONString (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Interface JSONString

-
-
-
-
    -
  • -
    -
    -
    public interface JSONString
    -
    The JSONString interface allows a toJSONString() - method so that a class can change the behavior of - JSONObject.toString(), JSONArray.toString(), - and JSONWriter.value(Object). The - toJSONString method will be used instead of the default behavior - of using the Object's toString() method and quoting the result.
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - -
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      java.lang.StringtoJSONString() -
      The toJSONString method allows a class to produce its own JSON - serialization.
      -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        toJSONString

        -
        java.lang.String toJSONString()
        -
        The toJSONString method allows a class to produce its own JSON - serialization.
        -
        -
        Returns:
        -
        A strictly syntactically correct JSON text.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONString + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Interface JSONString

+
+
+
+
    +
  • +
    +
    +
    public interface JSONString
    +
    The JSONString interface allows a toJSONString() + method so that a class can change the behavior of + JSONObject.toString(), JSONArray.toString(), + and JSONWriter.value(Object). The + toJSONString method will be used instead of the default behavior + of using the Object's toString() method and quoting the result.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toJSONString

        +
        String toJSONString()
        +
        The toJSONString method allows a class to produce its own JSON + serialization.
        +
        +
        Returns:
        +
        A strictly syntactically correct JSON text.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONStringer.html b/docs/org/json/JSONStringer.html similarity index 77% rename from org/json/JSONStringer.html rename to docs/org/json/JSONStringer.html index fbaffa0..dd3f182 100644 --- a/org/json/JSONStringer.html +++ b/docs/org/json/JSONStringer.html @@ -1,346 +1,336 @@ - - - - - - -JSONStringer (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONStringer

-
-
- -
-
    -
  • -
    -
    -
    public class JSONStringer
    -extends JSONWriter
    -
    JSONStringer provides a quick and convenient way of producing JSON text. - The texts produced strictly conform to JSON syntax rules. No whitespace is - added, so the results are ready for transmission or storage. Each instance of - JSONStringer can produce one JSON text. -

    - A JSONStringer instance provides a value method for appending - values to the - text, and a key - method for adding keys before values in objects. There are array - and endArray methods that make and bound array values, and - object and endObject methods which make and bound - object values. All of these methods return the JSONWriter instance, - permitting cascade style. For example,

    - myString = new JSONStringer()
    -     .object()
    -         .key("JSON")
    -         .value("Hello, World!")
    -     .endObject()
    -     .toString();
    which produces the string
    - {"JSON":"Hello, World!"}
    -

    - The first method called must be array or object. - There are no methods for adding commas or colons. JSONStringer adds them for - you. Objects and arrays can be nested up to 20 levels deep. -

    - This can sometimes be easier than using a JSONObject to build a string.

    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONStringer

        -
        public JSONStringer()
        -
        Make a fresh JSONStringer. It can be used to build one JSON text.
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        toString

        -
        public java.lang.String toString()
        -
        Return the JSON text. This method is used to obtain the product of the - JSONStringer instance. It will return null if there was a - problem in the construction of the JSON text (such as the calls to - array were not properly balanced with calls to - endArray).
        -
        -
        Overrides:
        -
        toString in class java.lang.Object
        -
        Returns:
        -
        The JSON text.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONStringer + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONStringer

+
+
+ +
+
    +
  • +
    +
    +
    public class JSONStringer
    +extends JSONWriter
    +
    JSONStringer provides a quick and convenient way of producing JSON text. + The texts produced strictly conform to JSON syntax rules. No whitespace is + added, so the results are ready for transmission or storage. Each instance of + JSONStringer can produce one JSON text. +

    + A JSONStringer instance provides a value method for appending + values to the + text, and a key + method for adding keys before values in objects. There are array + and endArray methods that make and bound array values, and + object and endObject methods which make and bound + object values. All of these methods return the JSONWriter instance, + permitting cascade style. For example,

    + myString = new JSONStringer()
    +     .object()
    +         .key("JSON")
    +         .value("Hello, World!")
    +     .endObject()
    +     .toString();
    which produces the string
    + {"JSON":"Hello, World!"}
    +

    + The first method called must be array or object. + There are no methods for adding commas or colons. JSONStringer adds them for + you. Objects and arrays can be nested up to 20 levels deep. +

    + This can sometimes be easier than using a JSONObject to build a string.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONStringer

        +
        public JSONStringer()
        +
        Make a fresh JSONStringer. It can be used to build one JSON text.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Return the JSON text. This method is used to obtain the product of the + JSONStringer instance. It will return null if there was a + problem in the construction of the JSON text (such as the calls to + array were not properly balanced with calls to + endArray).
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        The JSON text.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONTokener.html b/docs/org/json/JSONTokener.html similarity index 67% rename from org/json/JSONTokener.html rename to docs/org/json/JSONTokener.html index 5f80253..676d983 100644 --- a/org/json/JSONTokener.html +++ b/docs/org/json/JSONTokener.html @@ -1,681 +1,705 @@ - - - - - - -JSONTokener (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONTokener

-
-
- -
-
    -
  • -
    -
    Direct Known Subclasses:
    -
    HTTPTokener, XMLTokener
    -
    -
    -
    -
    public class JSONTokener
    -extends java.lang.Object
    -
    A JSONTokener takes a source string and extracts characters and tokens from - it. It is used by the JSONObject and JSONArray constructors to parse - JSON source strings.
    -
    -
    Version:
    -
    2014-05-03
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - - - - - - - -
      Constructors 
      Constructor and Description
      JSONTokener(java.io.InputStream inputStream) -
      Construct a JSONTokener from an InputStream.
      -
      JSONTokener(java.io.Reader reader) -
      Construct a JSONTokener from a Reader.
      -
      JSONTokener(java.lang.String s) -
      Construct a JSONTokener from a string.
      -
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidback() -
      Back up one character.
      -
      static intdehexchar(char c) -
      Get the hex value of a character (base16).
      -
      booleanend() 
      booleanmore() -
      Determine if the source string still contains characters that next() - can consume.
      -
      charnext() -
      Get the next character in the source string.
      -
      charnext(char c) -
      Consume the next character, and check that it matches a specified - character.
      -
      java.lang.Stringnext(int n) -
      Get the next n characters.
      -
      charnextClean() -
      Get the next char in the string, skipping whitespace.
      -
      java.lang.StringnextString(char quote) -
      Return the characters up to the next close quote character.
      -
      java.lang.StringnextTo(char delimiter) -
      Get the text up but not including the specified character or the - end of line, whichever comes first.
      -
      java.lang.StringnextTo(java.lang.String delimiters) -
      Get the text up but not including one of the specified delimiter - characters or the end of line, whichever comes first.
      -
      java.lang.ObjectnextValue() -
      Get the next value.
      -
      charskipTo(char to) -
      Skip characters until the next character is the requested character.
      -
      JSONExceptionsyntaxError(java.lang.String message) -
      Make a JSONException to signal a syntax error.
      -
      java.lang.StringtoString() -
      Make a printable string of this JSONTokener.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONTokener

        -
        public JSONTokener(java.io.Reader reader)
        -
        Construct a JSONTokener from a Reader.
        -
        -
        Parameters:
        -
        reader - A reader.
        -
        -
      • -
      - - - -
        -
      • -

        JSONTokener

        -
        public JSONTokener(java.io.InputStream inputStream)
        -            throws JSONException
        -
        Construct a JSONTokener from an InputStream.
        -
        -
        Parameters:
        -
        inputStream - The source.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        JSONTokener

        -
        public JSONTokener(java.lang.String s)
        -
        Construct a JSONTokener from a string.
        -
        -
        Parameters:
        -
        s - A source string.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        back

        -
        public void back()
        -          throws JSONException
        -
        Back up one character. This provides a sort of lookahead capability, - so that you can test for a digit or letter before attempting to parse - the next number or identifier.
        -
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        dehexchar

        -
        public static int dehexchar(char c)
        -
        Get the hex value of a character (base16).
        -
        -
        Parameters:
        -
        c - A character between '0' and '9' or between 'A' and 'F' or - between 'a' and 'f'.
        -
        Returns:
        -
        An int between 0 and 15, or -1 if c was not a hex digit.
        -
        -
      • -
      - - - -
        -
      • -

        end

        -
        public boolean end()
        -
      • -
      - - - -
        -
      • -

        more

        -
        public boolean more()
        -             throws JSONException
        -
        Determine if the source string still contains characters that next() - can consume.
        -
        -
        Returns:
        -
        true if not yet at the end of the source.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        next

        -
        public char next()
        -          throws JSONException
        -
        Get the next character in the source string.
        -
        -
        Returns:
        -
        The next character, or 0 if past the end of the source string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        next

        -
        public char next(char c)
        -          throws JSONException
        -
        Consume the next character, and check that it matches a specified - character.
        -
        -
        Parameters:
        -
        c - The character to match.
        -
        Returns:
        -
        The character.
        -
        Throws:
        -
        JSONException - if the character does not match.
        -
        -
      • -
      - - - -
        -
      • -

        next

        -
        public java.lang.String next(int n)
        -                      throws JSONException
        -
        Get the next n characters.
        -
        -
        Parameters:
        -
        n - The number of characters to take.
        -
        Returns:
        -
        A string of n characters.
        -
        Throws:
        -
        JSONException - Substring bounds error if there are not - n characters remaining in the source string.
        -
        -
      • -
      - - - -
        -
      • -

        nextClean

        -
        public char nextClean()
        -               throws JSONException
        -
        Get the next char in the string, skipping whitespace.
        -
        -
        Returns:
        -
        A character, or 0 if there are no more characters.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        nextString

        -
        public java.lang.String nextString(char quote)
        -                            throws JSONException
        -
        Return the characters up to the next close quote character. - Backslash processing is done. The formal JSON format does not - allow strings in single quotes, but an implementation is allowed to - accept them.
        -
        -
        Parameters:
        -
        quote - The quoting character, either - " (double quote) or - ' (single quote).
        -
        Returns:
        -
        A String.
        -
        Throws:
        -
        JSONException - Unterminated string.
        -
        -
      • -
      - - - -
        -
      • -

        nextTo

        -
        public java.lang.String nextTo(char delimiter)
        -                        throws JSONException
        -
        Get the text up but not including the specified character or the - end of line, whichever comes first.
        -
        -
        Parameters:
        -
        delimiter - A delimiter character.
        -
        Returns:
        -
        A string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        nextTo

        -
        public java.lang.String nextTo(java.lang.String delimiters)
        -                        throws JSONException
        -
        Get the text up but not including one of the specified delimiter - characters or the end of line, whichever comes first.
        -
        -
        Parameters:
        -
        delimiters - A set of delimiter characters.
        -
        Returns:
        -
        A string, trimmed.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        nextValue

        -
        public java.lang.Object nextValue()
        -                           throws JSONException
        -
        Get the next value. The value can be a Boolean, Double, Integer, - JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
        -
        -
        Returns:
        -
        An object.
        -
        Throws:
        -
        JSONException - If syntax error.
        -
        -
      • -
      - - - -
        -
      • -

        skipTo

        -
        public char skipTo(char to)
        -            throws JSONException
        -
        Skip characters until the next character is the requested character. - If the requested character is not found, no characters are skipped.
        -
        -
        Parameters:
        -
        to - A character to skip to.
        -
        Returns:
        -
        The requested character, or zero if the requested character - is not found.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        syntaxError

        -
        public JSONException syntaxError(java.lang.String message)
        -
        Make a JSONException to signal a syntax error.
        -
        -
        Parameters:
        -
        message - The error message.
        -
        Returns:
        -
        A JSONException object, suitable for throwing
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public java.lang.String toString()
        -
        Make a printable string of this JSONTokener.
        -
        -
        Overrides:
        -
        toString in class java.lang.Object
        -
        Returns:
        -
        " at {index} [character {character} line {line}]"
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONTokener + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONTokener

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    HTTPTokener, XMLTokener
    +
    +
    +
    +
    public class JSONTokener
    +extends Object
    +
    A JSONTokener takes a source string and extracts characters and tokens from + it. It is used by the JSONObject and JSONArray constructors to parse + JSON source strings.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      JSONTokener(InputStream inputStream) +
      Construct a JSONTokener from an InputStream.
      +
      JSONTokener(Reader reader) +
      Construct a JSONTokener from a Reader.
      +
      JSONTokener(String s) +
      Construct a JSONTokener from a string.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidback() +
      Back up one character.
      +
      static intdehexchar(char c) +
      Get the hex value of a character (base16).
      +
      booleanend() +
      Checks if the end of the input has been reached.
      +
      booleanmore() +
      Determine if the source string still contains characters that next() + can consume.
      +
      charnext() +
      Get the next character in the source string.
      +
      charnext(char c) +
      Consume the next character, and check that it matches a specified + character.
      +
      Stringnext(int n) +
      Get the next n characters.
      +
      charnextClean() +
      Get the next char in the string, skipping whitespace.
      +
      StringnextString(char quote) +
      Return the characters up to the next close quote character.
      +
      StringnextTo(char delimiter) +
      Get the text up but not including the specified character or the + end of line, whichever comes first.
      +
      StringnextTo(String delimiters) +
      Get the text up but not including one of the specified delimiter + characters or the end of line, whichever comes first.
      +
      ObjectnextValue() +
      Get the next value.
      +
      charskipTo(char to) +
      Skip characters until the next character is the requested character.
      +
      JSONExceptionsyntaxError(String message) +
      Make a JSONException to signal a syntax error.
      +
      JSONExceptionsyntaxError(String message, + Throwable causedBy) +
      Make a JSONException to signal a syntax error.
      +
      StringtoString() +
      Make a printable string of this JSONTokener.
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONTokener

        +
        public JSONTokener(Reader reader)
        +
        Construct a JSONTokener from a Reader. The caller must close the Reader.
        +
        +
        Parameters:
        +
        reader - A reader.
        +
        +
      • +
      + + + +
        +
      • +

        JSONTokener

        +
        public JSONTokener(InputStream inputStream)
        +
        Construct a JSONTokener from an InputStream. The caller must close the input stream.
        +
        +
        Parameters:
        +
        inputStream - The source.
        +
        +
      • +
      + + + +
        +
      • +

        JSONTokener

        +
        public JSONTokener(String s)
        +
        Construct a JSONTokener from a string.
        +
        +
        Parameters:
        +
        s - A source string.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        back

        +
        public void back()
        +          throws JSONException
        +
        Back up one character. This provides a sort of lookahead capability, + so that you can test for a digit or letter before attempting to parse + the next number or identifier.
        +
        +
        Throws:
        +
        JSONException - Thrown if trying to step back more than 1 step + or if already at the start of the string
        +
        +
      • +
      + + + +
        +
      • +

        dehexchar

        +
        public static int dehexchar(char c)
        +
        Get the hex value of a character (base16).
        +
        +
        Parameters:
        +
        c - A character between '0' and '9' or between 'A' and 'F' or + between 'a' and 'f'.
        +
        Returns:
        +
        An int between 0 and 15, or -1 if c was not a hex digit.
        +
        +
      • +
      + + + +
        +
      • +

        end

        +
        public boolean end()
        +
        Checks if the end of the input has been reached.
        +
        +
        Returns:
        +
        true if at the end of the file and we didn't step back
        +
        +
      • +
      + + + +
        +
      • +

        more

        +
        public boolean more()
        +             throws JSONException
        +
        Determine if the source string still contains characters that next() + can consume.
        +
        +
        Returns:
        +
        true if not yet at the end of the source.
        +
        Throws:
        +
        JSONException - thrown if there is an error stepping forward + or backward while checking for more data.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public char next()
        +          throws JSONException
        +
        Get the next character in the source string.
        +
        +
        Returns:
        +
        The next character, or 0 if past the end of the source string.
        +
        Throws:
        +
        JSONException - Thrown if there is an error reading the source string.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public char next(char c)
        +          throws JSONException
        +
        Consume the next character, and check that it matches a specified + character.
        +
        +
        Parameters:
        +
        c - The character to match.
        +
        Returns:
        +
        The character.
        +
        Throws:
        +
        JSONException - if the character does not match.
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public String next(int n)
        +            throws JSONException
        +
        Get the next n characters.
        +
        +
        Parameters:
        +
        n - The number of characters to take.
        +
        Returns:
        +
        A string of n characters.
        +
        Throws:
        +
        JSONException - Substring bounds error if there are not + n characters remaining in the source string.
        +
        +
      • +
      + + + +
        +
      • +

        nextClean

        +
        public char nextClean()
        +               throws JSONException
        +
        Get the next char in the string, skipping whitespace.
        +
        +
        Returns:
        +
        A character, or 0 if there are no more characters.
        +
        Throws:
        +
        JSONException - Thrown if there is an error reading the source string.
        +
        +
      • +
      + + + +
        +
      • +

        nextString

        +
        public String nextString(char quote)
        +                  throws JSONException
        +
        Return the characters up to the next close quote character. + Backslash processing is done. The formal JSON format does not + allow strings in single quotes, but an implementation is allowed to + accept them.
        +
        +
        Parameters:
        +
        quote - The quoting character, either + " (double quote) or + ' (single quote).
        +
        Returns:
        +
        A String.
        +
        Throws:
        +
        JSONException - Unterminated string.
        +
        +
      • +
      + + + +
        +
      • +

        nextTo

        +
        public String nextTo(char delimiter)
        +              throws JSONException
        +
        Get the text up but not including the specified character or the + end of line, whichever comes first.
        +
        +
        Parameters:
        +
        delimiter - A delimiter character.
        +
        Returns:
        +
        A string.
        +
        Throws:
        +
        JSONException - Thrown if there is an error while searching + for the delimiter
        +
        +
      • +
      + + + +
        +
      • +

        nextTo

        +
        public String nextTo(String delimiters)
        +              throws JSONException
        +
        Get the text up but not including one of the specified delimiter + characters or the end of line, whichever comes first.
        +
        +
        Parameters:
        +
        delimiters - A set of delimiter characters.
        +
        Returns:
        +
        A string, trimmed.
        +
        Throws:
        +
        JSONException - Thrown if there is an error while searching + for the delimiter
        +
        +
      • +
      + + + +
        +
      • +

        nextValue

        +
        public Object nextValue()
        +                 throws JSONException
        +
        Get the next value. The value can be a Boolean, Double, Integer, + JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
        +
        +
        Returns:
        +
        An object.
        +
        Throws:
        +
        JSONException - If syntax error.
        +
        +
      • +
      + + + +
        +
      • +

        skipTo

        +
        public char skipTo(char to)
        +            throws JSONException
        +
        Skip characters until the next character is the requested character. + If the requested character is not found, no characters are skipped.
        +
        +
        Parameters:
        +
        to - A character to skip to.
        +
        Returns:
        +
        The requested character, or zero if the requested character + is not found.
        +
        Throws:
        +
        JSONException - Thrown if there is an error while searching + for the to character
        +
        +
      • +
      + + + +
        +
      • +

        syntaxError

        +
        public JSONException syntaxError(String message)
        +
        Make a JSONException to signal a syntax error.
        +
        +
        Parameters:
        +
        message - The error message.
        +
        Returns:
        +
        A JSONException object, suitable for throwing
        +
        +
      • +
      + + + +
        +
      • +

        syntaxError

        +
        public JSONException syntaxError(String message,
        +                                 Throwable causedBy)
        +
        Make a JSONException to signal a syntax error.
        +
        +
        Parameters:
        +
        message - The error message.
        +
        causedBy - The throwable that caused the error.
        +
        Returns:
        +
        A JSONException object, suitable for throwing
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public String toString()
        +
        Make a printable string of this JSONTokener.
        +
        +
        Overrides:
        +
        toString in class Object
        +
        Returns:
        +
        " at {index} [character {character} line {line}]"
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/JSONWriter.html b/docs/org/json/JSONWriter.html similarity index 71% rename from org/json/JSONWriter.html rename to docs/org/json/JSONWriter.html index 3985447..4fa4641 100644 --- a/org/json/JSONWriter.html +++ b/docs/org/json/JSONWriter.html @@ -1,588 +1,622 @@ - - - - - - -JSONWriter (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONWriter

-
-
- -
-
    -
  • -
    -
    Direct Known Subclasses:
    -
    JSONStringer
    -
    -
    -
    -
    public class JSONWriter
    -extends java.lang.Object
    -
    JSONWriter provides a quick and convenient way of producing JSON text. - The texts produced strictly conform to JSON syntax rules. No whitespace is - added, so the results are ready for transmission or storage. Each instance of - JSONWriter can produce one JSON text. -

    - A JSONWriter instance provides a value method for appending - values to the - text, and a key - method for adding keys before values in objects. There are array - and endArray methods that make and bound array values, and - object and endObject methods which make and bound - object values. All of these methods return the JSONWriter instance, - permitting a cascade style. For example,

    - new JSONWriter(myWriter)
    -     .object()
    -         .key("JSON")
    -         .value("Hello, World!")
    -     .endObject();
    which writes
    - {"JSON":"Hello, World!"}
    -

    - The first method called must be array or object. - There are no methods for adding commas or colons. JSONWriter adds them for - you. Objects and arrays can be nested up to 20 levels deep. -

    - This can sometimes be easier than using a JSONObject to build a string.

    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Summary

      - - - - - - - - - - - - - - -
      Fields 
      Modifier and TypeField and Description
      protected charmode -
      The current mode.
      -
      protected java.io.Writerwriter -
      The writer that will receive the output.
      -
      -
    • -
    - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      JSONWriter(java.io.Writer w) -
      Make a fresh JSONWriter.
      -
      -
    • -
    - - -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        mode

        -
        protected char mode
        -
        The current mode. Values: - 'a' (array), - 'd' (done), - 'i' (initial), - 'k' (key), - 'o' (object).
        -
      • -
      - - - -
        -
      • -

        writer

        -
        protected java.io.Writer writer
        -
        The writer that will receive the output.
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONWriter

        -
        public JSONWriter(java.io.Writer w)
        -
        Make a fresh JSONWriter. It can be used to build one JSON text.
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        array

        -
        public JSONWriter array()
        -                 throws JSONException
        -
        Begin appending a new array. All values until the balancing - endArray will be appended to this array. The - endArray method must be called to mark the array's end.
        -
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If the nesting is too deep, or if the object is - started in the wrong place (for example as a key or after the end of the - outermost array or object).
        -
        -
      • -
      - - - -
        -
      • -

        endArray

        -
        public JSONWriter endArray()
        -                    throws JSONException
        -
        End an array. This method most be called to balance calls to - array.
        -
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If incorrectly nested.
        -
        -
      • -
      - - - -
        -
      • -

        endObject

        -
        public JSONWriter endObject()
        -                     throws JSONException
        -
        End an object. This method most be called to balance calls to - object.
        -
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If incorrectly nested.
        -
        -
      • -
      - - - -
        -
      • -

        key

        -
        public JSONWriter key(java.lang.String string)
        -               throws JSONException
        -
        Append a key. The key will be associated with the next value. In an - object, every value must be preceded by a key.
        -
        -
        Parameters:
        -
        string - A key string.
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If the key is out of place. For example, keys - do not belong in arrays or if the key is null.
        -
        -
      • -
      - - - -
        -
      • -

        object

        -
        public JSONWriter object()
        -                  throws JSONException
        -
        Begin appending a new object. All keys and values until the balancing - endObject will be appended to this object. The - endObject method must be called to mark the object's end.
        -
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If the nesting is too deep, or if the object is - started in the wrong place (for example as a key or after the end of the - outermost array or object).
        -
        -
      • -
      - - - -
        -
      • -

        value

        -
        public JSONWriter value(boolean b)
        -                 throws JSONException
        -
        Append either the value true or the value - false.
        -
        -
        Parameters:
        -
        b - A boolean.
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        value

        -
        public JSONWriter value(double d)
        -                 throws JSONException
        -
        Append a double value.
        -
        -
        Parameters:
        -
        d - A double.
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If the number is not finite.
        -
        -
      • -
      - - - - - - - -
        -
      • -

        value

        -
        public JSONWriter value(java.lang.Object object)
        -                 throws JSONException
        -
        Append an object value.
        -
        -
        Parameters:
        -
        object - The object to append. It can be null, or a Boolean, Number, - String, JSONObject, or JSONArray, or an object that implements JSONString.
        -
        Returns:
        -
        this
        -
        Throws:
        -
        JSONException - If the value is out of sequence.
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +JSONWriter + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class JSONWriter

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    JSONStringer
    +
    +
    +
    +
    public class JSONWriter
    +extends Object
    +
    JSONWriter provides a quick and convenient way of producing JSON text. + The texts produced strictly conform to JSON syntax rules. No whitespace is + added, so the results are ready for transmission or storage. Each instance of + JSONWriter can produce one JSON text. +

    + A JSONWriter instance provides a value method for appending + values to the + text, and a key + method for adding keys before values in objects. There are array + and endArray methods that make and bound array values, and + object and endObject methods which make and bound + object values. All of these methods return the JSONWriter instance, + permitting a cascade style. For example,

    + new JSONWriter(myWriter)
    +     .object()
    +         .key("JSON")
    +         .value("Hello, World!")
    +     .endObject();
    which writes
    + {"JSON":"Hello, World!"}
    +

    + The first method called must be array or object. + There are no methods for adding commas or colons. JSONWriter adds them for + you. Objects and arrays can be nested up to 200 levels deep. +

    + This can sometimes be easier than using a JSONObject to build a string.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        mode

        +
        protected char mode
        +
        The current mode. Values: + 'a' (array), + 'd' (done), + 'i' (initial), + 'k' (key), + 'o' (object).
        +
      • +
      + + + +
        +
      • +

        writer

        +
        protected Appendable writer
        +
        The writer that will receive the output.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONWriter

        +
        public JSONWriter(Appendable w)
        +
        Make a fresh JSONWriter. It can be used to build one JSON text.
        +
        +
        Parameters:
        +
        w - an appendable object
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        array

        +
        public JSONWriter array()
        +                 throws JSONException
        +
        Begin appending a new array. All values until the balancing + endArray will be appended to this array. The + endArray method must be called to mark the array's end.
        +
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If the nesting is too deep, or if the object is + started in the wrong place (for example as a key or after the end of the + outermost array or object).
        +
        +
      • +
      + + + +
        +
      • +

        endArray

        +
        public JSONWriter endArray()
        +                    throws JSONException
        +
        End an array. This method most be called to balance calls to + array.
        +
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If incorrectly nested.
        +
        +
      • +
      + + + +
        +
      • +

        endObject

        +
        public JSONWriter endObject()
        +                     throws JSONException
        +
        End an object. This method most be called to balance calls to + object.
        +
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If incorrectly nested.
        +
        +
      • +
      + + + +
        +
      • +

        key

        +
        public JSONWriter key(String string)
        +               throws JSONException
        +
        Append a key. The key will be associated with the next value. In an + object, every value must be preceded by a key.
        +
        +
        Parameters:
        +
        string - A key string.
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If the key is out of place. For example, keys + do not belong in arrays or if the key is null.
        +
        +
      • +
      + + + +
        +
      • +

        object

        +
        public JSONWriter object()
        +                  throws JSONException
        +
        Begin appending a new object. All keys and values until the balancing + endObject will be appended to this object. The + endObject method must be called to mark the object's end.
        +
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If the nesting is too deep, or if the object is + started in the wrong place (for example as a key or after the end of the + outermost array or object).
        +
        +
      • +
      + + + +
        +
      • +

        valueToString

        +
        public static String valueToString(Object value)
        +                            throws JSONException
        +
        Make a JSON text of an Object value. If the object has an + value.toJSONString() method, then that method will be used to produce the + JSON text. The method is required to produce a strictly conforming text. + If the object does not contain a toJSONString method (which is the most + common case), then a text will be produced by other means. If the value + is an array or Collection, then a JSONArray will be made from it and its + toJSONString method will be called. If the value is a MAP, then a + JSONObject will be made from it and its toJSONString method will be + called. Otherwise, the value's toString method will be called, and the + result will be quoted. + +

        + Warning: This method assumes that the data structure is acyclical.

        +
        +
        Parameters:
        +
        value - The value to be serialized.
        +
        Returns:
        +
        a printable, displayable, transmittable representation of the + object, beginning with { (left + brace) and ending with } (right + brace).
        +
        Throws:
        +
        JSONException - If the value is or contains an invalid number.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        public JSONWriter value(boolean b)
        +                 throws JSONException
        +
        Append either the value true or the value + false.
        +
        +
        Parameters:
        +
        b - A boolean.
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - if a called function has an error
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        public JSONWriter value(double d)
        +                 throws JSONException
        +
        Append a double value.
        +
        +
        Parameters:
        +
        d - A double.
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If the number is not finite.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        public JSONWriter value(long l)
        +                 throws JSONException
        +
        Append a long value.
        +
        +
        Parameters:
        +
        l - A long.
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - if a called function has an error
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        public JSONWriter value(Object object)
        +                 throws JSONException
        +
        Append an object value.
        +
        +
        Parameters:
        +
        object - The object to append. It can be null, or a Boolean, Number, + String, JSONObject, or JSONArray, or an object that implements JSONString.
        +
        Returns:
        +
        this
        +
        Throws:
        +
        JSONException - If the value is out of sequence.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/Property.html b/docs/org/json/Property.html similarity index 71% rename from org/json/Property.html rename to docs/org/json/Property.html index fd776ba..5107c81 100644 --- a/org/json/Property.html +++ b/docs/org/json/Property.html @@ -1,315 +1,305 @@ - - - - - - -Property (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class Property

-
-
- -
-
    -
  • -
    -
    -
    public class Property
    -extends java.lang.Object
    -
    Converts a Property file data into JSONObject and back.
    -
    -
    Version:
    -
    2015-05-05
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      Property() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static JSONObjecttoJSONObject(java.util.Properties properties) -
      Converts a property file object into a JSONObject.
      -
      static java.util.PropertiestoProperties(JSONObject jo) -
      Converts the JSONObject into a property file object.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        Property

        -
        public Property()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(java.util.Properties properties)
        -                               throws JSONException
        -
        Converts a property file object into a JSONObject. The property file object is a table of name value pairs.
        -
        -
        Parameters:
        -
        properties - java.util.Properties
        -
        Returns:
        -
        JSONObject
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toProperties

        -
        public static java.util.Properties toProperties(JSONObject jo)
        -                                         throws JSONException
        -
        Converts the JSONObject into a property file object.
        -
        -
        Parameters:
        -
        jo - JSONObject
        -
        Returns:
        -
        java.util.Properties
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Property + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class Property

+
+
+ +
+
    +
  • +
    +
    +
    public class Property
    +extends Object
    +
    Converts a Property file data into JSONObject and back.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Property

        +
        public Property()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(Properties properties)
        +                               throws JSONException
        +
        Converts a property file object into a JSONObject. The property file object is a table of name value pairs.
        +
        +
        Parameters:
        +
        properties - java.util.Properties
        +
        Returns:
        +
        JSONObject
        +
        Throws:
        +
        JSONException - if a called function has an error
        +
        +
      • +
      + + + +
        +
      • +

        toProperties

        +
        public static Properties toProperties(JSONObject jo)
        +                               throws JSONException
        +
        Converts the JSONObject into a property file object.
        +
        +
        Parameters:
        +
        jo - JSONObject
        +
        Returns:
        +
        java.util.Properties
        +
        Throws:
        +
        JSONException - if a called function has an error
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/XML.html b/docs/org/json/XML.html new file mode 100644 index 0000000..6d09691 --- /dev/null +++ b/docs/org/json/XML.html @@ -0,0 +1,902 @@ + + + + + +XML + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class XML

+
+
+ +
+
    +
  • +
    +
    +
    public class XML
    +extends Object
    +
    This provides static methods to convert an XML text into a JSONObject, and to + covert a JSONObject into an XML text.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        AMP

        +
        public static final Character AMP
        +
        The Character '&'.
        +
      • +
      + + + +
        +
      • +

        APOS

        +
        public static final Character APOS
        +
        The Character '''.
        +
      • +
      + + + +
        +
      • +

        BANG

        +
        public static final Character BANG
        +
        The Character '!'.
        +
      • +
      + + + +
        +
      • +

        EQ

        +
        public static final Character EQ
        +
        The Character '='.
        +
      • +
      + + + +
        +
      • +

        GT

        +
        public static final Character GT
        +
        The Character
         '>'. 
        +
      • +
      + + + +
        +
      • +

        LT

        +
        public static final Character LT
        +
        The Character '<'.
        +
      • +
      + + + +
        +
      • +

        QUEST

        +
        public static final Character QUEST
        +
        The Character '?'.
        +
      • +
      + + + +
        +
      • +

        QUOT

        +
        public static final Character QUOT
        +
        The Character '"'.
        +
      • +
      + + + +
        +
      • +

        SLASH

        +
        public static final Character SLASH
        +
        The Character '/'.
        +
      • +
      + + + + + + + + +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XML

        +
        public XML()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        escape

        +
        public static String escape(String string)
        +
        Replace special characters with XML escapes: + +
         
        + &amp; (ampersand) is replaced by &amp;amp;
        + &lt; (less than) is replaced by &amp;lt;
        + &gt; (greater than) is replaced by &amp;gt;
        + &quot; (double quote) is replaced by &amp;quot;
        + &apos; (single quote / apostrophe) is replaced by &amp;apos;
        + 
        +
        +
        Parameters:
        +
        string - The string to be escaped.
        +
        Returns:
        +
        The escaped string.
        +
        +
      • +
      + + + +
        +
      • +

        unescape

        +
        public static String unescape(String string)
        +
        Removes XML escapes from the string.
        +
        +
        Parameters:
        +
        string - string to remove escapes from
        +
        Returns:
        +
        string with converted entities
        +
        +
      • +
      + + + +
        +
      • +

        noSpace

        +
        public static void noSpace(String string)
        +                    throws JSONException
        +
        Throw an exception if the string contains whitespace. Whitespace is not + allowed in tagNames and attributes.
        +
        +
        Parameters:
        +
        string - A string.
        +
        Throws:
        +
        JSONException - Thrown if the string contains whitespace or is empty.
        +
        +
      • +
      + + + +
        +
      • +

        stringToValue

        +
        public static Object stringToValue(String string,
        +                                   XMLXsiTypeConverter<?> typeConverter)
        +
        This method tries to convert the given string value to the target object
        +
        +
        Parameters:
        +
        string - String to convert
        +
        typeConverter - value converter to convert string to integer, boolean e.t.c
        +
        Returns:
        +
        JSON value of this string or the string
        +
        +
      • +
      + + + +
        +
      • +

        stringToValue

        +
        public static Object stringToValue(String string)
        +
        This method is the same as JSONObject.stringToValue(String).
        +
        +
        Parameters:
        +
        string - String to convert
        +
        Returns:
        +
        JSON value of this string or the string
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject. Some information may be lost in this transformation because + JSON is a data format and XML is a document format. XML uses elements, + attributes, and content text, while JSON uses unordered collections of + name/value pairs and arrays of values. JSON does not does not like to + distinguish between elements and attributes. Sequences of similar + elements are represented as JSONArrays. Content text may be placed in a + "content" member. Comments, prologs, DTDs, and
         
        + &lt;[ [ ]]>
        + are ignored.
        +
        +
        Parameters:
        +
        string - The source string.
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown if there is an errors while parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(Reader reader)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML into a + JSONObject. Some information may be lost in this transformation because + JSON is a data format and XML is a document format. XML uses elements, + attributes, and content text, while JSON uses unordered collections of + name/value pairs and arrays of values. JSON does not does not like to + distinguish between elements and attributes. Sequences of similar + elements are represented as JSONArrays. Content text may be placed in a + "content" member. Comments, prologs, DTDs, and
         
        + &lt;[ [ ]]>
        + are ignored.
        +
        +
        Parameters:
        +
        reader - The XML source reader.
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown if there is an errors while parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(Reader reader,
        +                                      boolean keepStrings)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML into a + JSONObject. Some information may be lost in this transformation because + JSON is a data format and XML is a document format. XML uses elements, + attributes, and content text, while JSON uses unordered collections of + name/value pairs and arrays of values. JSON does not does not like to + distinguish between elements and attributes. Sequences of similar + elements are represented as JSONArrays. Content text may be placed in a + "content" member. Comments, prologs, DTDs, and
        
        + &lt;[ [ ]]>
        + are ignored. + + All values are converted as strings, for 1, 01, 29.0 will not be coerced to + numbers but will instead be the exact value as seen in the XML document.
        +
        +
        Parameters:
        +
        reader - The XML source reader.
        +
        keepStrings - If true, then values will not be coerced into boolean + or numeric values and will instead be left as strings
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown if there is an errors while parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(Reader reader,
        +                                      XMLParserConfiguration config)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML into a + JSONObject. Some information may be lost in this transformation because + JSON is a data format and XML is a document format. XML uses elements, + attributes, and content text, while JSON uses unordered collections of + name/value pairs and arrays of values. JSON does not does not like to + distinguish between elements and attributes. Sequences of similar + elements are represented as JSONArrays. Content text may be placed in a + "content" member. Comments, prologs, DTDs, and
        
        + &lt;[ [ ]]>
        + are ignored. + + All values are converted as strings, for 1, 01, 29.0 will not be coerced to + numbers but will instead be the exact value as seen in the XML document.
        +
        +
        Parameters:
        +
        reader - The XML source reader.
        +
        config - Configuration options for the parser
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown if there is an errors while parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string,
        +                                      boolean keepStrings)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject. Some information may be lost in this transformation because + JSON is a data format and XML is a document format. XML uses elements, + attributes, and content text, while JSON uses unordered collections of + name/value pairs and arrays of values. JSON does not does not like to + distinguish between elements and attributes. Sequences of similar + elements are represented as JSONArrays. Content text may be placed in a + "content" member. Comments, prologs, DTDs, and
         
        + &lt;[ [ ]]>
        + are ignored. + + All values are converted as strings, for 1, 01, 29.0 will not be coerced to + numbers but will instead be the exact value as seen in the XML document.
        +
        +
        Parameters:
        +
        string - The source string.
        +
        keepStrings - If true, then values will not be coerced into boolean + or numeric values and will instead be left as strings
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown if there is an errors while parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toJSONObject

        +
        public static JSONObject toJSONObject(String string,
        +                                      XMLParserConfiguration config)
        +                               throws JSONException
        +
        Convert a well-formed (but not necessarily valid) XML string into a + JSONObject. Some information may be lost in this transformation because + JSON is a data format and XML is a document format. XML uses elements, + attributes, and content text, while JSON uses unordered collections of + name/value pairs and arrays of values. JSON does not does not like to + distinguish between elements and attributes. Sequences of similar + elements are represented as JSONArrays. Content text may be placed in a + "content" member. Comments, prologs, DTDs, and
         
        + &lt;[ [ ]]>
        + are ignored. + + All values are converted as strings, for 1, 01, 29.0 will not be coerced to + numbers but will instead be the exact value as seen in the XML document.
        +
        +
        Parameters:
        +
        string - The source string.
        +
        config - Configuration options for the parser.
        +
        Returns:
        +
        A JSONObject containing the structured data from the XML string.
        +
        Throws:
        +
        JSONException - Thrown if there is an errors while parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(Object object)
        +                       throws JSONException
        +
        Convert a JSONObject into a well-formed, element-normal XML string.
        +
        +
        Parameters:
        +
        object - A JSONObject.
        +
        Returns:
        +
        A string.
        +
        Throws:
        +
        JSONException - Thrown if there is an error parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(Object object,
        +                              String tagName)
        +
        Convert a JSONObject into a well-formed, element-normal XML string.
        +
        +
        Parameters:
        +
        object - A JSONObject.
        +
        tagName - The optional name of the enclosing tag.
        +
        Returns:
        +
        A string.
        +
        Throws:
        +
        JSONException - Thrown if there is an error parsing the string
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public static String toString(Object object,
        +                              String tagName,
        +                              XMLParserConfiguration config)
        +                       throws JSONException
        +
        Convert a JSONObject into a well-formed, element-normal XML string.
        +
        +
        Parameters:
        +
        object - A JSONObject.
        +
        tagName - The optional name of the enclosing tag.
        +
        config - Configuration that can control output to XML.
        +
        Returns:
        +
        A string.
        +
        Throws:
        +
        JSONException - Thrown if there is an error parsing the string
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/XMLParserConfiguration.html b/docs/org/json/XMLParserConfiguration.html new file mode 100644 index 0000000..968da69 --- /dev/null +++ b/docs/org/json/XMLParserConfiguration.html @@ -0,0 +1,657 @@ + + + + + +XMLParserConfiguration + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class XMLParserConfiguration

+
+
+ +
+
    +
  • +
    +
    +
    public class XMLParserConfiguration
    +extends Object
    +
    Configuration object for the XML parser. The configuration is immutable.
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      XMLParserConfiguration() +
      Default parser configuration.
      +
      XMLParserConfiguration(boolean keepStrings) +
      Deprecated.  +
      This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
      +
      +
      XMLParserConfiguration(boolean keepStrings, + String cDataTagName) +
      Deprecated.  +
      This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
      +
      +
      XMLParserConfiguration(boolean keepStrings, + String cDataTagName, + boolean convertNilAttributeToNull) +
      Deprecated.  +
      This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed or marked private in a future release.
      +
      +
      XMLParserConfiguration(String cDataTagName) +
      Deprecated.  +
      This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
      +
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      protected XMLParserConfigurationclone() +
      Provides a new instance of the same configuration.
      +
      StringgetcDataTagName() +
      The name of the key in a JSON Object that indicates a CDATA section.
      +
      Map<String,XMLXsiTypeConverter<?>>getXsiTypeMap() +
      When parsing the XML into JSON, specifies that the values with attribute xsi:type + will be converted to target type defined to client in this configuration + Map<String, XMLXsiTypeConverter<?>> to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
      +
      booleanisConvertNilAttributeToNull() +
      When parsing the XML into JSON, specifies if values with attribute xsi:nil="true" + should be kept as attribute(false), or they should be converted to + null(true)
      +
      booleanisKeepStrings() +
      When parsing the XML into JSON, specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string)
      +
      XMLParserConfigurationwithcDataTagName(String newVal) +
      The name of the key in a JSON Object that indicates a CDATA section.
      +
      XMLParserConfigurationwithConvertNilAttributeToNull(boolean newVal) +
      When parsing the XML into JSON, specifies if values with attribute xsi:nil="true" + should be kept as attribute(false), or they should be converted to + null(true)
      +
      XMLParserConfigurationwithKeepStrings(boolean newVal) +
      When parsing the XML into JSON, specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string)
      +
      XMLParserConfigurationwithXsiTypeMap(Map<String,XMLXsiTypeConverter<?>> xsiTypeMap) +
      When parsing the XML into JSON, specifies that the values with attribute xsi:type + will be converted to target type defined to client in this configuration + Map<String, XMLXsiTypeConverter<?>> to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
      +
      + +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        ORIGINAL

        +
        public static final XMLParserConfiguration ORIGINAL
        +
        Original Configuration of the XML Parser.
        +
      • +
      + + + +
        +
      • +

        KEEP_STRINGS

        +
        public static final XMLParserConfiguration KEEP_STRINGS
        +
        Original configuration of the XML Parser except that values are kept as strings.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XMLParserConfiguration

        +
        public XMLParserConfiguration()
        +
        Default parser configuration. Does not keep strings (tries to implicitly convert + values), and the CDATA Tag Name is "content".
        +
      • +
      + + + +
        +
      • +

        XMLParserConfiguration

        +
        @Deprecated
        +public XMLParserConfiguration(boolean keepStrings)
        +
        Deprecated. This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
        +
        Configure the parser string processing and use the default CDATA Tag Name as "content".
        +
        +
        Parameters:
        +
        keepStrings - true to parse all values as string. + false to try and convert XML string values into a JSON value.
        +
        +
      • +
      + + + +
        +
      • +

        XMLParserConfiguration

        +
        @Deprecated
        +public XMLParserConfiguration(String cDataTagName)
        +
        Deprecated. This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
        +
        Configure the parser string processing to try and convert XML values to JSON values and + use the passed CDATA Tag Name the processing value. Pass null to + disable CDATA processing
        +
        +
        Parameters:
        +
        cDataTagNamenull - to disable CDATA processing. Any other value + to use that value as the JSONObject key name to process as CDATA.
        +
        +
      • +
      + + + +
        +
      • +

        XMLParserConfiguration

        +
        @Deprecated
        +public XMLParserConfiguration(boolean keepStrings,
        +                                           String cDataTagName)
        +
        Deprecated. This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed in a future release.
        +
        Configure the parser to use custom settings.
        +
        +
        Parameters:
        +
        keepStrings - true to parse all values as string. + false to try and convert XML string values into a JSON value.
        +
        cDataTagNamenull - to disable CDATA processing. Any other value + to use that value as the JSONObject key name to process as CDATA.
        +
        +
      • +
      + + + +
        +
      • +

        XMLParserConfiguration

        +
        @Deprecated
        +public XMLParserConfiguration(boolean keepStrings,
        +                                           String cDataTagName,
        +                                           boolean convertNilAttributeToNull)
        +
        Deprecated. This constructor has been deprecated in favor of using the new builder + pattern for the configuration. + This constructor may be removed or marked private in a future release.
        +
        Configure the parser to use custom settings.
        +
        +
        Parameters:
        +
        keepStrings - true to parse all values as string. + false to try and convert XML string values into a JSON value.
        +
        cDataTagName - null to disable CDATA processing. Any other value + to use that value as the JSONObject key name to process as CDATA.
        +
        convertNilAttributeToNull - true to parse values with attribute xsi:nil="true" as null. + false to parse values with attribute xsi:nil="true" as {"xsi:nil":true}.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        isKeepStrings

        +
        public boolean isKeepStrings()
        +
        When parsing the XML into JSON, specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string)
        +
        +
        Returns:
        +
        The keepStrings configuration value.
        +
        +
      • +
      + + + +
        +
      • +

        withKeepStrings

        +
        public XMLParserConfiguration withKeepStrings(boolean newVal)
        +
        When parsing the XML into JSON, specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string)
        +
        +
        Parameters:
        +
        newVal - new value to use for the keepStrings configuration option.
        +
        Returns:
        +
        The existing configuration will not be modified. A new configuration is returned.
        +
        +
      • +
      + + + +
        +
      • +

        getcDataTagName

        +
        public String getcDataTagName()
        +
        The name of the key in a JSON Object that indicates a CDATA section. Historically this has + been the value "content" but can be changed. Use null to indicate no CDATA + processing.
        +
        +
        Returns:
        +
        The cDataTagName configuration value.
        +
        +
      • +
      + + + +
        +
      • +

        withcDataTagName

        +
        public XMLParserConfiguration withcDataTagName(String newVal)
        +
        The name of the key in a JSON Object that indicates a CDATA section. Historically this has + been the value "content" but can be changed. Use null to indicate no CDATA + processing.
        +
        +
        Parameters:
        +
        newVal - new value to use for the cDataTagName configuration option.
        +
        Returns:
        +
        The existing configuration will not be modified. A new configuration is returned.
        +
        +
      • +
      + + + +
        +
      • +

        isConvertNilAttributeToNull

        +
        public boolean isConvertNilAttributeToNull()
        +
        When parsing the XML into JSON, specifies if values with attribute xsi:nil="true" + should be kept as attribute(false), or they should be converted to + null(true)
        +
        +
        Returns:
        +
        The convertNilAttributeToNull configuration value.
        +
        +
      • +
      + + + +
        +
      • +

        withConvertNilAttributeToNull

        +
        public XMLParserConfiguration withConvertNilAttributeToNull(boolean newVal)
        +
        When parsing the XML into JSON, specifies if values with attribute xsi:nil="true" + should be kept as attribute(false), or they should be converted to + null(true)
        +
        +
        Parameters:
        +
        newVal - new value to use for the convertNilAttributeToNull configuration option.
        +
        Returns:
        +
        The existing configuration will not be modified. A new configuration is returned.
        +
        +
      • +
      + + + +
        +
      • +

        getXsiTypeMap

        +
        public Map<String,XMLXsiTypeConverter<?>> getXsiTypeMap()
        +
        When parsing the XML into JSON, specifies that the values with attribute xsi:type + will be converted to target type defined to client in this configuration + Map<String, XMLXsiTypeConverter<?>> to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
        +
        +
        Returns:
        +
        xsiTypeMap unmodifiable configuration map.
        +
        +
      • +
      + + + +
        +
      • +

        withXsiTypeMap

        +
        public XMLParserConfiguration withXsiTypeMap(Map<String,XMLXsiTypeConverter<?>> xsiTypeMap)
        +
        When parsing the XML into JSON, specifies that the values with attribute xsi:type + will be converted to target type defined to client in this configuration + Map<String, XMLXsiTypeConverter<?>> to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
        +
        +
        Parameters:
        +
        xsiTypeMap - new HashMap<String, XMLXsiTypeConverter<?>>() to parse values with attribute + xsi:type="integer" as integer, xsi:type="string" as string
        +
        Returns:
        +
        The existing configuration will not be modified. A new configuration is returned.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/XMLTokener.html b/docs/org/json/XMLTokener.html similarity index 60% rename from org/json/XMLTokener.html rename to docs/org/json/XMLTokener.html index 2bc29c9..949970c 100644 --- a/org/json/XMLTokener.html +++ b/docs/org/json/XMLTokener.html @@ -1,477 +1,494 @@ - - - - - - -XMLTokener (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class XMLTokener

-
-
- -
-
    -
  • -
    -
    -
    public class XMLTokener
    -extends JSONTokener
    -
    The XMLTokener extends the JSONTokener to provide additional methods - for the parsing of XML texts.
    -
    -
    Version:
    -
    2015-12-09
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Summary

      - - - - - - - - - - -
      Fields 
      Modifier and TypeField and Description
      static java.util.HashMap<java.lang.String,java.lang.Character>entity -
      The table of entity values.
      -
      -
    • -
    - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      XMLTokener(java.lang.String s) -
      Construct an XMLTokener from a string.
      -
      -
    • -
    - - -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        entity

        -
        public static final java.util.HashMap<java.lang.String,java.lang.Character> entity
        -
        The table of entity values. It initially contains Character values for - amp, apos, gt, lt, quot.
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        XMLTokener

        -
        public XMLTokener(java.lang.String s)
        -
        Construct an XMLTokener from a string.
        -
        -
        Parameters:
        -
        s - A source string.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        nextCDATA

        -
        public java.lang.String nextCDATA()
        -                           throws JSONException
        -
        Get the text in the CDATA block.
        -
        -
        Returns:
        -
        The string up to the ]]>.
        -
        Throws:
        -
        JSONException - If the ]]> is not found.
        -
        -
      • -
      - - - -
        -
      • -

        nextContent

        -
        public java.lang.Object nextContent()
        -                             throws JSONException
        -
        Get the next XML outer token, trimming whitespace. There are two kinds - of tokens: the '<' character which begins a markup tag, and the content - text between markup tags.
        -
        -
        Returns:
        -
        A string, or a '<' Character, or null if there is no more - source text.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        nextEntity

        -
        public java.lang.Object nextEntity(char ampersand)
        -                            throws JSONException
        -
        Return the next entity. These entities are translated to Characters: - & ' > < ".
        -
        -
        Parameters:
        -
        ampersand - An ampersand character.
        -
        Returns:
        -
        A Character or an entity String if the entity is not recognized.
        -
        Throws:
        -
        JSONException - If missing ';' in XML entity.
        -
        -
      • -
      - - - -
        -
      • -

        nextMeta

        -
        public java.lang.Object nextMeta()
        -                          throws JSONException
        -
        Returns the next XML meta token. This is used for skipping over - and structures.
        -
        -
        Returns:
        -
        Syntax characters (< > / = ! ?) are returned as - Character, and strings and names are returned as Boolean. We don't care - what the values actually are.
        -
        Throws:
        -
        JSONException - If a string is not properly closed or if the XML - is badly structured.
        -
        -
      • -
      - - - -
        -
      • -

        nextToken

        -
        public java.lang.Object nextToken()
        -                           throws JSONException
        -
        Get the next XML Token. These tokens are found inside of angle - brackets. It may be one of these characters: / > = ! ? or it - may be a string wrapped in single quotes or double quotes, or it may be a - name.
        -
        -
        Returns:
        -
        a String or a Character.
        -
        Throws:
        -
        JSONException - If the XML is not well formed.
        -
        -
      • -
      - - - -
        -
      • -

        skipPast

        -
        public boolean skipPast(java.lang.String to)
        -                 throws JSONException
        -
        Skip characters until past the requested string. - If it is not found, we are left at the end of the source with a result of false.
        -
        -
        Parameters:
        -
        to - A string to skip past.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +XMLTokener + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Class XMLTokener

+
+
+ +
+
    +
  • +
    +
    +
    public class XMLTokener
    +extends JSONTokener
    +
    The XMLTokener extends the JSONTokener to provide additional methods + for the parsing of XML texts.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        entity

        +
        public static final HashMap<String,Character> entity
        +
        The table of entity values. It initially contains Character values for + amp, apos, gt, lt, quot.
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        XMLTokener

        +
        public XMLTokener(Reader r)
        +
        Construct an XMLTokener from a Reader.
        +
        +
        Parameters:
        +
        r - A source reader.
        +
        +
      • +
      + + + +
        +
      • +

        XMLTokener

        +
        public XMLTokener(String s)
        +
        Construct an XMLTokener from a string.
        +
        +
        Parameters:
        +
        s - A source string.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        nextCDATA

        +
        public String nextCDATA()
        +                 throws JSONException
        +
        Get the text in the CDATA block.
        +
        +
        Returns:
        +
        The string up to the ]]>.
        +
        Throws:
        +
        JSONException - If the ]]> is not found.
        +
        +
      • +
      + + + +
        +
      • +

        nextContent

        +
        public Object nextContent()
        +                   throws JSONException
        +
        Get the next XML outer token, trimming whitespace. There are two kinds + of tokens: the
         '<' 
        character which begins a markup + tag, and the content + text between markup tags.
        +
        +
        Returns:
        +
        A string, or a
         '<' 
        Character, or null if + there is no more source text.
        +
        Throws:
        +
        JSONException - if a called function has an error
        +
        +
      • +
      + + + +
        +
      • +

        nextEntity

        +
        public Object nextEntity(char ampersand)
        +                  throws JSONException
        +
        
        + Return the next entity. These entities are translated to Characters:
        +     &amp;  &apos;  &gt;  &lt;  &quot;.
        + 
        +
        +
        Parameters:
        +
        ampersand - An ampersand character.
        +
        Returns:
        +
        A Character or an entity String if the entity is not recognized.
        +
        Throws:
        +
        JSONException - If missing ';' in XML entity.
        +
        +
      • +
      + + + +
        +
      • +

        nextMeta

        +
        public Object nextMeta()
        +                throws JSONException
        +
         
        + Returns the next XML meta token. This is used for skipping over <!...>
        + and <?...?> structures.
        +  
        +
        +
        Returns:
        +
         Syntax characters (< > / = ! ?) are returned as
        +  Character, and strings and names are returned as Boolean. We don't care
        +  what the values actually are.
        +  
        +
        Throws:
        +
        JSONException - If a string is not properly closed or if the XML + is badly structured.
        +
        +
      • +
      + + + +
        +
      • +

        nextToken

        +
        public Object nextToken()
        +                 throws JSONException
        +
        
        + Get the next XML Token. These tokens are found inside of angle
        + brackets. It may be one of these characters: / > = ! ? or it
        + may be a string wrapped in single quotes or double quotes, or it may be a
        + name.
        + 
        +
        +
        Returns:
        +
        a String or a Character.
        +
        Throws:
        +
        JSONException - If the XML is not well formed.
        +
        +
      • +
      + + + +
        +
      • +

        skipPast

        +
        public void skipPast(String to)
        +
        Skip characters until past the requested string. + If it is not found, we are left at the end of the source with a result of false.
        +
        +
        Parameters:
        +
        to - A string to skip past.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/org/json/XMLXsiTypeConverter.html b/docs/org/json/XMLXsiTypeConverter.html new file mode 100644 index 0000000..6ac348a --- /dev/null +++ b/docs/org/json/XMLXsiTypeConverter.html @@ -0,0 +1,255 @@ + + + + + +XMLXsiTypeConverter + + + + + + + + +
+ + + + + + + +
+ + + +
+
org.json
+

Interface XMLXsiTypeConverter<T>

+
+
+
+
    +
  • +
    +
    Type Parameters:
    +
    T - return type of convert method
    +
    +
    +
    +
    public interface XMLXsiTypeConverter<T>
    +
    Type conversion configuration interface to be used with xsi:type attributes. +
    + XML Sample
    + 
    +      <root>
    +          <asString xsi:type="string">12345</asString>
    +          <asInt xsi:type="integer">54321</asInt>
    +      </root>
    + 
    + JSON Output
    + 
    +     {
    +         "root" : {
    +             "asString" : "12345",
    +             "asInt": 54321
    +         }
    +     }
    + 
    +
    + Usage
    + 
    +      Map<String, XMLXsiTypeConverter<?>> xsiTypeMap = new HashMap<String, XMLXsiTypeConverter<?>>();
    +      xsiTypeMap.put("string", new XMLXsiTypeConverter<String>() {
    +          &#64;Override public String convert(final String value) {
    +              return value;
    +          }
    +      });
    +      xsiTypeMap.put("integer", new XMLXsiTypeConverter<Integer>() {
    +          &#64;Override public Integer convert(final String value) {
    +              return Integer.valueOf(value);
    +          }
    +      });
    + 
    + 
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        convert

        +
        T convert(String value)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/org/json/package-frame.html b/docs/org/json/package-frame.html similarity index 65% rename from org/json/package-frame.html rename to docs/org/json/package-frame.html index 457bc78..0c82ac6 100644 --- a/org/json/package-frame.html +++ b/docs/org/json/package-frame.html @@ -1,42 +1,51 @@ - - - - - - -org.json (JSON in Java 20160212 API) - - - - - -

org.json

-
-

Interfaces

- -

Classes

- -

Exceptions

- -
- - + + + + + +org.json + + + + + +

org.json

+
+

Interfaces

+ +

Classes

+ +

Exceptions

+ +

Annotation Types

+ +
+ + diff --git a/org/json/package-summary.html b/docs/org/json/package-summary.html similarity index 76% rename from org/json/package-summary.html rename to docs/org/json/package-summary.html index 454222b..396d33e 100644 --- a/org/json/package-summary.html +++ b/docs/org/json/package-summary.html @@ -1,266 +1,314 @@ - - - - - - -org.json (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Package org.json

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +org.json + + + + + + + + +
+ + + + + + + +
+ + +
+

Package org.json

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/org/json/package-tree.html b/docs/org/json/package-tree.html similarity index 63% rename from org/json/package-tree.html rename to docs/org/json/package-tree.html index 0e42348..ff3e430 100644 --- a/org/json/package-tree.html +++ b/docs/org/json/package-tree.html @@ -1,169 +1,178 @@ - - - - - - -org.json Class Hierarchy (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Hierarchy For Package org.json

-
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +org.json Class Hierarchy + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package org.json

+
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/overview-tree.html b/docs/overview-tree.html similarity index 64% rename from overview-tree.html rename to docs/overview-tree.html index 4710969..5b74593 100644 --- a/overview-tree.html +++ b/docs/overview-tree.html @@ -1,173 +1,182 @@ - - - - - - -Class Hierarchy (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Hierarchy For All Packages

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Class Hierarchy + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Annotation Type Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/package-list b/docs/package-list new file mode 100644 index 0000000..ccf8418 --- /dev/null +++ b/docs/package-list @@ -0,0 +1 @@ +org.json diff --git a/docs/script.js b/docs/script.js new file mode 100644 index 0000000..c3a1cae --- /dev/null +++ b/docs/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/serialized-form.html b/docs/serialized-form.html similarity index 78% rename from serialized-form.html rename to docs/serialized-form.html index 0d203b4..4d3d6ba 100644 --- a/serialized-form.html +++ b/docs/serialized-form.html @@ -1,141 +1,146 @@ - - - - - - -Serialized Form (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Serialized Form

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - + + + + + +Serialized Form + + + + + + + + +
+ + + + + + + +
+ + +
+

Serialized Form

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/docs/stylesheet.css b/docs/stylesheet.css new file mode 100644 index 0000000..1e392db --- /dev/null +++ b/docs/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; + width:100%; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/org/json/JSONObject.html b/org/json/JSONObject.html deleted file mode 100644 index 433c9ce..0000000 --- a/org/json/JSONObject.html +++ /dev/null @@ -1,2197 +0,0 @@ - - - - - - -JSONObject (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class JSONObject

-
-
- -
-
    -
  • -
    -
    -
    public class JSONObject
    -extends java.lang.Object
    -
    A JSONObject is an unordered collection of name/value pairs. Its external - form is a string wrapped in curly braces with colons between the names and - values, and commas between the values and names. The internal form is an - object having get and opt methods for accessing - the values by name, and put methods for adding or replacing - values by name. The values can be any of these types: Boolean, - JSONArray, JSONObject, Number, - String, or the JSONObject.NULL object. A - JSONObject constructor can be used to convert an external form JSON text - into an internal form whose values can be retrieved with the - get and opt methods, or to convert values into a - JSON text using the put and toString methods. A - get method returns a value if one can be found, and throws an - exception if one cannot be found. An opt method returns a - default value instead of throwing an exception, and so is useful for - obtaining optional values. -

    - The generic get() and opt() methods return an - object, which you can cast or query for type. There are also typed - get and opt methods that do type checking and type - coercion for you. The opt methods differ from the get methods in that they - do not throw. Instead, they return a specified value, such as null. -

    - The put methods add or replace values in an object. For - example, - -

    - myString = new JSONObject()
    -         .put("JSON", "Hello, World!").toString();
    - 
    - - produces the string {"JSON": "Hello, World"}. -

    - The texts produced by the toString methods strictly conform to - the JSON syntax rules. The constructors are more forgiving in the texts they - will accept: -

      -
    • An extra , (comma) may appear just - before the closing brace.
    • -
    • Strings may be quoted with ' (single - quote).
    • -
    • Strings do not need to be quoted at all if they do not begin with a - quote or single quote, and if they do not contain leading or trailing - spaces, and if they do not contain any of these characters: - { } [ ] / \ : , # and if they do not look like numbers and - if they are not the reserved words true, false, - or null.
    • -
    -
    -
    Version:
    -
    2016-02-08
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Summary

      - - - - - - - - - - -
      Fields 
      Modifier and TypeField and Description
      static java.lang.ObjectNULL -
      It is sometimes more convenient and less ambiguous to have a - NULL object than to use Java's null value.
      -
      -
    • -
    - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Constructors 
      Constructor and Description
      JSONObject() -
      Construct an empty JSONObject.
      -
      JSONObject(JSONObject jo, - java.lang.String[] names) -
      Construct a JSONObject from a subset of another JSONObject.
      -
      JSONObject(JSONTokener x) -
      Construct a JSONObject from a JSONTokener.
      -
      JSONObject(java.util.Map<?,?> map) -
      Construct a JSONObject from a Map.
      -
      JSONObject(java.lang.Object bean) -
      Construct a JSONObject from an Object using bean getters.
      -
      JSONObject(java.lang.Object object, - java.lang.String[] names) -
      Construct a JSONObject from an Object, using reflection to find the - public members.
      -
      JSONObject(java.lang.String source) -
      Construct a JSONObject from a source JSON text string.
      -
      JSONObject(java.lang.String baseName, - java.util.Locale locale) -
      Construct a JSONObject from a ResourceBundle.
      -
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      JSONObjectaccumulate(java.lang.String key, - java.lang.Object value) -
      Accumulate values under a key.
      -
      JSONObjectappend(java.lang.String key, - java.lang.Object value) -
      Append values to the array under a key.
      -
      static java.lang.StringdoubleToString(double d) -
      Produce a string from a double.
      -
      java.lang.Objectget(java.lang.String key) -
      Get the value object associated with a key.
      -
      java.math.BigDecimalgetBigDecimal(java.lang.String key) -
      Get the BigDecimal value associated with a key.
      -
      java.math.BigIntegergetBigInteger(java.lang.String key) -
      Get the BigInteger value associated with a key.
      -
      booleangetBoolean(java.lang.String key) -
      Get the boolean value associated with a key.
      -
      doublegetDouble(java.lang.String key) -
      Get the double value associated with a key.
      -
      <E extends java.lang.Enum<E>>
      E
      getEnum(java.lang.Class<E> clazz, - java.lang.String key) -
      Get the enum value associated with a key.
      -
      intgetInt(java.lang.String key) -
      Get the int value associated with a key.
      -
      JSONArraygetJSONArray(java.lang.String key) -
      Get the JSONArray value associated with a key.
      -
      JSONObjectgetJSONObject(java.lang.String key) -
      Get the JSONObject value associated with a key.
      -
      longgetLong(java.lang.String key) -
      Get the long value associated with a key.
      -
      static java.lang.String[]getNames(JSONObject jo) -
      Get an array of field names from a JSONObject.
      -
      static java.lang.String[]getNames(java.lang.Object object) -
      Get an array of field names from an Object.
      -
      java.lang.StringgetString(java.lang.String key) -
      Get the string associated with a key.
      -
      booleanhas(java.lang.String key) -
      Determine if the JSONObject contains a specific key.
      -
      JSONObjectincrement(java.lang.String key) -
      Increment a property of a JSONObject.
      -
      booleanisNull(java.lang.String key) -
      Determine if the value associated with the key is null or if there is no - value.
      -
      java.util.Iterator<java.lang.String>keys() -
      Get an enumeration of the keys of the JSONObject.
      -
      java.util.Set<java.lang.String>keySet() -
      Get a set of keys of the JSONObject.
      -
      intlength() -
      Get the number of keys stored in the JSONObject.
      -
      JSONArraynames() -
      Produce a JSONArray containing the names of the elements of this - JSONObject.
      -
      static java.lang.StringnumberToString(java.lang.Number number) -
      Produce a string from a Number.
      -
      java.lang.Objectopt(java.lang.String key) -
      Get an optional value associated with a key.
      -
      java.math.BigDecimaloptBigDecimal(java.lang.String key, - java.math.BigDecimal defaultValue) -
      Get an optional BigDecimal associated with a key, or the defaultValue if - there is no such key or if its value is not a number.
      -
      java.math.BigIntegeroptBigInteger(java.lang.String key, - java.math.BigInteger defaultValue) -
      Get an optional BigInteger associated with a key, or the defaultValue if - there is no such key or if its value is not a number.
      -
      booleanoptBoolean(java.lang.String key) -
      Get an optional boolean associated with a key.
      -
      booleanoptBoolean(java.lang.String key, - boolean defaultValue) -
      Get an optional boolean associated with a key.
      -
      doubleoptDouble(java.lang.String key) -
      Get an optional double associated with a key, or NaN if there is no such - key or if its value is not a number.
      -
      doubleoptDouble(java.lang.String key, - double defaultValue) -
      Get an optional double associated with a key, or the defaultValue if - there is no such key or if its value is not a number.
      -
      <E extends java.lang.Enum<E>>
      E
      optEnum(java.lang.Class<E> clazz, - java.lang.String key) -
      Get the enum value associated with a key.
      -
      <E extends java.lang.Enum<E>>
      E
      optEnum(java.lang.Class<E> clazz, - java.lang.String key, - E defaultValue) -
      Get the enum value associated with a key.
      -
      intoptInt(java.lang.String key) -
      Get an optional int value associated with a key, or zero if there is no - such key or if the value is not a number.
      -
      intoptInt(java.lang.String key, - int defaultValue) -
      Get an optional int value associated with a key, or the default if there - is no such key or if the value is not a number.
      -
      JSONArrayoptJSONArray(java.lang.String key) -
      Get an optional JSONArray associated with a key.
      -
      JSONObjectoptJSONObject(java.lang.String key) -
      Get an optional JSONObject associated with a key.
      -
      longoptLong(java.lang.String key) -
      Get an optional long value associated with a key, or zero if there is no - such key or if the value is not a number.
      -
      longoptLong(java.lang.String key, - long defaultValue) -
      Get an optional long value associated with a key, or the default if there - is no such key or if the value is not a number.
      -
      java.lang.StringoptString(java.lang.String key) -
      Get an optional string associated with a key.
      -
      java.lang.StringoptString(java.lang.String key, - java.lang.String defaultValue) -
      Get an optional string associated with a key.
      -
      JSONObjectput(java.lang.String key, - boolean value) -
      Put a key/boolean pair in the JSONObject.
      -
      JSONObjectput(java.lang.String key, - java.util.Collection<?> value) -
      Put a key/value pair in the JSONObject, where the value will be a - JSONArray which is produced from a Collection.
      -
      JSONObjectput(java.lang.String key, - double value) -
      Put a key/double pair in the JSONObject.
      -
      JSONObjectput(java.lang.String key, - int value) -
      Put a key/int pair in the JSONObject.
      -
      JSONObjectput(java.lang.String key, - long value) -
      Put a key/long pair in the JSONObject.
      -
      JSONObjectput(java.lang.String key, - java.util.Map<?,?> value) -
      Put a key/value pair in the JSONObject, where the value will be a - JSONObject which is produced from a Map.
      -
      JSONObjectput(java.lang.String key, - java.lang.Object value) -
      Put a key/value pair in the JSONObject.
      -
      JSONObjectputOnce(java.lang.String key, - java.lang.Object value) -
      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.
      -
      JSONObjectputOpt(java.lang.String key, - java.lang.Object value) -
      Put a key/value pair in the JSONObject, but only if the key and the value - are both non-null.
      -
      static java.lang.Stringquote(java.lang.String string) -
      Produce a string in double quotes with backslash sequences in all the - right places.
      -
      static java.io.Writerquote(java.lang.String string, - java.io.Writer w) 
      java.lang.Objectremove(java.lang.String key) -
      Remove a name and its value, if present.
      -
      booleansimilar(java.lang.Object other) -
      Determine if two JSONObjects are similar.
      -
      static java.lang.ObjectstringToValue(java.lang.String string) -
      Try to convert a string into a number, boolean, or null.
      -
      static voidtestValidity(java.lang.Object o) -
      Throw an exception if the object is a NaN or infinite number.
      -
      JSONArraytoJSONArray(JSONArray names) -
      Produce a JSONArray containing the values of the members of this - JSONObject.
      -
      java.lang.StringtoString() -
      Make a JSON text of this JSONObject.
      -
      java.lang.StringtoString(int indentFactor) -
      Make a prettyprinted JSON text of this JSONObject.
      -
      static java.lang.StringvalueToString(java.lang.Object value) -
      Make a JSON text of an Object value.
      -
      static java.lang.Objectwrap(java.lang.Object object) -
      Wrap an object, if necessary.
      -
      java.io.Writerwrite(java.io.Writer writer) -
      Write the contents of the JSONObject as JSON text to a writer.
      -
      java.io.Writerwrite(java.io.Writer writer, - int indentFactor, - int indent) -
      Write the contents of the JSONObject as JSON text to a writer.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        NULL

        -
        public static final java.lang.Object NULL
        -
        It is sometimes more convenient and less ambiguous to have a - NULL object than to use Java's null value. - JSONObject.NULL.equals(null) returns true. - JSONObject.NULL.toString() returns "null".
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject()
        -
        Construct an empty JSONObject.
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(JSONObject jo,
        -                  java.lang.String[] names)
        -
        Construct a JSONObject from a subset of another JSONObject. An array of - strings is used to identify the keys that should be copied. Missing keys - are ignored.
        -
        -
        Parameters:
        -
        jo - A JSONObject.
        -
        names - An array of strings.
        -
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(JSONTokener x)
        -           throws JSONException
        -
        Construct a JSONObject from a JSONTokener.
        -
        -
        Parameters:
        -
        x - A JSONTokener object containing the source string.
        -
        Throws:
        -
        JSONException - If there is a syntax error in the source string or a - duplicated key.
        -
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(java.util.Map<?,?> map)
        -
        Construct a JSONObject from a Map.
        -
        -
        Parameters:
        -
        map - A map object that can be used to initialize the contents of - the JSONObject.
        -
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(java.lang.Object bean)
        -
        Construct a JSONObject from an Object using bean getters. It reflects on - all of the public methods of the object. For each of the methods with no - parameters and a name starting with "get" or - "is" followed by an uppercase letter, the method is invoked, - and a key and the value returned from the getter method are put into the - new JSONObject. - - The key is formed by removing the "get" or "is" - prefix. If the second remaining character is not upper case, then the - first character is converted to lower case. - - For example, if an object has a method named "getName", and - if the result of calling object.getName() is - "Larry Fine", then the JSONObject will contain - "name": "Larry Fine".
        -
        -
        Parameters:
        -
        bean - An object that has getter methods that should be used to make - a JSONObject.
        -
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(java.lang.Object object,
        -                  java.lang.String[] names)
        -
        Construct a JSONObject from an Object, using reflection to find the - public members. The resulting JSONObject's keys will be the strings from - the names array, and the values will be the field values associated with - those keys in the object. If a key is not found or not visible, then it - will not be copied into the new JSONObject.
        -
        -
        Parameters:
        -
        object - An object that has fields that should be used to make a - JSONObject.
        -
        names - An array of strings, the names of the fields to be obtained - from the object.
        -
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(java.lang.String source)
        -           throws JSONException
        -
        Construct a JSONObject from a source JSON text string. This is the most - commonly used JSONObject constructor.
        -
        -
        Parameters:
        -
        source - A string beginning with { (left - brace) and ending with } -  (right brace).
        -
        Throws:
        -
        JSONException - If there is a syntax error in the source string or a - duplicated key.
        -
        -
      • -
      - - - -
        -
      • -

        JSONObject

        -
        public JSONObject(java.lang.String baseName,
        -                  java.util.Locale locale)
        -           throws JSONException
        -
        Construct a JSONObject from a ResourceBundle.
        -
        -
        Parameters:
        -
        baseName - The ResourceBundle base name.
        -
        locale - The Locale to load the ResourceBundle for.
        -
        Throws:
        -
        JSONException - If any JSONExceptions are detected.
        -
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        accumulate

        -
        public JSONObject accumulate(java.lang.String key,
        -                             java.lang.Object value)
        -                      throws JSONException
        -
        Accumulate values under a key. It is similar to the put method except - that if there is already an object stored under the key then a JSONArray - is stored under the key to hold all of the accumulated values. If there - is already a JSONArray, then the new value is appended to it. In - contrast, the put method replaces the previous value. - - If only one value is accumulated that is not a JSONArray, then the result - will be the same as using put. But if multiple values are accumulated, - then the result will be like append.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - An object to be accumulated under the key.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the value is an invalid number or if the key is null.
        -
        -
      • -
      - - - -
        -
      • -

        append

        -
        public JSONObject append(java.lang.String key,
        -                         java.lang.Object value)
        -                  throws JSONException
        -
        Append values to the array under a key. If the key does not exist in the - JSONObject, then the key is put in the JSONObject with its value being a - JSONArray containing the value parameter. If the key was already - associated with a JSONArray, then the value parameter is appended to it.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - An object to be accumulated under the key.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the key is null or if the current value associated with - the key is not a JSONArray.
        -
        -
      • -
      - - - -
        -
      • -

        doubleToString

        -
        public static java.lang.String doubleToString(double d)
        -
        Produce a string from a double. The string "null" will be returned if the - number is not finite.
        -
        -
        Parameters:
        -
        d - A double.
        -
        Returns:
        -
        A String.
        -
        -
      • -
      - - - -
        -
      • -

        get

        -
        public java.lang.Object get(java.lang.String key)
        -                     throws JSONException
        -
        Get the value object associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The object associated with the key.
        -
        Throws:
        -
        JSONException - if the key is not found.
        -
        -
      • -
      - - - -
        -
      • -

        getEnum

        -
        public <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> clazz,
        -                                               java.lang.String key)
        -                                        throws JSONException
        -
        Get the enum value associated with a key.
        -
        -
        Parameters:
        -
        clazz - The type of enum to retrieve.
        -
        key - A key string.
        -
        Returns:
        -
        The enum value associated with the key
        -
        Throws:
        -
        JSONException - if the key is not found or if the value cannot be converted - to an enum.
        -
        -
      • -
      - - - -
        -
      • -

        getBoolean

        -
        public boolean getBoolean(java.lang.String key)
        -                   throws JSONException
        -
        Get the boolean value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The truth.
        -
        Throws:
        -
        JSONException - if the value is not a Boolean or the String "true" or - "false".
        -
        -
      • -
      - - - -
        -
      • -

        getBigInteger

        -
        public java.math.BigInteger getBigInteger(java.lang.String key)
        -                                   throws JSONException
        -
        Get the BigInteger value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The numeric value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value cannot - be converted to BigInteger.
        -
        -
      • -
      - - - -
        -
      • -

        getBigDecimal

        -
        public java.math.BigDecimal getBigDecimal(java.lang.String key)
        -                                   throws JSONException
        -
        Get the BigDecimal value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The numeric value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value - cannot be converted to BigDecimal.
        -
        -
      • -
      - - - -
        -
      • -

        getDouble

        -
        public double getDouble(java.lang.String key)
        -                 throws JSONException
        -
        Get the double value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The numeric value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value is not a Number - object and cannot be converted to a number.
        -
        -
      • -
      - - - -
        -
      • -

        getInt

        -
        public int getInt(java.lang.String key)
        -           throws JSONException
        -
        Get the int value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The integer value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value cannot be converted - to an integer.
        -
        -
      • -
      - - - -
        -
      • -

        getJSONArray

        -
        public JSONArray getJSONArray(java.lang.String key)
        -                       throws JSONException
        -
        Get the JSONArray value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        A JSONArray which is the value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value is not a JSONArray.
        -
        -
      • -
      - - - -
        -
      • -

        getJSONObject

        -
        public JSONObject getJSONObject(java.lang.String key)
        -                         throws JSONException
        -
        Get the JSONObject value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        A JSONObject which is the value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value is not a JSONObject.
        -
        -
      • -
      - - - -
        -
      • -

        getLong

        -
        public long getLong(java.lang.String key)
        -             throws JSONException
        -
        Get the long value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The long value.
        -
        Throws:
        -
        JSONException - if the key is not found or if the value cannot be converted - to a long.
        -
        -
      • -
      - - - -
        -
      • -

        getNames

        -
        public static java.lang.String[] getNames(JSONObject jo)
        -
        Get an array of field names from a JSONObject.
        -
        -
        Returns:
        -
        An array of field names, or null if there are no names.
        -
        -
      • -
      - - - -
        -
      • -

        getNames

        -
        public static java.lang.String[] getNames(java.lang.Object object)
        -
        Get an array of field names from an Object.
        -
        -
        Returns:
        -
        An array of field names, or null if there are no names.
        -
        -
      • -
      - - - -
        -
      • -

        getString

        -
        public java.lang.String getString(java.lang.String key)
        -                           throws JSONException
        -
        Get the string associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        A string which is the value.
        -
        Throws:
        -
        JSONException - if there is no string value for the key.
        -
        -
      • -
      - - - -
        -
      • -

        has

        -
        public boolean has(java.lang.String key)
        -
        Determine if the JSONObject contains a specific key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        true if the key exists in the JSONObject.
        -
        -
      • -
      - - - -
        -
      • -

        increment

        -
        public JSONObject increment(java.lang.String key)
        -                     throws JSONException
        -
        Increment a property of a JSONObject. If there is no such property, - create one with a value of 1. If there is such a property, and if it is - an Integer, Long, Double, or Float, then add one to it.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If there is already a property with this name that is not an - Integer, Long, Double, or Float.
        -
        -
      • -
      - - - -
        -
      • -

        isNull

        -
        public boolean isNull(java.lang.String key)
        -
        Determine if the value associated with the key is null or if there is no - value.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        true if there is no value associated with the key or if the value - is the JSONObject.NULL object.
        -
        -
      • -
      - - - -
        -
      • -

        keys

        -
        public java.util.Iterator<java.lang.String> keys()
        -
        Get an enumeration of the keys of the JSONObject.
        -
        -
        Returns:
        -
        An iterator of the keys.
        -
        -
      • -
      - - - -
        -
      • -

        keySet

        -
        public java.util.Set<java.lang.String> keySet()
        -
        Get a set of keys of the JSONObject.
        -
        -
        Returns:
        -
        A keySet.
        -
        -
      • -
      - - - -
        -
      • -

        length

        -
        public int length()
        -
        Get the number of keys stored in the JSONObject.
        -
        -
        Returns:
        -
        The number of keys in the JSONObject.
        -
        -
      • -
      - - - -
        -
      • -

        names

        -
        public JSONArray names()
        -
        Produce a JSONArray containing the names of the elements of this - JSONObject.
        -
        -
        Returns:
        -
        A JSONArray containing the key strings, or null if the JSONObject - is empty.
        -
        -
      • -
      - - - -
        -
      • -

        numberToString

        -
        public static java.lang.String numberToString(java.lang.Number number)
        -                                       throws JSONException
        -
        Produce a string from a Number.
        -
        -
        Parameters:
        -
        number - A Number
        -
        Returns:
        -
        A String.
        -
        Throws:
        -
        JSONException - If n is a non-finite number.
        -
        -
      • -
      - - - -
        -
      • -

        opt

        -
        public java.lang.Object opt(java.lang.String key)
        -
        Get an optional value associated with a key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        An object which is the value, or null if there is no value.
        -
        -
      • -
      - - - -
        -
      • -

        optEnum

        -
        public <E extends java.lang.Enum<E>> E optEnum(java.lang.Class<E> clazz,
        -                                               java.lang.String key)
        -
        Get the enum value associated with a key.
        -
        -
        Parameters:
        -
        clazz - The type of enum to retrieve.
        -
        key - A key string.
        -
        Returns:
        -
        The enum value associated with the key or null if not found
        -
        -
      • -
      - - - - - -
        -
      • -

        optEnum

        -
        public <E extends java.lang.Enum<E>> E optEnum(java.lang.Class<E> clazz,
        -                                               java.lang.String key,
        -                                               E defaultValue)
        -
        Get the enum value associated with a key.
        -
        -
        Parameters:
        -
        clazz - The type of enum to retrieve.
        -
        key - A key string.
        -
        defaultValue - The default in case the value is not found
        -
        Returns:
        -
        The enum value associated with the key or defaultValue - if the value is not found or cannot be assigned to clazz
        -
        -
      • -
      - - - -
        -
      • -

        optBoolean

        -
        public boolean optBoolean(java.lang.String key)
        -
        Get an optional boolean associated with a key. It returns false if there - is no such key, or if the value is not Boolean.TRUE or the String "true".
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        The truth.
        -
        -
      • -
      - - - -
        -
      • -

        optBoolean

        -
        public boolean optBoolean(java.lang.String key,
        -                          boolean defaultValue)
        -
        Get an optional boolean associated with a key. It returns the - defaultValue if there is no such key, or if it is not a Boolean or the - String "true" or "false" (case insensitive).
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        The truth.
        -
        -
      • -
      - - - -
        -
      • -

        optDouble

        -
        public double optDouble(java.lang.String key)
        -
        Get an optional double associated with a key, or NaN if there is no such - key or if its value is not a number. If the value is a string, an attempt - will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A string which is the key.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optBigInteger

        -
        public java.math.BigInteger optBigInteger(java.lang.String key,
        -                                          java.math.BigInteger defaultValue)
        -
        Get an optional BigInteger associated with a key, or the defaultValue if - there is no such key or if its value is not a number. If the value is a - string, an attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optBigDecimal

        -
        public java.math.BigDecimal optBigDecimal(java.lang.String key,
        -                                          java.math.BigDecimal defaultValue)
        -
        Get an optional BigDecimal associated with a key, or the defaultValue if - there is no such key or if its value is not a number. If the value is a - string, an attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optDouble

        -
        public double optDouble(java.lang.String key,
        -                        double defaultValue)
        -
        Get an optional double associated with a key, or the defaultValue if - there is no such key or if its value is not a number. If the value is a - string, an attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optInt

        -
        public int optInt(java.lang.String key)
        -
        Get an optional int value associated with a key, or zero if there is no - such key or if the value is not a number. If the value is a string, an - attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optInt

        -
        public int optInt(java.lang.String key,
        -                  int defaultValue)
        -
        Get an optional int value associated with a key, or the default if there - is no such key or if the value is not a number. If the value is a string, - an attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optJSONArray

        -
        public JSONArray optJSONArray(java.lang.String key)
        -
        Get an optional JSONArray associated with a key. It returns null if there - is no such key, or if its value is not a JSONArray.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        A JSONArray which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optJSONObject

        -
        public JSONObject optJSONObject(java.lang.String key)
        -
        Get an optional JSONObject associated with a key. It returns null if - there is no such key, or if its value is not a JSONObject.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        A JSONObject which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optLong

        -
        public long optLong(java.lang.String key)
        -
        Get an optional long value associated with a key, or zero if there is no - such key or if the value is not a number. If the value is a string, an - attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optLong

        -
        public long optLong(java.lang.String key,
        -                    long defaultValue)
        -
        Get an optional long value associated with a key, or the default if there - is no such key or if the value is not a number. If the value is a string, - an attempt will be made to evaluate it as a number.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        An object which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optString

        -
        public java.lang.String optString(java.lang.String key)
        -
        Get an optional string associated with a key. It returns an empty string - if there is no such key. If the value is not a string and is not null, - then it is converted to a string.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        Returns:
        -
        A string which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        optString

        -
        public java.lang.String optString(java.lang.String key,
        -                                  java.lang.String defaultValue)
        -
        Get an optional string associated with a key. It returns the defaultValue - if there is no such key.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        defaultValue - The default.
        -
        Returns:
        -
        A string which is the value.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      boolean value)
        -               throws JSONException
        -
        Put a key/boolean pair in the JSONObject.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - A boolean which is the value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the key is null.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      java.util.Collection<?> value)
        -               throws JSONException
        -
        Put a key/value pair in the JSONObject, where the value will be a - JSONArray which is produced from a Collection.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - A Collection value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      double value)
        -               throws JSONException
        -
        Put a key/double pair in the JSONObject.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - A double which is the value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the key is null or if the number is invalid.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      int value)
        -               throws JSONException
        -
        Put a key/int pair in the JSONObject.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - An int which is the value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the key is null.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      long value)
        -               throws JSONException
        -
        Put a key/long pair in the JSONObject.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - A long which is the value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the key is null.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      java.util.Map<?,?> value)
        -               throws JSONException
        -
        Put a key/value pair in the JSONObject, where the value will be a - JSONObject which is produced from a Map.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - A Map value.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public JSONObject put(java.lang.String key,
        -                      java.lang.Object value)
        -               throws JSONException
        -
        Put a key/value pair in the JSONObject. If the value is null, then the - key will be removed from the JSONObject if it is present.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - An object which is the value. It should be of one of these - types: Boolean, Double, Integer, JSONArray, JSONObject, Long, - String, or the JSONObject.NULL object.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the value is non-finite number or if the key is null.
        -
        -
      • -
      - - - -
        -
      • -

        putOnce

        -
        public JSONObject putOnce(java.lang.String key,
        -                          java.lang.Object value)
        -                   throws JSONException
        -
        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.
        -
        -
        Parameters:
        -
        key - string
        -
        value - object
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - if the key is a duplicate
        -
        -
      • -
      - - - -
        -
      • -

        putOpt

        -
        public JSONObject putOpt(java.lang.String key,
        -                         java.lang.Object value)
        -                  throws JSONException
        -
        Put a key/value pair in the JSONObject, but only if the key and the value - are both non-null.
        -
        -
        Parameters:
        -
        key - A key string.
        -
        value - An object which is the value. It should be of one of these - types: Boolean, Double, Integer, JSONArray, JSONObject, Long, - String, or the JSONObject.NULL object.
        -
        Returns:
        -
        this.
        -
        Throws:
        -
        JSONException - If the value is a non-finite number.
        -
        -
      • -
      - - - -
        -
      • -

        quote

        -
        public static java.lang.String quote(java.lang.String string)
        -
        Produce a string in double quotes with backslash sequences in all the - right places. A backslash will be inserted within -
        -
        Parameters:
        -
        string - A String
        -
        Returns:
        -
        A String correctly formatted for insertion in a JSON text.
        -
        -
      • -
      - - - -
        -
      • -

        quote

        -
        public static java.io.Writer quote(java.lang.String string,
        -                                   java.io.Writer w)
        -                            throws java.io.IOException
        -
        -
        Throws:
        -
        java.io.IOException
        -
        -
      • -
      - - - -
        -
      • -

        remove

        -
        public java.lang.Object remove(java.lang.String key)
        -
        Remove a name and its value, if present.
        -
        -
        Parameters:
        -
        key - The name to be removed.
        -
        Returns:
        -
        The value that was associated with the name, or null if there was - no value.
        -
        -
      • -
      - - - -
        -
      • -

        similar

        -
        public boolean similar(java.lang.Object other)
        -
        Determine if two JSONObjects are similar. - They must contain the same set of names which must be associated with - similar values.
        -
        -
        Parameters:
        -
        other - The other JSONObject
        -
        Returns:
        -
        true if they are equal
        -
        -
      • -
      - - - -
        -
      • -

        stringToValue

        -
        public static java.lang.Object stringToValue(java.lang.String string)
        -
        Try to convert a string into a number, boolean, or null. If the string - can't be converted, return the string.
        -
        -
        Parameters:
        -
        string - A String.
        -
        Returns:
        -
        A simple JSON value.
        -
        -
      • -
      - - - -
        -
      • -

        testValidity

        -
        public static void testValidity(java.lang.Object o)
        -                         throws JSONException
        -
        Throw an exception if the object is a NaN or infinite number.
        -
        -
        Parameters:
        -
        o - The object to test.
        -
        Throws:
        -
        JSONException - If o is a non-finite number.
        -
        -
      • -
      - - - -
        -
      • -

        toJSONArray

        -
        public JSONArray toJSONArray(JSONArray names)
        -                      throws JSONException
        -
        Produce a JSONArray containing the values of the members of this - JSONObject.
        -
        -
        Parameters:
        -
        names - A JSONArray containing a list of key strings. This determines - the sequence of the values in the result.
        -
        Returns:
        -
        A JSONArray of values.
        -
        Throws:
        -
        JSONException - If any of the values are non-finite numbers.
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public java.lang.String toString()
        -
        Make a JSON text of this JSONObject. For compactness, no whitespace is - added. If this would not result in a syntactically correct JSON text, - then null will be returned instead. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Overrides:
        -
        toString in class java.lang.Object
        -
        Returns:
        -
        a printable, displayable, portable, transmittable representation - of the object, beginning with { (left - brace) and ending with } (right - brace).
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public java.lang.String toString(int indentFactor)
        -                          throws JSONException
        -
        Make a prettyprinted JSON text of this JSONObject. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Parameters:
        -
        indentFactor - The number of spaces to add to each level of indentation.
        -
        Returns:
        -
        a printable, displayable, portable, transmittable representation - of the object, beginning with { (left - brace) and ending with } (right - brace).
        -
        Throws:
        -
        JSONException - If the object contains an invalid number.
        -
        -
      • -
      - - - -
        -
      • -

        valueToString

        -
        public static java.lang.String valueToString(java.lang.Object value)
        -                                      throws JSONException
        -
        Make a JSON text of an Object value. If the object has an - value.toJSONString() method, then that method will be used to produce the - JSON text. The method is required to produce a strictly conforming text. - If the object does not contain a toJSONString method (which is the most - common case), then a text will be produced by other means. If the value - is an array or Collection, then a JSONArray will be made from it and its - toJSONString method will be called. If the value is a MAP, then a - JSONObject will be made from it and its toJSONString method will be - called. Otherwise, the value's toString method will be called, and the - result will be quoted. - -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Parameters:
        -
        value - The value to be serialized.
        -
        Returns:
        -
        a printable, displayable, transmittable representation of the - object, beginning with { (left - brace) and ending with } (right - brace).
        -
        Throws:
        -
        JSONException - If the value is or contains an invalid number.
        -
        -
      • -
      - - - -
        -
      • -

        wrap

        -
        public static java.lang.Object wrap(java.lang.Object object)
        -
        Wrap an object, if necessary. If the object is null, return the NULL - object. If it is an array or collection, wrap it in a JSONArray. If it is - a map, wrap it in a JSONObject. If it is a standard property (Double, - String, et al) then it is already wrapped. Otherwise, if it comes from - one of the java packages, turn it into a string. And if it doesn't, try - to wrap it in a JSONObject. If the wrapping fails, then null is returned.
        -
        -
        Parameters:
        -
        object - The object to wrap
        -
        Returns:
        -
        The wrapped value
        -
        -
      • -
      - - - -
        -
      • -

        write

        -
        public java.io.Writer write(java.io.Writer writer)
        -                     throws JSONException
        -
        Write the contents of the JSONObject as JSON text to a writer. For - compactness, no whitespace is added. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Returns:
        -
        The writer.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        write

        -
        public java.io.Writer write(java.io.Writer writer,
        -                            int indentFactor,
        -                            int indent)
        -                     throws JSONException
        -
        Write the contents of the JSONObject as JSON text to a writer. For - compactness, no whitespace is added. -

        - Warning: This method assumes that the data structure is acyclical.

        -
        -
        Parameters:
        -
        writer - Writes the serialized JSON
        -
        indentFactor - The number of spaces to add to each level of indentation.
        -
        indent - The indention of the top level.
        -
        Returns:
        -
        The writer.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/XML.html b/org/json/XML.html deleted file mode 100644 index 6f5515d..0000000 --- a/org/json/XML.html +++ /dev/null @@ -1,606 +0,0 @@ - - - - - - -XML (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - - -
-
org.json
-

Class XML

-
-
- -
-
    -
  • -
    -
    -
    public class XML
    -extends java.lang.Object
    -
    This provides static methods to convert an XML text into a JSONObject, and to - covert a JSONObject into an XML text.
    -
    -
    Version:
    -
    2016-01-30
    -
    Author:
    -
    JSON.org
    -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Fields 
      Modifier and TypeField and Description
      static java.lang.CharacterAMP -
      The Character '&'.
      -
      static java.lang.CharacterAPOS -
      The Character '''.
      -
      static java.lang.CharacterBANG -
      The Character '!'.
      -
      static java.lang.CharacterEQ -
      The Character '='.
      -
      static java.lang.CharacterGT -
      The Character '>'.
      -
      static java.lang.CharacterLT -
      The Character '<'.
      -
      static java.lang.CharacterQUEST -
      The Character '?'.
      -
      static java.lang.CharacterQUOT -
      The Character '"'.
      -
      static java.lang.CharacterSLASH -
      The Character '/'.
      -
      -
    • -
    - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      XML() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and TypeMethod and Description
      static java.lang.Stringescape(java.lang.String string) -
      Replace special characters with XML escapes: - - - & (ampersand) is replaced by &amp; - < (less than) is replaced by &lt; - > (greater than) is replaced by &gt; - " (double quote) is replaced by &quot; -
      -
      static voidnoSpace(java.lang.String string) -
      Throw an exception if the string contains whitespace.
      -
      static java.lang.ObjectstringToValue(java.lang.String string) -
      Deprecated.  - -
      -
      static JSONObjecttoJSONObject(java.lang.String string) -
      Convert a well-formed (but not necessarily valid) XML string into a - JSONObject.
      -
      static java.lang.StringtoString(java.lang.Object object) -
      Convert a JSONObject into a well-formed, element-normal XML string.
      -
      static java.lang.StringtoString(java.lang.Object object, - java.lang.String tagName) -
      Convert a JSONObject into a well-formed, element-normal XML string.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        AMP

        -
        public static final java.lang.Character AMP
        -
        The Character '&'.
        -
      • -
      - - - -
        -
      • -

        APOS

        -
        public static final java.lang.Character APOS
        -
        The Character '''.
        -
      • -
      - - - -
        -
      • -

        BANG

        -
        public static final java.lang.Character BANG
        -
        The Character '!'.
        -
      • -
      - - - -
        -
      • -

        EQ

        -
        public static final java.lang.Character EQ
        -
        The Character '='.
        -
      • -
      - - - -
        -
      • -

        GT

        -
        public static final java.lang.Character GT
        -
        The Character '>'.
        -
      • -
      - - - -
        -
      • -

        LT

        -
        public static final java.lang.Character LT
        -
        The Character '<'.
        -
      • -
      - - - -
        -
      • -

        QUEST

        -
        public static final java.lang.Character QUEST
        -
        The Character '?'.
        -
      • -
      - - - -
        -
      • -

        QUOT

        -
        public static final java.lang.Character QUOT
        -
        The Character '"'.
        -
      • -
      - - - -
        -
      • -

        SLASH

        -
        public static final java.lang.Character SLASH
        -
        The Character '/'.
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        XML

        -
        public XML()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        escape

        -
        public static java.lang.String escape(java.lang.String string)
        -
        Replace special characters with XML escapes: - -
        - & (ampersand) is replaced by &amp;
        - < (less than) is replaced by &lt;
        - > (greater than) is replaced by &gt;
        - " (double quote) is replaced by &quot;
        - 
        -
        -
        Parameters:
        -
        string - The string to be escaped.
        -
        Returns:
        -
        The escaped string.
        -
        -
      • -
      - - - -
        -
      • -

        noSpace

        -
        public static void noSpace(java.lang.String string)
        -                    throws JSONException
        -
        Throw an exception if the string contains whitespace. Whitespace is not - allowed in tagNames and attributes.
        -
        -
        Parameters:
        -
        string - A string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        stringToValue

        -
        public static java.lang.Object stringToValue(java.lang.String string)
        -
        Deprecated. Use JSONObject.stringToValue(String) instead.
        -
        This method has been deprecated in favor of the - JSONObject.stringToValue(String) method. Use it instead.
        -
        -
        Parameters:
        -
        string -
        -
        Returns:
        -
        JSON value of this string or the string
        -
        -
      • -
      - - - -
        -
      • -

        toJSONObject

        -
        public static JSONObject toJSONObject(java.lang.String string)
        -                               throws JSONException
        -
        Convert a well-formed (but not necessarily valid) XML string into a - JSONObject. Some information may be lost in this transformation because - JSON is a data format and XML is a document format. XML uses elements, - attributes, and content text, while JSON uses unordered collections of - name/value pairs and arrays of values. JSON does not does not like to - distinguish between elements and attributes. Sequences of similar - elements are represented as JSONArrays. Content text may be placed in a - "content" member. Comments, prologs, DTDs, and <[ [ ]]> - are ignored.
        -
        -
        Parameters:
        -
        string - The source string.
        -
        Returns:
        -
        A JSONObject containing the structured data from the XML string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(java.lang.Object object)
        -                                 throws JSONException
        -
        Convert a JSONObject into a well-formed, element-normal XML string.
        -
        -
        Parameters:
        -
        object - A JSONObject.
        -
        Returns:
        -
        A string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      - - - -
        -
      • -

        toString

        -
        public static java.lang.String toString(java.lang.Object object,
        -                                        java.lang.String tagName)
        -                                 throws JSONException
        -
        Convert a JSONObject into a well-formed, element-normal XML string.
        -
        -
        Parameters:
        -
        object - A JSONObject.
        -
        tagName - The optional name of the enclosing tag.
        -
        Returns:
        -
        A string.
        -
        Throws:
        -
        JSONException
        -
        -
      • -
      -
    • -
    -
  • -
-
-
- - -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/CDL.html b/org/json/class-use/CDL.html deleted file mode 100644 index 38e2a10..0000000 --- a/org/json/class-use/CDL.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.CDL (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.CDL

-
-
No usage of org.json.CDL
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/Cookie.html b/org/json/class-use/Cookie.html deleted file mode 100644 index e9abd09..0000000 --- a/org/json/class-use/Cookie.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.Cookie (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.Cookie

-
-
No usage of org.json.Cookie
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/CookieList.html b/org/json/class-use/CookieList.html deleted file mode 100644 index d2028d9..0000000 --- a/org/json/class-use/CookieList.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.CookieList (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.CookieList

-
-
No usage of org.json.CookieList
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/HTTP.html b/org/json/class-use/HTTP.html deleted file mode 100644 index 158ed56..0000000 --- a/org/json/class-use/HTTP.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.HTTP (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.HTTP

-
-
No usage of org.json.HTTP
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/HTTPTokener.html b/org/json/class-use/HTTPTokener.html deleted file mode 100644 index 9050b2c..0000000 --- a/org/json/class-use/HTTPTokener.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.HTTPTokener (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.HTTPTokener

-
-
No usage of org.json.HTTPTokener
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONArray.html b/org/json/class-use/JSONArray.html deleted file mode 100644 index 214969c..0000000 --- a/org/json/class-use/JSONArray.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - -Uses of Class org.json.JSONArray (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONArray

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONException.html b/org/json/class-use/JSONException.html deleted file mode 100644 index 39fecbd..0000000 --- a/org/json/class-use/JSONException.html +++ /dev/null @@ -1,900 +0,0 @@ - - - - - - -Uses of Class org.json.JSONException (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONException

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONML.html b/org/json/class-use/JSONML.html deleted file mode 100644 index 554f55a..0000000 --- a/org/json/class-use/JSONML.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.JSONML (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONML

-
-
No usage of org.json.JSONML
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONObject.html b/org/json/class-use/JSONObject.html deleted file mode 100644 index 348d7e3..0000000 --- a/org/json/class-use/JSONObject.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - -Uses of Class org.json.JSONObject (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONObject

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONString.html b/org/json/class-use/JSONString.html deleted file mode 100644 index a7bbb36..0000000 --- a/org/json/class-use/JSONString.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Interface org.json.JSONString (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Interface
org.json.JSONString

-
-
No usage of org.json.JSONString
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONStringer.html b/org/json/class-use/JSONStringer.html deleted file mode 100644 index 7a563e6..0000000 --- a/org/json/class-use/JSONStringer.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.JSONStringer (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONStringer

-
-
No usage of org.json.JSONStringer
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONTokener.html b/org/json/class-use/JSONTokener.html deleted file mode 100644 index a659531..0000000 --- a/org/json/class-use/JSONTokener.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -Uses of Class org.json.JSONTokener (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONTokener

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/JSONWriter.html b/org/json/class-use/JSONWriter.html deleted file mode 100644 index c478365..0000000 --- a/org/json/class-use/JSONWriter.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -Uses of Class org.json.JSONWriter (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.JSONWriter

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/Property.html b/org/json/class-use/Property.html deleted file mode 100644 index 3396dde..0000000 --- a/org/json/class-use/Property.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.Property (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.Property

-
-
No usage of org.json.Property
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/XML.html b/org/json/class-use/XML.html deleted file mode 100644 index 93ef77c..0000000 --- a/org/json/class-use/XML.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -Uses of Class org.json.XML (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.XML

-
-
No usage of org.json.XML
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/class-use/XMLTokener.html b/org/json/class-use/XMLTokener.html deleted file mode 100644 index 86648f4..0000000 --- a/org/json/class-use/XMLTokener.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - -Uses of Class org.json.XMLTokener (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Class
org.json.XMLTokener

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- - diff --git a/org/json/package-use.html b/org/json/package-use.html deleted file mode 100644 index 038a452..0000000 --- a/org/json/package-use.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -Uses of Package org.json (JSON in Java 20160212 API) - - - - - - - - -
- - - - - - - -
- - -
-

Uses of Package
org.json

-
-
- -
- -
- - - - - - - -
- - -

Copyright © 2016. All Rights Reserved.

- -