From a449b3ef5c5e30df69a1677fe72f3fbda71c8b9a Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Mon, 13 Jan 2025 11:15:53 -0600 Subject: [PATCH] Update JavaDoc, it's been awhile --- src/main/java/JSON-Java/allclasses-frame.html | 45 + .../java/JSON-Java/allclasses-noframe.html | 45 + src/main/java/JSON-Java/constant-values.html | 266 +- src/main/java/JSON-Java/deprecated-list.html | 195 +- src/main/java/JSON-Java/help-doc.html | 317 +- src/main/java/JSON-Java/index-all.html | 1754 ++++---- src/main/java/JSON-Java/index.html | 84 +- src/main/java/JSON-Java/org/json/CDL.html | 987 +++-- src/main/java/JSON-Java/org/json/Cookie.html | 439 +- .../java/JSON-Java/org/json/CookieList.html | 379 +- src/main/java/JSON-Java/org/json/HTTP.html | 448 +- .../java/JSON-Java/org/json/HTTPTokener.html | 376 +- .../java/JSON-Java/org/json/JSONArray.html | 3591 +++++++++------- .../JSON-Java/org/json/JSONException.html | 377 +- src/main/java/JSON-Java/org/json/JSONML.html | 843 ++-- .../org/json/JSONMLParserConfiguration.html | 596 ++- .../java/JSON-Java/org/json/JSONObject.html | 3769 ++++++++++------- .../org/json/JSONParserConfiguration.html | 538 ++- .../org/json/JSONPointer.Builder.html | 405 +- .../java/JSON-Java/org/json/JSONPointer.html | 533 ++- .../org/json/JSONPointerException.html | 370 +- .../org/json/JSONPropertyIgnore.html | 174 +- .../JSON-Java/org/json/JSONPropertyName.html | 257 +- .../java/JSON-Java/org/json/JSONString.html | 267 +- .../java/JSON-Java/org/json/JSONStringer.html | 380 +- .../java/JSON-Java/org/json/JSONTokener.html | 993 +++-- .../java/JSON-Java/org/json/JSONWriter.html | 774 ++-- .../org/json/ParserConfiguration.html | 665 +-- .../java/JSON-Java/org/json/Property.html | 379 +- .../org/json/StringBuilderWriter.html | 509 +++ src/main/java/JSON-Java/org/json/XML.html | 1218 +++--- .../org/json/XMLParserConfiguration.html | 1007 +++-- .../java/JSON-Java/org/json/XMLTokener.html | 683 +-- .../org/json/XMLXsiTypeConverter.html | 271 +- .../JSON-Java/org/json/package-frame.html | 55 + .../JSON-Java/org/json/package-summary.html | 466 +- .../java/JSON-Java/org/json/package-tree.html | 203 +- src/main/java/JSON-Java/overview-tree.html | 205 +- src/main/java/JSON-Java/package-list | 1 + src/main/java/JSON-Java/script.js | 150 +- src/main/java/JSON-Java/serialized-form.html | 158 +- 41 files changed, 15477 insertions(+), 9695 deletions(-) create mode 100644 src/main/java/JSON-Java/allclasses-frame.html create mode 100644 src/main/java/JSON-Java/allclasses-noframe.html create mode 100644 src/main/java/JSON-Java/org/json/StringBuilderWriter.html create mode 100644 src/main/java/JSON-Java/org/json/package-frame.html create mode 100644 src/main/java/JSON-Java/package-list diff --git a/src/main/java/JSON-Java/allclasses-frame.html b/src/main/java/JSON-Java/allclasses-frame.html new file mode 100644 index 0000000..db22802 --- /dev/null +++ b/src/main/java/JSON-Java/allclasses-frame.html @@ -0,0 +1,45 @@ + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/src/main/java/JSON-Java/allclasses-noframe.html b/src/main/java/JSON-Java/allclasses-noframe.html new file mode 100644 index 0000000..b90a506 --- /dev/null +++ b/src/main/java/JSON-Java/allclasses-noframe.html @@ -0,0 +1,45 @@ + + + + + +All Classes + + + + + +

All Classes

+
+ +
+ + diff --git a/src/main/java/JSON-Java/constant-values.html b/src/main/java/JSON-Java/constant-values.html index 5e42b6c..12db71a 100644 --- a/src/main/java/JSON-Java/constant-values.html +++ b/src/main/java/JSON-Java/constant-values.html @@ -1,118 +1,220 @@ - + + - + Constant Field Values - - - - - + - - - - - - + + -
- -
-

Constant Field Values

-

Contents

-
-
+
+ +

org.json.*

-
-
+ + + + diff --git a/src/main/java/JSON-Java/deprecated-list.html b/src/main/java/JSON-Java/deprecated-list.html index 6aa1fcf..0014006 100644 --- a/src/main/java/JSON-Java/deprecated-list.html +++ b/src/main/java/JSON-Java/deprecated-list.html @@ -1,96 +1,167 @@ - + + - + Deprecated List - - - - - + - - - - - - + + -
- -
-

Deprecated API

Contents

-
+ +
+ + + + + + +
+ + diff --git a/src/main/java/JSON-Java/help-doc.html b/src/main/java/JSON-Java/help-doc.html index e6f26c5..b7470aa 100644 --- a/src/main/java/JSON-Java/help-doc.html +++ b/src/main/java/JSON-Java/help-doc.html @@ -1,186 +1,217 @@ - + + - + API Help - - - - - + - - - - - - + + -
- -
-
-

JavaDoc Help

- -
-
-

Navigation

-Starting from the Overview page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The Index and Search box allow you to navigate to specific declarations and summary pages, including: All Packages, All Classes and Interfaces - +
+

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.
-
-
-

Kinds of Pages

-The following sections describe the different kinds of pages in this collection. -
-

Package

-

Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:

-
    -
  • Interfaces
  • +
    +
      +
    • +

      Package

      +

      Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

      +
        +
      • Interfaces (italic)
      • Classes
      • -
      • Enum Classes
      • +
      • Enums
      • Exceptions
      • Errors
      • -
      • Annotation Interfaces
      • +
      • Annotation Types
      -
-
-

Class or Interface

-

Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.

-
    -
  • Class Inheritance Diagram
  • + +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • Direct Subclasses
    • All Known Subinterfaces
    • All Known Implementing Classes
    • -
    • Class or Interface Declaration
    • -
    • Class or Interface Description
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    -
    -
      +
      • Nested Class Summary
      • -
      • Enum Constant Summary
      • Field Summary
      • -
      • Property Summary
      • Constructor Summary
      • Method Summary
      • +
      +
        +
      • Field Detail
      • +
      • Constructor Detail
      • +
      • Method Detail
      • +
      +

      Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

      + +
    • +

      Annotation Type

      +

      Each annotation type has its own separate page with the following sections:

      +
        +
      • Annotation Type declaration
      • +
      • Annotation Type description
      • Required Element Summary
      • Optional Element Summary
      • +
      • Element Detail
      -
      -
        -
      • Enum Constant Details
      • -
      • Field Details
      • -
      • Property Details
      • -
      • Constructor Details
      • -
      • Method Details
      • -
      • Element Details
      • + +
      • +

        Enum

        +

        Each enum has its own separate page with the following sections:

        +
          +
        • Enum declaration
        • +
        • Enum description
        • +
        • Enum Constant Summary
        • +
        • Enum Constant Detail
        -

        Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.

        -

        The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

        -
-
-

Other Files

-

Packages and modules may contain pages with additional information related to the declarations nearby.

-
-
-

Tree (Class Hierarchy)

-

There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.

-
    -
  • When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.
  • -
  • When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
  • + +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    -
-
-

Deprecated API

-

The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to shortcomings, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

-
-
-

Constant Field Values

+ +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    The Constant Field Values page lists the static final fields and their values.

    -
  • -
    -

    Serialized Form

    -

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to those who implement rather than use the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See Also" section of the class description.

    -
    -
    -

    All Packages

    -

    The All Packages page contains an alphabetic index of all packages contained in the documentation.

    -
    -
    -

    All Classes and Interfaces

    -

    The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.

    -
    -
    -

    Index

    -

    The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.

    -
    -
    -
    -This help file applies to API documentation generated by the standard doclet.
    + + +This help file applies to API documentation generated using the standard doclet.
    + + + + diff --git a/src/main/java/JSON-Java/index-all.html b/src/main/java/JSON-Java/index-all.html index 5fd505f..c2de90f 100644 --- a/src/main/java/JSON-Java/index-all.html +++ b/src/main/java/JSON-Java/index-all.html @@ -1,1914 +1,2116 @@ - + + - + Index - - - - - + - - - - - - + + -
    - -
    -
    -
    -

    Index

    -
    -A B C D E G H I J K L M N O P Q R S T U V W X 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form -

    A

    -
    -
    accumulate(String, Object) - Method in class org.json.JSONObject
    +
    A B C D E F 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
    +
    AMP - Static variable in class org.json.XML
    The Character '&'.
    -
    APOS - Static variable in class org.json.XML
    +
    APOS - Static variable in class org.json.XML
    The Character '''.
    -
    append(int) - Method in class org.json.JSONPointer.Builder
    -
    -
    Adds an integer to the reference token list.
    -
    -
    append(String) - Method in class org.json.JSONPointer.Builder
    -
    -
    Adds an arbitrary token to the list of reference tokens.
    -
    -
    append(String, Object) - Method in class org.json.JSONObject
    +
    append(String, Object) - Method in class org.json.JSONObject
    Append values to the array under a key.
    -
    array() - Method in class org.json.JSONWriter
    +
    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.
    +
    +
    append(CharSequence) - Method in class org.json.StringBuilderWriter
    +
     
    +
    append(CharSequence, int, int) - Method in class org.json.StringBuilderWriter
    +
     
    +
    append(char) - Method in class org.json.StringBuilderWriter
    +
     
    +
    array() - Method in class org.json.JSONWriter
    Begin appending a new array.
    -

    B

    -
    -
    back() - Method in class org.json.JSONTokener
    + + + +

    B

    +
    +
    back() - Method in class org.json.JSONTokener
    Back up one character.
    -
    BANG - Static variable in class org.json.XML
    +
    BANG - Static variable in class org.json.XML
    The Character '!'.
    -
    build() - Method in class org.json.JSONPointer.Builder
    +
    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.
    + JSONPointer.Builder.append(String) method calls.
    -
    builder() - Static method in class org.json.JSONPointer
    +
    builder() - Static method in class org.json.JSONPointer
    Static factory method for JSONPointer.Builder.
    -
    Builder() - Constructor for class org.json.JSONPointer.Builder
    +
    Builder() - Constructor for class org.json.JSONPointer.Builder
    Constructs a new Builder object.
    -

    C

    -
    -
    CDL - Class in org.json
    + + + +

    C

    +
    +
    CDL - Class in org.json
    This provides static methods to convert comma (or otherwise) delimited text into a JSONArray, and to convert a JSONArray into comma (or otherwise) delimited text.
    -
    CDL() - Constructor for class org.json.CDL
    +
    CDL() - Constructor for class org.json.CDL
    Constructs a new CDL object.
    -
    clear() - Method in class org.json.JSONArray
    +
    clear() - Method in class org.json.JSONArray
    Removes all of the elements from this JSONArray.
    -
    clear() - Method in class org.json.JSONObject
    +
    clear() - Method in class org.json.JSONObject
    Removes all of the elements from this JSONObject.
    -
    clone() - Method in class org.json.JSONMLParserConfiguration
    +
    clone() - Method in class org.json.JSONMLParserConfiguration
    Provides a new instance of the same configuration.
    -
    clone() - Method in class org.json.JSONParserConfiguration
    +
    clone() - Method in class org.json.JSONParserConfiguration
     
    -
    clone() - Method in class org.json.ParserConfiguration
    +
    clone() - Method in class org.json.ParserConfiguration
    Provides a new instance of the same configuration.
    -
    clone() - Method in class org.json.XMLParserConfiguration
    +
    clone() - Method in class org.json.XMLParserConfiguration
    Provides a new instance of the same configuration.
    -
    close() - Method in class org.json.JSONTokener
    +
    close() - Method in class org.json.JSONTokener
    Closes the underlying reader, releasing any resources associated with it.
    -
    convert(String) - Method in interface org.json.XMLXsiTypeConverter
    +
    close() - Method in class org.json.StringBuilderWriter
    +
     
    +
    convert(String) - Method in interface org.json.XMLXsiTypeConverter
    Converts an XML xsi:type attribute value to the specified type T.
    -
    Cookie - Class in org.json
    +
    Cookie - Class in org.json
    Convert a web browser cookie specification to a JSONObject and back.
    -
    Cookie() - Constructor for class org.json.Cookie
    +
    Cookie() - Constructor for class org.json.Cookie
    Constructs a new Cookie object.
    -
    CookieList - Class in org.json
    +
    CookieList - Class in org.json
    Convert a web browser cookie list string to a JSONObject and back.
    -
    CookieList() - Constructor for class org.json.CookieList
    +
    CookieList() - Constructor for class org.json.CookieList
    Constructs a new CookieList object.
    -
    CRLF - Static variable in class org.json.HTTP
    +
    CRLF - Static variable in class org.json.HTTP
    Carriage return/line feed.
    -

    D

    -
    -
    DEFAULT_MAXIMUM_NESTING_DEPTH - Static variable in class org.json.JSONMLParserConfiguration
    + + + +

    D

    +
    +
    DEFAULT_MAXIMUM_NESTING_DEPTH - Static variable in class org.json.JSONMLParserConfiguration
    We can override the default maximum nesting depth if needed.
    -
    DEFAULT_MAXIMUM_NESTING_DEPTH - Static variable in class org.json.ParserConfiguration
    +
    DEFAULT_MAXIMUM_NESTING_DEPTH - Static variable in class org.json.ParserConfiguration
    The default maximum nesting depth when parsing a document.
    -
    dehexchar(char) - Static method in class org.json.JSONTokener
    +
    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
    +
    doubleToString(double) - Static method in class org.json.JSONObject
    Produce a string from a double.
    -

    E

    -
    -
    end() - Method in class org.json.JSONTokener
    + + + +

    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
    +
    endArray() - Method in class org.json.JSONWriter
    End an array.
    -
    endObject() - Method in class org.json.JSONWriter
    +
    endObject() - Method in class org.json.JSONWriter
    End an object.
    -
    entity - Static variable in class org.json.XMLTokener
    +
    entity - Static variable in class org.json.XMLTokener
    The table of entity values.
    -
    entrySet() - Method in class org.json.JSONObject
    +
    entrySet() - Method in class org.json.JSONObject
    Get a set of entries of the JSONObject.
    -
    EQ - Static variable in class org.json.XML
    +
    EQ - Static variable in class org.json.XML
    The Character '='.
    -
    escape(String) - Static method in class org.json.Cookie
    +
    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
    +
    escape(String) - Static method in class org.json.XML
    Replace special characters with XML escapes:
    -

    G

    -
    -
    get(int) - Method in class org.json.JSONArray
    + + + +

    F

    +
    +
    flush() - Method in class org.json.StringBuilderWriter
    +
     
    +
    + + + +

    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(String) - Method in class org.json.JSONObject
    Get the value object associated with a key.
    -
    getBigDecimal(int) - Method in class org.json.JSONArray
    +
    getBigDecimal(int) - Method in class org.json.JSONArray
    Get the BigDecimal value associated with an index.
    -
    getBigDecimal(String) - Method in class org.json.JSONObject
    +
    getBigDecimal(String) - Method in class org.json.JSONObject
    Get the BigDecimal value associated with a key.
    -
    getBigInteger(int) - Method in class org.json.JSONArray
    +
    getBigInteger(int) - Method in class org.json.JSONArray
    Get the BigInteger value associated with an index.
    -
    getBigInteger(String) - Method in class org.json.JSONObject
    +
    getBigInteger(String) - Method in class org.json.JSONObject
    Get the BigInteger value associated with a key.
    -
    getBoolean(int) - Method in class org.json.JSONArray
    +
    getBoolean(int) - Method in class org.json.JSONArray
    Get the boolean value associated with an index.
    -
    getBoolean(String) - Method in class org.json.JSONObject
    +
    getBoolean(String) - Method in class org.json.JSONObject
    Get the boolean value associated with a key.
    -
    getcDataTagName() - Method in class org.json.XMLParserConfiguration
    +
    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
    +
    getDouble(int) - Method in class org.json.JSONArray
    Get the double value associated with an index.
    -
    getDouble(String) - Method in class org.json.JSONObject
    +
    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
    +
    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
    +
    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
    +
    getFloat(int) - Method in class org.json.JSONArray
    Get the float value associated with a key.
    -
    getFloat(String) - Method in class org.json.JSONObject
    +
    getFloat(String) - Method in class org.json.JSONObject
    Get the float value associated with a key.
    -
    getForceList() - Method in class org.json.XMLParserConfiguration
    +
    getForceList() - Method in class org.json.XMLParserConfiguration
    When parsing the XML into JSON, specifies that tags that will be converted to arrays in this configuration Set<String> to parse the provided tags' values as arrays
    -
    getInt(int) - Method in class org.json.JSONArray
    +
    getInt(int) - Method in class org.json.JSONArray
    Get the int value associated with an index.
    -
    getInt(String) - Method in class org.json.JSONObject
    +
    getInt(String) - Method in class org.json.JSONObject
    Get the int value associated with a key.
    -
    getJSONArray(int) - Method in class org.json.JSONArray
    +
    getJSONArray(int) - Method in class org.json.JSONArray
    Get the JSONArray associated with an index.
    -
    getJSONArray(String) - Method in class org.json.JSONObject
    +
    getJSONArray(String) - Method in class org.json.JSONObject
    Get the JSONArray value associated with a key.
    -
    getJSONObject(int) - Method in class org.json.JSONArray
    +
    getJSONObject(int) - Method in class org.json.JSONArray
    Get the JSONObject associated with an index.
    -
    getJSONObject(String) - Method in class org.json.JSONObject
    +
    getJSONObject(String) - Method in class org.json.JSONObject
    Get the JSONObject value associated with a key.
    -
    getLong(int) - Method in class org.json.JSONArray
    +
    getJsonParserConfiguration() - Method in class org.json.JSONTokener
    +
    +
    Getter
    +
    +
    getLong(int) - Method in class org.json.JSONArray
    Get the long value associated with an index.
    -
    getLong(String) - Method in class org.json.JSONObject
    +
    getLong(String) - Method in class org.json.JSONObject
    Get the long value associated with a key.
    -
    getMapType() - Method in class org.json.JSONObject
    +
    getMapType() - Method in class org.json.JSONObject
    Retrieves the type of the underlying Map in this class.
    -
    getMaxNestingDepth() - Method in class org.json.ParserConfiguration
    +
    getMaxNestingDepth() - Method in class org.json.ParserConfiguration
    The maximum nesting depth that the parser will descend before throwing an exception - when parsing the XML into JSONML.
    + when parsing an object (e.g.
    -
    getNames(Object) - Static method in class org.json.JSONObject
    -
    -
    Get an array of public field names from an Object.
    -
    -
    getNames(JSONObject) - Static method in class org.json.JSONObject
    +
    getNames(JSONObject) - Static method in class org.json.JSONObject
    Get an array of field names from a JSONObject.
    -
    getNumber(int) - Method in class org.json.JSONArray
    +
    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
    +
    getNumber(String) - Method in class org.json.JSONObject
    Get the Number value associated with a key.
    -
    getPrevious() - Method in class org.json.JSONTokener
    +
    getPrevious() - Method in class org.json.JSONTokener
    Get the last character read from the input or '\0' if nothing has been read yet.
    -
    getString(int) - Method in class org.json.JSONArray
    +
    getString(int) - Method in class org.json.JSONArray
    Get the string associated with an index.
    -
    getString(String) - Method in class org.json.JSONObject
    +
    getString(String) - Method in class org.json.JSONObject
    Get the string associated with a key.
    -
    getXsiTypeMap() - Method in class org.json.XMLParserConfiguration
    +
    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
    +
    GT - Static variable in class org.json.XML
    The Character
    -

    H

    -
    -
    has(String) - Method in class org.json.JSONObject
    + + + +

    H

    +
    +
    has(String) - Method in class org.json.JSONObject
    Determine if the JSONObject contains a specific key.
    -
    HTTP - Class in org.json
    +
    HTTP - Class in org.json
    Convert an HTTP header to a JSONObject and back.
    -
    HTTP() - Constructor for class org.json.HTTP
    +
    HTTP() - Constructor for class org.json.HTTP
    Constructs a new HTTP object.
    -
    HTTPTokener - Class in org.json
    +
    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
    +
    HTTPTokener(String) - Constructor for class org.json.HTTPTokener
    Construct an HTTPTokener from a string.
    -

    I

    -
    -
    increment(String) - Method in class org.json.JSONObject
    + + + +

    I

    +
    +
    increment(String) - Method in class org.json.JSONObject
    Increment a property of a JSONObject.
    -
    isCloseEmptyTag() - Method in class org.json.XMLParserConfiguration
    +
    isCloseEmptyTag() - Method in class org.json.XMLParserConfiguration
    Checks if the parser should automatically close empty XML tags.
    -
    isConvertNilAttributeToNull() - Method in class org.json.XMLParserConfiguration
    +
    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
    +
    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
    +
    isEmpty() - Method in class org.json.JSONArray
    Check if JSONArray is empty.
    -
    isEmpty() - Method in class org.json.JSONObject
    +
    isEmpty() - Method in class org.json.JSONObject
    Check if JSONObject is empty.
    -
    isKeepStrings() - Method in class org.json.ParserConfiguration
    +
    isKeepStrings() - Method in class org.json.ParserConfiguration
    When parsing the XML into JSONML, specifies if values should be kept as strings (true), or if - they should try to be guessed into JSON values (numeric, boolean, string)
    + they should try to be guessed into JSON values (numeric, boolean, string).
    -
    isNull(int) - Method in class org.json.JSONArray
    +
    isNull(int) - Method in class org.json.JSONArray
    Determine if the value is null.
    -
    isNull(String) - Method in class org.json.JSONObject
    +
    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
    +
    isOverwriteDuplicateKey() - Method in class org.json.JSONParserConfiguration
    +
    +
    The parser's behavior when meeting duplicate keys, controls whether the parser should + overwrite duplicate keys or not.
    +
    +
    isStrictMode() - Method in class org.json.JSONParserConfiguration
    +
     
    +
    iterator() - Method in class org.json.JSONArray
     
    -

    J

    -
    -
    join(String) - 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
    +
    JSONArray - Class in org.json
    A JSONArray is an ordered sequence of values.
    -
    JSONArray() - Constructor for class org.json.JSONArray
    +
    JSONArray() - Constructor for class org.json.JSONArray
    Construct an empty JSONArray.
    -
    JSONArray(int) - Constructor for class org.json.JSONArray
    -
    -
    Construct a JSONArray with the specified initial capacity.
    -
    -
    JSONArray(Iterable<?>) - Constructor for class org.json.JSONArray
    -
    -
    Construct a JSONArray from an Iterable.
    -
    -
    JSONArray(Object) - Constructor for class org.json.JSONArray
    -
    -
    Construct a JSONArray from an array.
    -
    -
    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(Collection<?>, JSONParserConfiguration) - Constructor for class org.json.JSONArray
    -
    -
    Construct a JSONArray from a Collection.
    -
    -
    JSONArray(JSONArray) - Constructor for class org.json.JSONArray
    -
    -
    Construct a JSONArray from another JSONArray.
    -
    -
    JSONArray(JSONTokener) - Constructor for class org.json.JSONArray
    +
    JSONArray(JSONTokener) - Constructor for class org.json.JSONArray
    Construct a JSONArray from a JSONTokener.
    -
    JSONException - Exception in org.json
    +
    JSONArray(JSONTokener, JSONParserConfiguration) - Constructor for class org.json.JSONArray
    +
    +
    Constructs a JSONArray from a JSONTokener and a JSONParserConfiguration.
    +
    +
    JSONArray(String) - Constructor for class org.json.JSONArray
    +
    +
    Construct a JSONArray from a source JSON text.
    +
    +
    JSONArray(String, JSONParserConfiguration) - 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(Collection<?>, JSONParserConfiguration) - 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
    +
    JSONException(String) - Constructor for exception org.json.JSONException
    Constructs a JSONException with an explanatory message.
    -
    JSONException(String, Throwable) - Constructor for exception org.json.JSONException
    +
    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
    +
    JSONException(Throwable) - Constructor for exception org.json.JSONException
    Constructs a new JSONException with the specified cause.
    -
    JSONML - Class in org.json
    +
    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
    +
    JSONML() - Constructor for class org.json.JSONML
    Constructs a new JSONML object.
    -
    JSONMLParserConfiguration - Class in org.json
    +
    JSONMLParserConfiguration - Class in org.json
    Configuration object for the XML to JSONML parser.
    -
    JSONMLParserConfiguration() - Constructor for class org.json.JSONMLParserConfiguration
    +
    JSONMLParserConfiguration() - Constructor for class org.json.JSONMLParserConfiguration
    Default parser configuration.
    -
    JSONMLParserConfiguration(boolean, int) - Constructor for class org.json.JSONMLParserConfiguration
    +
    JSONMLParserConfiguration(boolean, int) - Constructor for class org.json.JSONMLParserConfiguration
    Configure the parser string processing and use the default CDATA Tag Name as "content".
    -
    JSONObject - Class in org.json
    +
    JSONObject - Class in org.json
    A JSONObject is an unordered collection of name/value pairs.
    -
    JSONObject() - Constructor for class org.json.JSONObject
    +
    JSONObject() - Constructor for class org.json.JSONObject
    Construct an empty JSONObject.
    -
    JSONObject(int) - Constructor for class org.json.JSONObject
    +
    JSONObject(JSONObject, String...) - Constructor for class org.json.JSONObject
    -
    Constructor to specify an initial capacity of the internal map.
    +
    Construct a JSONObject from a subset of another JSONObject.
    -
    JSONObject(Object) - Constructor for class org.json.JSONObject
    +
    JSONObject(JSONTokener) - Constructor for class org.json.JSONObject
    +
    +
    Construct a JSONObject from a JSONTokener.
    +
    +
    JSONObject(JSONTokener, JSONParserConfiguration) - Constructor for class org.json.JSONObject
    +
    +
    Construct a JSONObject from a JSONTokener with custom json parse configurations.
    +
    +
    JSONObject(Map<?, ?>) - Constructor for class org.json.JSONObject
    +
    +
    Construct a JSONObject from a Map.
    +
    +
    JSONObject(Map<?, ?>, JSONParserConfiguration) - Constructor for class org.json.JSONObject
    +
    +
    Construct a JSONObject from a Map with custom json parse configurations.
    +
    +
    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
    +
    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
    +
    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
    +
    JSONObject(String, JSONParserConfiguration) - Constructor for class org.json.JSONObject
    +
    +
    Construct a JSONObject from a source JSON text string with custom json parse configurations.
    +
    +
    JSONObject(String, Locale) - Constructor for class org.json.JSONObject
    Construct a JSONObject from a ResourceBundle.
    -
    JSONObject(Map<?, ?>) - Constructor for class org.json.JSONObject
    +
    JSONObject(int) - Constructor for class org.json.JSONObject
    -
    Construct a JSONObject from a Map.
    +
    Constructor to specify an initial capacity of the internal map.
    -
    JSONObject(Map<?, ?>, JSONParserConfiguration) - Constructor for class org.json.JSONObject
    -
    -
    Construct a JSONObject from a Map with custom json parse configurations.
    -
    -
    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.
    -
    -
    JSONParserConfiguration - Class in org.json
    +
    JSONParserConfiguration - Class in org.json
    Configuration object for the JSON parser.
    -
    JSONParserConfiguration() - Constructor for class org.json.JSONParserConfiguration
    +
    JSONParserConfiguration() - Constructor for class org.json.JSONParserConfiguration
    Configuration with the default values.
    -
    JSONPointer - Class in org.json
    +
    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
    +
    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(List<String>) - Constructor for class org.json.JSONPointer
    Constructs a new JSONPointer instance with the provided list of reference tokens.
    -
    JSONPointer.Builder - Class in org.json
    +
    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
    +
    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) - Constructor for exception org.json.JSONPointerException
    Constructs a new JSONPointerException with the specified error message.
    -
    JSONPointerException(String, Throwable) - Constructor for exception org.json.JSONPointerException
    +
    JSONPointerException(String, Throwable) - Constructor for exception org.json.JSONPointerException
    Constructs a new JSONPointerException with the specified error message and cause.
    -
    JSONPropertyIgnore - Annotation Interface in org.json
    +
    JSONPropertyIgnore - Annotation Type in org.json
    Use this annotation on a getter method to override the Bean name parser for Bean -> JSONObject mapping.
    -
    JSONPropertyName - Annotation Interface in org.json
    +
    JSONPropertyName - Annotation Type in org.json
    Use this annotation on a getter method to override the Bean name parser for Bean -> JSONObject mapping.
    -
    JSONString - Interface 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 - Class in org.json
    JSONStringer provides a quick and convenient way of producing JSON text.
    -
    JSONStringer() - Constructor for class org.json.JSONStringer
    +
    JSONStringer() - Constructor for class org.json.JSONStringer
    Make a fresh JSONStringer.
    -
    JSONTokener - Class in org.json
    +
    JSONTokener - Class in org.json
    A JSONTokener takes a source string and extracts characters and tokens from it.
    -
    JSONTokener(InputStream) - Constructor for class org.json.JSONTokener
    -
    -
    Construct a JSONTokener from an InputStream.
    -
    -
    JSONTokener(Reader) - Constructor for class org.json.JSONTokener
    +
    JSONTokener(Reader) - Constructor for class org.json.JSONTokener
    Construct a JSONTokener from a Reader.
    -
    JSONTokener(String) - Constructor for class org.json.JSONTokener
    +
    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 - Class in org.json
    JSONWriter provides a quick and convenient way of producing JSON text.
    -
    JSONWriter(Appendable) - Constructor for class org.json.JSONWriter
    +
    JSONWriter(Appendable) - Constructor for class org.json.JSONWriter
    Make a fresh JSONWriter.
    -

    K

    -
    -
    KEEP_STRINGS - Static variable in class org.json.JSONMLParserConfiguration
    + + + +

    K

    +
    +
    KEEP_STRINGS - Static variable in class org.json.JSONMLParserConfiguration
    Original configuration of the XML to JSONML Parser except that values are kept as strings.
    -
    KEEP_STRINGS - Static variable in class org.json.XMLParserConfiguration
    +
    KEEP_STRINGS - Static variable in class org.json.XMLParserConfiguration
    Original configuration of the XML Parser except that values are kept as strings.
    -
    keepStrings - Variable in class org.json.ParserConfiguration
    +
    keepStrings - Variable in class org.json.ParserConfiguration
    Specifies if values should be kept as strings (true), or if - they should try to be guessed into JSON values (numeric, boolean, string)
    + they should try to be guessed into JSON values (numeric, boolean, string).
    -
    key(String) - Method in class org.json.JSONWriter
    +
    key(String) - Method in class org.json.JSONWriter
    Append a key.
    -
    keys() - Method in class org.json.JSONObject
    +
    keys() - Method in class org.json.JSONObject
    Get an enumeration of the keys of the JSONObject.
    -
    keySet() - Method in class org.json.JSONObject
    +
    keySet() - Method in class org.json.JSONObject
    Get a set of keys of the JSONObject.
    -

    L

    -
    -
    length() - Method in class org.json.JSONArray
    + + + +

    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
    +
    length() - Method in class org.json.JSONObject
    Get the number of keys stored in the JSONObject.
    -
    LT - Static variable in class org.json.XML
    +
    LT - Static variable in class org.json.XML
    The Character '<'.
    -

    M

    -
    -
    maxNestingDepth - Variable in class org.json.ParserConfiguration
    + + + +

    M

    +
    +
    maxNestingDepth - Variable in class org.json.ParserConfiguration
    -
    The maximum nesting depth when parsing a document.
    +
    The maximum nesting depth when parsing an object.
    -
    mode - Variable in class org.json.JSONWriter
    +
    mode - Variable in class org.json.JSONWriter
    The current mode.
    -
    more() - Method in class org.json.JSONTokener
    +
    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
    + + + +

    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
    +
    next() - Method in class org.json.JSONTokener
    Get the next character in the source string.
    -
    next(char) - Method in class org.json.JSONTokener
    +
    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
    +
    next(int) - Method in class org.json.JSONTokener
    Get the next n characters.
    -
    nextCDATA() - Method in class org.json.XMLTokener
    +
    nextCDATA() - Method in class org.json.XMLTokener
    Get the text in the CDATA block.
    -
    nextClean() - Method in class org.json.JSONTokener
    +
    nextClean() - Method in class org.json.JSONTokener
    Get the next char in the string, skipping whitespace.
    -
    nextContent() - Method in class org.json.XMLTokener
    +
    nextContent() - Method in class org.json.XMLTokener
    Get the next XML outer token, trimming whitespace.
    -
    nextEntity(char) - Method in class org.json.XMLTokener
    +
    nextEntity(char) - Method in class org.json.XMLTokener
    -
    - Return the next entity. These entities are translated to Characters: - &amp; &apos; &gt; &lt; &quot;. -
    +
    {@code + Return the next entity.
    -
    nextMeta() - Method in class org.json.XMLTokener
    +
    nextMeta() - Method in class org.json.XMLTokener
    -
    - Returns the next XML meta token. This is used for skipping over <!...> - and <?...?> structures. -
    +
    {@code + Returns the next XML meta token.
    -
    nextString(char) - Method in class org.json.JSONTokener
    +
    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
    +
    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
    +
    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
    +
    nextToken() - Method in class org.json.HTTPTokener
    Get the next token or string.
    -
    nextToken() - Method in class org.json.XMLTokener
    +
    nextToken() - Method in class org.json.XMLTokener
    -
    - 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. -
    +
    {@code + Get the next XML Token.
    -
    nextValue() - Method in class org.json.JSONTokener
    +
    nextValue() - Method in class org.json.JSONTokener
    Get the next value.
    -
    noSpace(String) - Static method in class org.json.XML
    +
    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
    +
    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_ATTR - Static variable in class org.json.XML
    Null attribute name
    -
    numberToString(Number) - Static method in class org.json.JSONObject
    +
    numberToString(Number) - Static method in class org.json.JSONObject
    Produce a string from a Number.
    -

    O

    -
    -
    object() - Method in class org.json.JSONWriter
    + + + +

    O

    +
    +
    object() - Method in class org.json.JSONWriter
    Begin appending a new object.
    -
    opt(int) - Method in class org.json.JSONArray
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    optBoolean(String, boolean) - Method in class org.json.JSONObject
    Get an optional boolean associated with a key.
    -
    optBooleanObject(int) - Method in class org.json.JSONArray
    +
    optBooleanObject(int) - Method in class org.json.JSONArray
    Get the optional Boolean object associated with an index.
    -
    optBooleanObject(int, Boolean) - Method in class org.json.JSONArray
    +
    optBooleanObject(int, Boolean) - Method in class org.json.JSONArray
    Get the optional Boolean object associated with an index.
    -
    optBooleanObject(String) - Method in class org.json.JSONObject
    +
    optBooleanObject(String) - Method in class org.json.JSONObject
    Get an optional boolean object associated with a key.
    -
    optBooleanObject(String, Boolean) - Method in class org.json.JSONObject
    +
    optBooleanObject(String, Boolean) - Method in class org.json.JSONObject
    Get an optional boolean object associated with a key.
    -
    optDouble(int) - Method in class org.json.JSONArray
    +
    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
    +
    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
    +
    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
    +
    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.
    -
    optDoubleObject(int) - Method in class org.json.JSONArray
    +
    optDoubleObject(int) - Method in class org.json.JSONArray
    Get the optional Double object associated with an index.
    -
    optDoubleObject(int, Double) - Method in class org.json.JSONArray
    +
    optDoubleObject(int, Double) - Method in class org.json.JSONArray
    Get the optional double value associated with an index.
    -
    optDoubleObject(String) - Method in class org.json.JSONObject
    +
    optDoubleObject(String) - Method in class org.json.JSONObject
    Get an optional Double object associated with a key, or NaN if there is no such key or if its value is not a number.
    -
    optDoubleObject(String, Double) - Method in class org.json.JSONObject
    +
    optDoubleObject(String, Double) - Method in class org.json.JSONObject
    Get an optional Double object 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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    optFloat(String) - Method in class org.json.JSONObject
    Get the optional float value associated with an index.
    -
    optFloat(String, float) - Method in class org.json.JSONObject
    +
    optFloat(String, float) - Method in class org.json.JSONObject
    Get the optional float value associated with an index.
    -
    optFloatObject(int) - Method in class org.json.JSONArray
    +
    optFloatObject(int) - Method in class org.json.JSONArray
    Get the optional Float object associated with an index.
    -
    optFloatObject(int, Float) - Method in class org.json.JSONArray
    +
    optFloatObject(int, Float) - Method in class org.json.JSONArray
    Get the optional Float object associated with an index.
    -
    optFloatObject(String) - Method in class org.json.JSONObject
    +
    optFloatObject(String) - Method in class org.json.JSONObject
    Get the optional Float object associated with an index.
    -
    optFloatObject(String, Float) - Method in class org.json.JSONObject
    +
    optFloatObject(String, Float) - Method in class org.json.JSONObject
    Get the optional Float object associated with an index.
    -
    optInt(int) - Method in class org.json.JSONArray
    +
    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
    +
    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
    +
    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
    +
    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.
    -
    optIntegerObject(int) - Method in class org.json.JSONArray
    +
    optIntegerObject(int) - Method in class org.json.JSONArray
    Get the optional Integer object associated with an index.
    -
    optIntegerObject(int, Integer) - Method in class org.json.JSONArray
    +
    optIntegerObject(int, Integer) - Method in class org.json.JSONArray
    Get the optional Integer object associated with an index.
    -
    optIntegerObject(String) - Method in class org.json.JSONObject
    +
    optIntegerObject(String) - Method in class org.json.JSONObject
    Get an optional Integer object associated with a key, or zero if there is no such key or if the value is not a number.
    -
    optIntegerObject(String, Integer) - Method in class org.json.JSONObject
    +
    optIntegerObject(String, Integer) - Method in class org.json.JSONObject
    Get an optional Integer object 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
    +
    optJSONArray(int) - Method in class org.json.JSONArray
    Get the optional JSONArray associated with an index.
    -
    optJSONArray(int, JSONArray) - Method in class org.json.JSONArray
    +
    optJSONArray(int, JSONArray) - Method in class org.json.JSONArray
    Get the optional JSONArray associated with an index.
    -
    optJSONArray(String) - Method in class org.json.JSONObject
    +
    optJSONArray(String) - Method in class org.json.JSONObject
    Get an optional JSONArray associated with a key.
    -
    optJSONArray(String, JSONArray) - Method in class org.json.JSONObject
    +
    optJSONArray(String, JSONArray) - Method in class org.json.JSONObject
    Get an optional JSONArray associated with a key, or the default if there is no such key, or if its value is not a JSONArray.
    -
    optJSONObject(int) - Method in class org.json.JSONArray
    +
    optJSONObject(int) - Method in class org.json.JSONArray
    Get the optional JSONObject associated with an index.
    -
    optJSONObject(int, JSONObject) - Method in class org.json.JSONArray
    +
    optJSONObject(int, JSONObject) - Method in class org.json.JSONArray
    Get the optional JSONObject associated with an index.
    -
    optJSONObject(String) - Method in class org.json.JSONObject
    +
    optJSONObject(String) - Method in class org.json.JSONObject
    Get an optional JSONObject associated with a key.
    -
    optJSONObject(String, JSONObject) - Method in class org.json.JSONObject
    +
    optJSONObject(String, JSONObject) - Method in class org.json.JSONObject
    Get an optional JSONObject associated with a key, or the default if there is no such key or if the value is not a JSONObject.
    -
    optLong(int) - Method in class org.json.JSONArray
    +
    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
    +
    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
    +
    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
    +
    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.
    -
    optLongObject(int) - Method in class org.json.JSONArray
    +
    optLongObject(int) - Method in class org.json.JSONArray
    Get the optional Long object associated with an index.
    -
    optLongObject(int, Long) - Method in class org.json.JSONArray
    +
    optLongObject(int, Long) - Method in class org.json.JSONArray
    Get the optional Long object associated with an index.
    -
    optLongObject(String) - Method in class org.json.JSONObject
    +
    optLongObject(String) - Method in class org.json.JSONObject
    Get an optional Long object associated with a key, or zero if there is no such key or if the value is not a number.
    -
    optLongObject(String, Long) - Method in class org.json.JSONObject
    +
    optLongObject(String, Long) - Method in class org.json.JSONObject
    Get an optional Long object 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
    +
    optNumber(int) - Method in class org.json.JSONArray
    -
    Get an optional Number value associated with a key, or null +
    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
    +
    optNumber(int, Number) - Method in class org.json.JSONArray
    -
    Get an optional Number value associated with a key, or the default if there +
    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
    +
    optNumber(String) - Method in class org.json.JSONObject
    -
    Get an optional Number value associated with a key, or null +
    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
    +
    optNumber(String, Number) - Method in class org.json.JSONObject
    -
    Get an optional Number value associated with a key, or the default if there +
    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
    +
    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(String) - Method in class org.json.JSONObject
    +
    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(JSONPointer) - Method in class org.json.JSONArray
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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
    +
    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.JSONMLParserConfiguration
    +
    ORIGINAL - Static variable in class org.json.JSONMLParserConfiguration
    Original Configuration of the XML to JSONML Parser.
    -
    ORIGINAL - Static variable in class org.json.XMLParserConfiguration
    +
    ORIGINAL - Static variable in class org.json.XMLParserConfiguration
    Original Configuration of the XML Parser.
    -

    P

    -
    -
    ParserConfiguration - Class in org.json
    + + + +

    P

    +
    +
    ParserConfiguration - Class in org.json
    Configuration base object for parsers.
    -
    ParserConfiguration() - Constructor for class org.json.ParserConfiguration
    +
    ParserConfiguration() - Constructor for class org.json.ParserConfiguration
    Constructs a new ParserConfiguration with default settings.
    -
    ParserConfiguration(boolean, int) - Constructor for class org.json.ParserConfiguration
    +
    ParserConfiguration(boolean, int) - Constructor for class org.json.ParserConfiguration
    Constructs a new ParserConfiguration with the specified settings.
    -
    Property - Class in org.json
    +
    Property - Class in org.json
    Converts a Property file data into JSONObject and back.
    -
    Property() - Constructor for class org.json.Property
    +
    Property() - Constructor for class org.json.Property
    Constructs a new Property object.
    -
    put(boolean) - Method in class org.json.JSONArray
    +
    put(boolean) - Method in class org.json.JSONArray
    Append a boolean value.
    -
    put(double) - Method in class org.json.JSONArray
    +
    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
    +
    put(float) - Method in class org.json.JSONArray
    Append a float value.
    -
    put(int) - Method in class org.json.JSONArray
    +
    put(int) - Method in class org.json.JSONArray
    Append an int value.
    -
    put(int, boolean) - Method in class org.json.JSONArray
    -
    -
    Put or replace a boolean value in the JSONArray.
    -
    -
    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, Object) - Method in class org.json.JSONArray
    -
    -
    Put or replace an object 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, 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, Map<?, ?>, JSONParserConfiguration) - 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(long) - Method in class org.json.JSONArray
    +
    put(long) - Method in class org.json.JSONArray
    Append an long value.
    -
    put(Object) - Method in class org.json.JSONArray
    -
    -
    Append an object value.
    -
    -
    put(String, boolean) - Method in class org.json.JSONObject
    -
    -
    Put a key/boolean pair in the JSONObject.
    -
    -
    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, Object) - Method in class org.json.JSONObject
    -
    -
    Put a key/value 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, 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(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(Map<?, ?>) - Method in class org.json.JSONArray
    +
    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.
    -
    putAll(Iterable<?>) - Method in class org.json.JSONArray
    +
    put(Object) - Method in class org.json.JSONArray
    -
    Put an Iterable's elements in to the JSONArray.
    +
    Append an object value.
    -
    putAll(Object) - Method in class org.json.JSONArray
    +
    put(int, boolean) - Method in class org.json.JSONArray
    -
    Put an array's elements in to the JSONArray.
    +
    Put or replace a boolean value in the JSONArray.
    -
    putAll(Collection<?>) - Method in class org.json.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, Map<?, ?>, JSONParserConfiguration) - 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(JSONArray) - Method in class org.json.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.
    -
    putOnce(String, Object) - Method in class org.json.JSONObject
    +
    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
    +
    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
    + + + +

    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(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.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(JSONPointer) - Method in class org.json.JSONObject
    +
    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
    +
    queryFrom(Object) - Method in class org.json.JSONPointer
    Evaluates this JSON Pointer on the given document.
    -
    QUEST - Static variable in class org.json.XML
    +
    QUEST - Static variable in class org.json.XML
    The Character '?'.
    -
    QUOT - Static variable in class org.json.XML
    +
    QUOT - Static variable in class org.json.XML
    The Character '"'.
    -
    quote(String) - Static method in class org.json.JSONObject
    +
    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
    +
    quote(String, Writer) - Static method in class org.json.JSONObject
    Quotes a string and appends the result to a given Writer.
    -

    R

    -
    -
    remove(int) - Method in class org.json.JSONArray
    + + + +

    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(String) - Method in class org.json.JSONObject
    Remove a name and its value, if present.
    -
    rowToJSONArray(JSONTokener) - Static method in class org.json.CDL
    +
    rowToJSONArray(JSONTokener) - Static method in class org.json.CDL
    Produce a JSONArray of strings from a row of comma delimited values.
    -
    rowToJSONArray(JSONTokener, char) - Static method in class org.json.CDL
    +
    rowToJSONArray(JSONTokener, char) - 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
    +
    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.
    -
    rowToJSONObject(JSONArray, JSONTokener, char) - Static method in class org.json.CDL
    +
    rowToJSONObject(JSONArray, JSONTokener, char) - 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
    +
    rowToString(JSONArray) - Static method in class org.json.CDL
    Produce a comma delimited text row from a JSONArray.
    -
    rowToString(JSONArray, char) - Static method in class org.json.CDL
    +
    rowToString(JSONArray, char) - Static method in class org.json.CDL
    Produce a comma delimited text row from a JSONArray.
    -

    S

    -
    -
    shouldTrimWhiteSpace() - Method in class org.json.XMLParserConfiguration
    + + + +

    S

    +
    +
    setJsonParserConfiguration(JSONParserConfiguration) - Method in class org.json.JSONTokener
    +
    +
    Setter
    +
    +
    shouldTrimWhiteSpace() - Method in class org.json.XMLParserConfiguration
    Checks if the parser should trim white spaces from XML content.
    -
    similar(Object) - Method in class org.json.JSONArray
    +
    similar(Object) - Method in class org.json.JSONArray
    Determine if two JSONArrays are similar.
    -
    similar(Object) - Method in class org.json.JSONObject
    +
    similar(Object) - Method in class org.json.JSONObject
    Determine if two JSONObjects are similar.
    -
    skipPast(String) - Method in class org.json.XMLTokener
    +
    skipPast(String) - Method in class org.json.XMLTokener
    Skip characters until past the requested string.
    -
    skipTo(char) - Method in class org.json.JSONTokener
    +
    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
    +
    SLASH - Static variable in class org.json.XML
    The Character '/'.
    -
    stringToNumber(String) - Static method in class org.json.JSONObject
    +
    StringBuilderWriter - Class in org.json
    +
    +
    Performance optimised alternative for StringWriter + using internally a StringBuilder instead of a StringBuffer.
    +
    +
    StringBuilderWriter() - Constructor for class org.json.StringBuilderWriter
    +
    +
    Create a new string builder writer using the default initial string-builder buffer size.
    +
    +
    StringBuilderWriter(int) - Constructor for class org.json.StringBuilderWriter
    +
    +
    Create a new string builder writer using the specified initial string-builder buffer size.
    +
    +
    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
    +
    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
    -
    -
    This method is the same as JSONObject.stringToValue(String).
    -
    -
    stringToValue(String, XMLXsiTypeConverter<?>) - Static method in class org.json.XML
    +
    stringToValue(String, XMLXsiTypeConverter<?>) - Static method in class org.json.XML
    This method tries to convert the given string value to the target object
    -
    syntaxError(String) - Method in class org.json.JSONTokener
    +
    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
    +
    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
    + + + +

    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
    +
    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(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(String, char) - Static method in class org.json.CDL
    +
    toJSONArray(String, char) - 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(String, JSONMLParserConfiguration) - Static method in class org.json.JSONML
    +
    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(JSONTokener, char) - 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, String, char) - 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(JSONArray, JSONTokener, char) - 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(JSONArray) - Method in class org.json.JSONObject
    +
    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(String, JSONMLParserConfiguration) - 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, JSONMLParserConfiguration) - 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.
    -
    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, String, char) - 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(JSONArray, JSONTokener, char) - 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(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(JSONTokener, char) - 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(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(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, JSONMLParserConfiguration) - Static method in class org.json.JSONML
    -
    -
    Convert a well-formed (but not necessarily valid) XML string into a - JSONArray using the JsonML transform.
    -
    -
    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) - Static method in class org.json.Cookie
    +
    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
    +
    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
    +
    toJSONObject(String) - Static method in class org.json.HTTP
    Convert an HTTP header string into a JSONObject.
    -
    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) - Static method in class org.json.XML
    -
    -
    Convert a well-formed (but not necessarily valid) XML string into a - JSONObject.
    -
    -
    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(String, boolean) - Static method in class org.json.XML
    -
    -
    Convert a well-formed (but not necessarily valid) XML string into a - JSONObject.
    -
    -
    toJSONObject(String, JSONMLParserConfiguration) - 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, XMLParserConfiguration) - Static method in class org.json.XML
    -
    -
    Convert a well-formed (but not necessarily valid) XML string into a - JSONObject.
    -
    -
    toJSONObject(Properties) - Static method in class org.json.Property
    -
    -
    Converts a property file object into a JSONObject.
    -
    -
    toJSONObject(JSONArray) - Method in class org.json.JSONArray
    +
    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
    +
    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(XMLTokener, boolean) - Static method in class org.json.JSONML
    +
    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, JSONMLParserConfiguration) - Static method in class org.json.JSONML
    +
    toJSONObject(String, JSONMLParserConfiguration) - Static method in class org.json.JSONML
    Convert a well-formed (but not necessarily valid) XML string into a JSONObject using the JsonML transform.
    -
    toJSONString() - Method in interface org.json.JSONString
    +
    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(XMLTokener, JSONMLParserConfiguration) - 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
    +
    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
    +
    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
    +
    toProperties(JSONObject) - Static method in class org.json.Property
    Converts the JSONObject into a property file object.
    -
    toString() - Method in class org.json.JSONArray
    +
    toString(JSONArray) - Static method in class org.json.CDL
    +
    +
    Produce a comma delimited text from a JSONArray of JSONObjects.
    +
    +
    toString(JSONArray, char) - 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(JSONArray, JSONArray, char) - 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() - Method in class org.json.JSONObject
    +
    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() - Method in class org.json.JSONPointer
    +
    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
    +
    toString() - Method in class org.json.JSONStringer
    Return the JSON text.
    -
    toString() - Method in class org.json.JSONTokener
    +
    toString() - Method in class org.json.JSONTokener
    Make a printable string of this JSONTokener.
    -
    toString(int) - Method in class org.json.JSONArray
    -
    -
    Make a pretty-printed JSON text of this JSONArray.
    -
    -
    toString(int) - Method in class org.json.JSONObject
    -
    -
    Make a pretty-printed JSON text of this JSONObject.
    -
    -
    toString(Object) - Static method in class org.json.XML
    +
    toString() - Method in class org.json.StringBuilderWriter
    +
     
    +
    toString(Object) - Static method in class org.json.XML
    Convert a JSONObject into a well-formed, element-normal XML string.
    -
    toString(Object, int) - Static method in class org.json.XML
    -
    -
    Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
    -
    -
    toString(Object, String) - Static method in class org.json.XML
    +
    toString(Object, String) - Static method in class org.json.XML
    Convert a JSONObject into a well-formed, element-normal XML string.
    -
    toString(Object, String, int) - Static method in class org.json.XML
    -
    -
    Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
    -
    -
    toString(Object, String, XMLParserConfiguration) - Static method in class org.json.XML
    +
    toString(Object, String, XMLParserConfiguration) - Static method in class org.json.XML
    Convert a JSONObject into a well-formed, element-normal XML string.
    -
    toString(Object, String, XMLParserConfiguration, int) - Static method in class org.json.XML
    +
    toString(Object, int) - Static method in class org.json.XML
    Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
    -
    toString(JSONArray) - Static method in class org.json.CDL
    +
    toString(Object, String, int) - Static method in class org.json.XML
    -
    Produce a comma delimited text from a JSONArray of JSONObjects.
    +
    Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
    -
    toString(JSONArray) - Static method in class org.json.JSONML
    +
    toString(Object, String, XMLParserConfiguration, int) - Static method in class org.json.XML
    -
    Reverse the JSONML transformation, making an XML text from a JSONArray.
    +
    Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
    -
    toString(JSONArray, char) - 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(JSONArray, JSONArray, char) - 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(JSONObject) - Static method in class org.json.JSONML
    -
    -
    Reverse the JSONML transformation, making an XML text from a JSONObject.
    -
    -
    toURIFragment() - Method in class org.json.JSONPointer
    +
    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
    +
    TYPE_ATTR - Static variable in class org.json.XML
    Represents the XML attribute name for specifying type information.
    -

    U

    -
    -
    UNDEFINED_MAXIMUM_NESTING_DEPTH - Static variable in class org.json.ParserConfiguration
    + + + +

    U

    +
    +
    UNDEFINED_MAXIMUM_NESTING_DEPTH - Static variable in class org.json.ParserConfiguration
    Used to indicate there's no defined limit to the maximum nesting depth when parsing a document.
    -
    unescape(String) - Static method in class org.json.Cookie
    +
    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
    +
    unescape(String) - Static method in class org.json.XML
    Removes XML escapes from the string.
    -

    V

    -
    -
    value() - Element in annotation interface org.json.JSONPropertyName
    -
    -
    The value of the JSON property.
    -
    -
    value(boolean) - Method in class org.json.JSONWriter
    + + + +

    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
    +
    value(double) - Method in class org.json.JSONWriter
    Append a double value.
    -
    value(long) - Method in class org.json.JSONWriter
    +
    value(long) - Method in class org.json.JSONWriter
    Append a long value.
    -
    value(Object) - Method in class org.json.JSONWriter
    +
    value(Object) - Method in class org.json.JSONWriter
    Append an object value.
    -
    valueToString(Object) - Static method in class org.json.JSONObject
    +
    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
    +
    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
    + + + +

    W

    +
    +
    withcDataTagName(String) - Method in class org.json.XMLParserConfiguration
    The name of the key in a JSON Object that indicates a CDATA section.
    -
    withCloseEmptyTag(boolean) - Method in class org.json.XMLParserConfiguration
    +
    withCloseEmptyTag(boolean) - Method in class org.json.XMLParserConfiguration
    To enable explicit end tag with empty value.
    -
    withConvertNilAttributeToNull(boolean) - Method in class org.json.XMLParserConfiguration
    +
    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)
    -
    withForceList(Set<String>) - Method in class org.json.XMLParserConfiguration
    +
    withForceList(Set<String>) - Method in class org.json.XMLParserConfiguration
    When parsing the XML into JSON, specifies that tags that will be converted to arrays in this configuration Set<String> to parse the provided tags' values as arrays
    -
    withKeepStrings(boolean) - Method in class org.json.JSONMLParserConfiguration
    +
    withKeepStrings(boolean) - Method in class org.json.JSONMLParserConfiguration
     
    -
    withKeepStrings(boolean) - Method in class org.json.ParserConfiguration
    +
    withKeepStrings(boolean) - Method in class org.json.ParserConfiguration
    When parsing the XML into JSONML, specifies if values should be kept as strings (true), or if they should try to be guessed into JSON values (numeric, boolean, string)
    -
    withKeepStrings(boolean) - Method in class org.json.XMLParserConfiguration
    +
    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)
    -
    withMaxNestingDepth(int) - Method in class org.json.JSONMLParserConfiguration
    +
    withMaxNestingDepth(int) - Method in class org.json.JSONMLParserConfiguration
     
    -
    withMaxNestingDepth(int) - Method in class org.json.JSONParserConfiguration
    -
     
    -
    withMaxNestingDepth(int) - Method in class org.json.ParserConfiguration
    +
    withMaxNestingDepth(int) - Method in class org.json.JSONParserConfiguration
    Defines the maximum nesting depth that the parser will descend before throwing an exception - when parsing the XML into JSONML.
    + when parsing a map into JSONObject or parsing a Collection instance into + JSONArray.
    -
    withMaxNestingDepth(int) - Method in class org.json.XMLParserConfiguration
    +
    withMaxNestingDepth(int) - Method in class org.json.ParserConfiguration
    +
    +
    Defines the maximum nesting depth that the parser will descend before throwing an exception + when parsing an object (e.g.
    +
    +
    withMaxNestingDepth(int) - Method in class org.json.XMLParserConfiguration
    Defines the maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSON.
    -
    withShouldTrimWhitespace(boolean) - Method in class org.json.XMLParserConfiguration
    +
    withOverwriteDuplicateKey(boolean) - Method in class org.json.JSONParserConfiguration
    +
    +
    Controls the parser's behavior when meeting duplicate keys.
    +
    +
    withShouldTrimWhitespace(boolean) - Method in class org.json.XMLParserConfiguration
    Sets whether whitespace should be trimmed inside of tags.
    -
    withXsiTypeMap(Map<String, XMLXsiTypeConverter<?>>) - Method in class org.json.XMLParserConfiguration
    +
    withStrictMode() - Method in class org.json.JSONParserConfiguration
    +
    +
    Sets the strict mode configuration for the JSON parser with default true value
    +
    +
    withStrictMode(boolean) - Method in class org.json.JSONParserConfiguration
    +
    +
    Sets the strict mode configuration for the JSON parser.
    +
    +
    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(Object) - Static method in class org.json.JSONObject
    Wrap an object, if necessary.
    -
    write(Writer) - Method in class org.json.JSONArray
    +
    write(Writer) - 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.JSONArray
    +
    write(Writer, int, int) - 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.JSONObject
    +
    write(Writer) - 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
    +
    write(Writer, int, int) - Method in class org.json.JSONObject
    +
    +
    Write the contents of the JSONObject as JSON text to a writer.
    +
    +
    write(int) - Method in class org.json.StringBuilderWriter
    +
     
    +
    write(char[], int, int) - Method in class org.json.StringBuilderWriter
    +
     
    +
    write(String) - Method in class org.json.StringBuilderWriter
    +
     
    +
    write(String, int, int) - Method in class org.json.StringBuilderWriter
    +
     
    +
    writer - Variable in class org.json.JSONWriter
    The writer that will receive the output.
    -

    X

    -
    -
    XML - Class in org.json
    + + + +

    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
    +
    XML() - Constructor for class org.json.XML
    Constructs a new XML object.
    -
    XMLParserConfiguration - Class in org.json
    +
    XMLParserConfiguration - Class in org.json
    Configuration object for the XML parser.
    -
    XMLParserConfiguration() - Constructor for class org.json.XMLParserConfiguration
    +
    XMLParserConfiguration() - Constructor for class org.json.XMLParserConfiguration
    Default parser configuration.
    -
    XMLParserConfiguration(boolean) - Constructor for class org.json.XMLParserConfiguration
    +
    XMLParserConfiguration(boolean) - Constructor for class org.json.XMLParserConfiguration
    -
    Deprecated. -
    This constructor has been deprecated in favor of using the new builder +
    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.
    + This constructor may be removed in a future release.
    -
    XMLParserConfiguration(boolean, String) - Constructor for class org.json.XMLParserConfiguration
    +
    XMLParserConfiguration(String) - Constructor for class org.json.XMLParserConfiguration
    -
    Deprecated. -
    This constructor has been deprecated in favor of using the new builder +
    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.
    + This constructor may be removed in a future release.
    -
    XMLParserConfiguration(boolean, String, boolean) - Constructor for class org.json.XMLParserConfiguration
    +
    XMLParserConfiguration(boolean, String) - Constructor for class org.json.XMLParserConfiguration
    -
    Deprecated. -
    This constructor has been deprecated in favor of using the new builder +
    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.
    + This constructor may be removed in a future release.
    -
    XMLParserConfiguration(String) - Constructor for class org.json.XMLParserConfiguration
    +
    XMLParserConfiguration(boolean, String, boolean) - Constructor for class org.json.XMLParserConfiguration
    -
    Deprecated. -
    This constructor has been deprecated in favor of using the new builder +
    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.
    + This constructor may be removed or marked private in a future release.
    -
    XMLTokener - Class in org.json
    +
    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
    +
    XMLTokener(Reader) - Constructor for class org.json.XMLTokener
    Construct an XMLTokener from a Reader.
    -
    XMLTokener(Reader, XMLParserConfiguration) - Constructor for class org.json.XMLTokener
    -
    -
    Construct an XMLTokener from a Reader and an XMLParserConfiguration.
    -
    -
    XMLTokener(String) - Constructor for class org.json.XMLTokener
    +
    XMLTokener(String) - Constructor for class org.json.XMLTokener
    Construct an XMLTokener from a string.
    -
    XMLXsiTypeConverter<T> - Interface in org.json
    +
    XMLTokener(Reader, XMLParserConfiguration) - Constructor for class org.json.XMLTokener
    +
    +
    Construct an XMLTokener from a Reader and an XMLParserConfiguration.
    +
    +
    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 
    All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form +A B C D E F G H I J K L M N O P Q R S T U V W X 
    + +
    + + + + + + +
    + + diff --git a/src/main/java/JSON-Java/index.html b/src/main/java/JSON-Java/index.html index 5d56677..811494c 100644 --- a/src/main/java/JSON-Java/index.html +++ b/src/main/java/JSON-Java/index.html @@ -1,26 +1,72 @@ - + + - + Generated Documentation (Untitled) - - - - - - - - - + - -
    + + + + <noscript> -<p>JavaScript is disabled on your browser.</p> +<div>JavaScript is disabled on your browser.</div> </noscript> -<p><a href="org/json/package-summary.html">org/json/package-summary.html</a></p> -</main> -</body> +<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/src/main/java/JSON-Java/org/json/CDL.html b/src/main/java/JSON-Java/org/json/CDL.html index ab7efa4..e1da546 100644 --- a/src/main/java/JSON-Java/org/json/CDL.html +++ b/src/main/java/JSON-Java/org/json/CDL.html @@ -1,83 +1,114 @@ - + + - + CDL - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class CDL

    +
    org.json
    +

    Class CDL

    -
    java.lang.Object -
    org.json.CDL
    -
    -
    +
    + +
    +
      +

    • -
      public class CDL -extends Object
      +
      +
      public class CDL
      +extends Object
      This provides static methods to convert comma (or otherwise) delimited text into a JSONArray, and to convert a JSONArray into comma (or otherwise) delimited text. Comma delimited text is a very popular format for data interchange. It is @@ -93,536 +124,682 @@ loadScripts(document, 'script'); 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.
      -
    -
    -
      + +
    +
    +
    + + + + +
      +
    • +

      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:
      +
      +
      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:
      +
      Returns:
      A JSONObject combining the names and values.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      rowToJSONObject

      -
      public static JSONObject rowToJSONObject(JSONArray names, - JSONTokener x, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      rowToJSONObject

      +
      public static JSONObject rowToJSONObject(JSONArray names,
      +                                         JSONTokener x,
      +                                         char delimiter)
      +                                  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:
      +
      +
      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.
      delimiter - custom delimiter char
      -
      Returns:
      +
      Returns:
      A JSONObject combining the names and values.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      rowToString

      -
      public static String rowToString(JSONArray ja)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      ja - A JSONArray of strings.
      -
      Returns:
      +
      Returns:
      A string ending in NEWLINE.
      -
    • -
    • -
      -

      rowToString

      -
      public static String rowToString(JSONArray ja, - char delimiter)
      +
    + + + +
      +
    • +

      rowToString

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

      toJSONArray

      -
      public static JSONArray toJSONArray(String string) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      string - The comma delimited text.
      -
      Returns:
      +
      Returns:
      A JSONArray of JSONObjects.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toJSONArray

      -
      public static JSONArray toJSONArray(String string, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      toJSONArray

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

      toJSONArray

      -
      public static JSONArray toJSONArray(JSONTokener x) - 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:
      +
      +
      Parameters:
      x - The JSONTokener containing the comma delimited text.
      -
      Returns:
      +
      Returns:
      A JSONArray of JSONObjects.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toJSONArray

      -
      public static JSONArray toJSONArray(JSONTokener x, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      toJSONArray

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

      toJSONArray

      -
      public static JSONArray toJSONArray(JSONArray names, - String string) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      names - A JSONArray of strings.
      string - The comma delimited text.
      -
      Returns:
      +
      Returns:
      A JSONArray of JSONObjects.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toJSONArray

      -
      public static JSONArray toJSONArray(JSONArray names, - String string, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      toJSONArray

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

      toJSONArray

      -
      public static JSONArray toJSONArray(JSONArray names, - JSONTokener x) - 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:
      +
      +
      Parameters:
      names - A JSONArray of strings.
      x - A JSONTokener of the source text.
      -
      Returns:
      +
      Returns:
      A JSONArray of JSONObjects.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toJSONArray

      -
      public static JSONArray toJSONArray(JSONArray names, - JSONTokener x, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      toJSONArray

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

      toString

      -
      public static String toString(JSONArray ja) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      ja - A JSONArray of JSONObjects.
      -
      Returns:
      +
      Returns:
      A comma delimited text.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toString

      -
      public static String toString(JSONArray ja, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      toString

      +
      public static String toString(JSONArray ja,
      +                              char delimiter)
      +                       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:
      +
      +
      Parameters:
      ja - A JSONArray of JSONObjects.
      delimiter - custom delimiter char
      -
      Returns:
      +
      Returns:
      A comma delimited text.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toString

      -
      public static String toString(JSONArray names, - JSONArray ja) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      names - A JSONArray of strings.
      ja - A JSONArray of JSONObjects.
      -
      Returns:
      +
      Returns:
      A comma delimited text.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      toString

      -
      public static String toString(JSONArray names, - JSONArray ja, - char delimiter) - throws JSONException
      +
    + + + +
      +
    • +

      toString

      +
      public static String toString(JSONArray names,
      +                              JSONArray ja,
      +                              char delimiter)
      +                       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:
      +
      +
      Parameters:
      names - A JSONArray of strings.
      ja - A JSONArray of JSONObjects.
      delimiter - custom delimiter char
      -
      Returns:
      +
      Returns:
      A comma delimited text.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    - - + + +
    +
    -
    + +
    + + + + + + +
    + + diff --git a/src/main/java/JSON-Java/org/json/Cookie.html b/src/main/java/JSON-Java/org/json/Cookie.html index 87ffe0e..228b83e 100644 --- a/src/main/java/JSON-Java/org/json/Cookie.html +++ b/src/main/java/JSON-Java/org/json/Cookie.html @@ -1,173 +1,227 @@ - + + - + Cookie - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class Cookie

    +
    org.json
    +

    Class Cookie

    -
    java.lang.Object -
    org.json.Cookie
    -
    -
    +
    + +
    +
      +

    • -
      public class Cookie -extends Object
      +
      +
      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 Summary

      -
      Constructors
      -
      -
      Constructor
      -
      Description
      - -
      -
      Constructs a new Cookie object.
      -
      -
      -
    • +
    +
    +
    +
    +
    +
      +
    • -
    • -
      -

      Constructor Details

      -
        -
      • -
        -

        Cookie

        -
        public Cookie()
        +
          +
        • + + +

          Constructor Detail

          + + + +
            +
          • +

            Cookie

            +
            public Cookie()
            Constructs a new Cookie object.
            -
      -
    • +
    -
  • -
    -

    Method Details

    -
      -
    • -
      -

      escape

      -
      public static String escape(String string)
      +
        +
      • + + +

        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 @@ -176,88 +230,155 @@ loadScripts(document, 'script'); 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:
          +
          +
          Parameters:
          string - The source string.
          -
          Returns:
          +
          Returns:
          The escaped result.
          -
    • -
    • -
      -

      toJSONObject

      -
      public static JSONObject toJSONObject(String string)
      +
    + + + +
      +
    • +

      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). + 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:
      +
      +
      Parameters:
      string - The cookie specification string.
      -
      Returns:
      +
      Returns:
      A JSONObject containing "name", "value", and possibly other members.
      -
      Throws:
      -
      JSONException - If there is an error parsing the Cookie String. +
      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
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      jo - A JSONObject
      -
      Returns:
      +
      Returns:
      A cookie specification string
      -
      Throws:
      -
      JSONException - thrown if the cookie has no name.
      +
      Throws:
      +
      JSONException - thrown if the cookie has no name.
      -
  • -
  • -
    -

    unescape

    -
    public static String unescape(String string)
    + + + + +
      +
    • +

      unescape

      +
      public static String unescape(String string)
      Convert %hh sequences to single characters, and convert plus to space.
      -
      -
      Parameters:
      +
      +
      Parameters:
      string - A string that may contain + (plus) and %hh sequences.
      -
      Returns:
      +
      Returns:
      The unescaped string.
      -
  • - - + + +
    +
    - + +
    + + + + + + +
    + + diff --git a/src/main/java/JSON-Java/org/json/CookieList.html b/src/main/java/JSON-Java/org/json/CookieList.html index 56941fb..18107eb 100644 --- a/src/main/java/JSON-Java/org/json/CookieList.html +++ b/src/main/java/JSON-Java/org/json/CookieList.html @@ -1,160 +1,212 @@ - + + - + CookieList - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class CookieList

    +
    org.json
    +

    Class CookieList

    -
    java.lang.Object -
    org.json.CookieList
    -
    -
    +
    + +
    +
      +

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

      Constructor Summary

      -
      Constructors
      -
      -
      Constructor
      -
      Description
      - -
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + +
        Constructors 
        Constructor and Description
        CookieList()
        Constructs a new CookieList object.
        - - - +
      • +
      -
    • -
      -

      Method Summary

      -
      -
      -
      -
      -
      Modifier and Type
      -
      Method
      -
      Description
      -
      static JSONObject
      - -
      + -
      -
      -
        + +
      +
    • +
      +
        +
      • -
      • -
        -

        Constructor Details

        -
          -
        • -
          -

          CookieList

          -
          public CookieList()
          +
            +
          • + + +

            Constructor Detail

            + + + +
              +
            • +

              CookieList

              +
              public CookieList()
              Constructs a new CookieList object.
              -
        -
      • +
      -
    • -
      -

      Method Details

      -
        -
      • -
        -

        toJSONObject

        -
        public static JSONObject toJSONObject(String string) - throws JSONException
        +
          +
        • + + +

          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 @@ -163,43 +215,104 @@ loadScripts(document, 'script'); To add a cookie to a cookie list, cookielistJSONObject.put(cookieJSONObject.getString("name"), cookieJSONObject.getString("value"));
            -
            -
            Parameters:
            +
            +
            Parameters:
            string - A cookie list string
            -
            Returns:
            +
            Returns:
            A JSONObject
            -
            Throws:
            -
            JSONException - if a called function fails
            +
            Throws:
            +
            JSONException - if a called function fails
            -
      • -
      • -
        -

        toString

        -
        public static String toString(JSONObject jo) - throws JSONException
        +
      + + + +
        +
      • +

        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:
        +
        +
        Parameters:
        jo - A JSONObject
        -
        Returns:
        +
        Returns:
        A cookie list string
        -
        Throws:
        -
        JSONException - if a called function fails
        +
        Throws:
        +
        JSONException - if a called function fails
        -
    - - + + +
    +
    - + +
    + + + + + + +
    + + diff --git a/src/main/java/JSON-Java/org/json/HTTP.html b/src/main/java/JSON-Java/org/json/HTTP.html index 68e9fe1..185821a 100644 --- a/src/main/java/JSON-Java/org/json/HTTP.html +++ b/src/main/java/JSON-Java/org/json/HTTP.html @@ -1,200 +1,255 @@ - + + - + HTTP - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class HTTP

    +
    org.json
    +

    Class HTTP

    -
    java.lang.Object -
    org.json.HTTP
    -
    -
    +
    + +
    +
      +

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

    Method Details

    -
      -
    • -
      -

      toJSONObject

      -
      public static JSONObject toJSONObject(String string) - throws JSONException
      +
        +
      • + + +

        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
          {
          @@ -221,22 +276,25 @@ loadScripts(document, 'script');
            ...
          It does no further checking or conversion. It does not parse dates. It does not do '%' transforms on URLs.
          -
          -
          Parameters:
          +
          +
          Parameters:
          string - An HTTP header string.
          -
          Returns:
          +
          Returns:
          A JSONObject containing the elements and attributes of the XML string.
          -
          Throws:
          -
          JSONException - if a called function fails
          +
          Throws:
          +
          JSONException - if a called function fails
          -
    • -
    • -
      -

      toString

      -
      public static String toString(JSONObject jo) - throws JSONException
      +
    + + + +
      +
    • +

      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),
      @@ -251,25 +309,83 @@ loadScripts(document, 'script');
        }
      Any other members of the JSONObject will be output as HTTP fields. The result will end with two CRLF pairs.
      -
      -
      Parameters:
      +
      +
      Parameters:
      jo - A JSONObject
      -
      Returns:
      +
      Returns:
      An HTTP header string.
      -
      Throws:
      -
      JSONException - if the object does not contain enough +
      Throws:
      +
      JSONException - if the object does not contain enough information.
      -
  • - - + + +
    +
    - + +
    + + + + + + +
    + + diff --git a/src/main/java/JSON-Java/org/json/HTTPTokener.html b/src/main/java/JSON-Java/org/json/HTTPTokener.html index db319aa..48d5ddd 100644 --- a/src/main/java/JSON-Java/org/json/HTTPTokener.html +++ b/src/main/java/JSON-Java/org/json/HTTPTokener.html @@ -1,182 +1,298 @@ - + + - + HTTPTokener - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class HTTPTokener

    +
    org.json
    +

    Class HTTPTokener

    -
    java.lang.Object -
    org.json.JSONTokener -
    org.json.HTTPTokener
    -
    -
    -
    +
    + +
    +
      +

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

      Constructor Details

      -
        -
      • -
        -

        HTTPTokener

        -
        public HTTPTokener(String string)
        +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          HTTPTokener

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

      Method Details

      -
        -
      • -
        -

        nextToken

        -
        public String nextToken() - throws JSONException
        +
          +
        • + + +

          Method Detail

          + + + +
            +
          • +

            nextToken

            +
            public String nextToken()
            +                 throws JSONException
            Get the next token or string. This is used in parsing HTTP headers.
            -
            -
            Returns:
            +
            +
            Returns:
            A String.
            -
            Throws:
            -
            JSONException - if a syntax error occurs
            +
            Throws:
            +
            JSONException - if a syntax error occurs
            -
      -
    - + + +
    +
    - + +
    + + + + + + +
    + + diff --git a/src/main/java/JSON-Java/org/json/JSONArray.html b/src/main/java/JSON-Java/org/json/JSONArray.html index 1827636..6a6f8e0 100644 --- a/src/main/java/JSON-Java/org/json/JSONArray.html +++ b/src/main/java/JSON-Java/org/json/JSONArray.html @@ -1,88 +1,119 @@ - + + - + JSONArray - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONArray

    +
    org.json
    +

    Class JSONArray

    -
    java.lang.Object -
    org.json.JSONArray
    -
    -
    -
    +
    + +
    +
      +
    • +
      All Implemented Interfaces:
      -
      Iterable<Object>
      +
      Iterable<Object>

      -
      public class JSONArray -extends Object -implements 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 @@ -122,1861 +153,2271 @@ implements -
        - -
      • -
        -

        Constructor Summary

        -
        Constructors
        -
        -
        Constructor
        -
        Description
        -
        -
        -
        Construct an empty JSONArray.
        -
        -
        JSONArray(int initialCapacity)
        -
        -
        Construct a JSONArray with the specified initial capacity.
        -
        - -
        -
        Construct a JSONArray from an Iterable.
        -
        - -
        -
        Construct a JSONArray from an array.
        -
        -
        JSONArray(String source)
        -
        -
        Construct a JSONArray from a source JSON text.
        -
        -
        JSONArray(Collection<?> collection)
        -
        -
        Construct a JSONArray from a Collection.
        -
        -
        JSONArray(Collection<?> collection, - JSONParserConfiguration jsonParserConfiguration)
        -
        -
        Construct a JSONArray from a Collection.
        -
        - -
        -
        Construct a JSONArray from another JSONArray.
        -
        - -
        -
        Construct a JSONArray from a JSONTokener.
        -
        -
        -
        -
      • - -
      • -
        -

        Method Summary

        -
        -
        -
        -
        -
        Modifier and Type
        -
        Method
        -
        Description
        -
        void
        - -
        -
        Removes all of the elements from this JSONArray.
        -
        - -
        get(int index)
        -
        -
        Get the object value associated with an index.
        -
        - -
        getBigDecimal(int index)
        -
        -
        Get the BigDecimal value associated with an index.
        -
        - -
        getBigInteger(int index)
        -
        -
        Get the BigInteger value associated with an index.
        -
        -
        boolean
        -
        getBoolean(int index)
        -
        -
        Get the boolean value associated with an index.
        -
        -
        double
        -
        getDouble(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.
        -
        -
        float
        -
        getFloat(int index)
        -
        -
        Get the float value associated with a key.
        -
        -
        int
        -
        getInt(int index)
        -
        -
        Get the int value associated with an index.
        -
        - -
        getJSONArray(int index)
        -
        -
        Get the JSONArray associated with an index.
        -
        - -
        getJSONObject(int index)
        -
        -
        Get the JSONObject associated with an index.
        -
        -
        long
        -
        getLong(int index)
        -
        -
        Get the long value associated with an index.
        -
        - -
        getNumber(int index)
        -
        -
        Get the Number value associated with a key.
        -
        - -
        getString(int index)
        -
        -
        Get the string associated with an index.
        -
        -
        boolean
        - -
        -
        Check if JSONArray is empty.
        -
        -
        boolean
        -
        isNull(int index)
        -
        -
        Determine if the value is null.
        -
        - - -
         
        - -
        join(String separator)
        -
        -
        Make a string from the contents of this JSONArray.
        -
        -
        int
        - -
        -
        Get the number of elements in the JSONArray, included nulls.
        -
        - -
        opt(int index)
        -
        -
        Get the optional object value associated with an index.
        -
        - -
        optBigDecimal(int index, - BigDecimal defaultValue)
        -
        -
        Get the optional BigDecimal value associated with an index.
        -
        - -
        optBigInteger(int index, - BigInteger defaultValue)
        -
        -
        Get the optional BigInteger value associated with an index.
        -
        -
        boolean
        -
        optBoolean(int index)
        -
        -
        Get the optional boolean value associated with an index.
        -
        -
        boolean
        -
        optBoolean(int index, - boolean defaultValue)
        -
        -
        Get the optional boolean value associated with an index.
        -
        - -
        optBooleanObject(int index)
        -
        -
        Get the optional Boolean object associated with an index.
        -
        - -
        optBooleanObject(int index, - Boolean defaultValue)
        -
        -
        Get the optional Boolean object associated with an index.
        -
        -
        double
        -
        optDouble(int index)
        -
        -
        Get the optional double value associated with an index.
        -
        -
        double
        -
        optDouble(int index, - double defaultValue)
        -
        -
        Get the optional double value associated with an index.
        -
        - -
        optDoubleObject(int index)
        -
        -
        Get the optional Double object associated with an index.
        -
        - -
        optDoubleObject(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.
        -
        -
        float
        -
        optFloat(int index)
        -
        -
        Get the optional float value associated with an index.
        -
        -
        float
        -
        optFloat(int index, - float defaultValue)
        -
        -
        Get the optional float value associated with an index.
        -
        - -
        optFloatObject(int index)
        -
        -
        Get the optional Float object associated with an index.
        -
        - -
        optFloatObject(int index, - Float defaultValue)
        -
        -
        Get the optional Float object associated with an index.
        -
        -
        int
        -
        optInt(int index)
        -
        -
        Get the optional int value associated with an index.
        -
        -
        int
        -
        optInt(int index, - int defaultValue)
        -
        -
        Get the optional int value associated with an index.
        -
        - -
        optIntegerObject(int index)
        -
        -
        Get the optional Integer object associated with an index.
        -
        - -
        optIntegerObject(int index, - Integer defaultValue)
        -
        -
        Get the optional Integer object associated with an index.
        -
        - -
        optJSONArray(int index)
        -
        -
        Get the optional JSONArray associated with an index.
        -
        - -
        optJSONArray(int index, - JSONArray defaultValue)
        -
        -
        Get the optional JSONArray associated with an index.
        -
        - -
        optJSONObject(int index)
        -
        -
        Get the optional JSONObject associated with an index.
        -
        - -
        optJSONObject(int index, - JSONObject defaultValue)
        -
        -
        Get the optional JSONObject associated with an index.
        -
        -
        long
        -
        optLong(int index)
        -
        -
        Get the optional long value associated with an index.
        -
        -
        long
        -
        optLong(int index, - long defaultValue)
        -
        -
        Get the optional long value associated with an index.
        -
        - -
        optLongObject(int index)
        -
        -
        Get the optional Long object associated with an index.
        -
        - -
        optLongObject(int index, - Long defaultValue)
        -
        -
        Get the optional Long object associated with an index.
        -
        - -
        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.
        -
        - -
        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.
        -
        - -
        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.
        -
        - -
        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.
        -
        - -
        optString(int index)
        -
        -
        Get the optional string value associated with an index.
        -
        - -
        optString(int index, - String defaultValue)
        -
        -
        Get the optional string associated with an index.
        -
        - -
        put(boolean value)
        -
        -
        Append a boolean value.
        -
        - -
        put(double value)
        -
        -
        Append a double value.
        -
        - -
        put(float value)
        -
        -
        Append a float value.
        -
        - -
        put(int value)
        -
        -
        Append an int value.
        -
        - -
        put(int index, - boolean value)
        -
        -
        Put or replace a boolean value in the JSONArray.
        -
        - -
        put(int index, - double value)
        -
        -
        Put or replace a double value.
        -
        - -
        put(int index, - float value)
        -
        -
        Put or replace a float value.
        -
        - -
        put(int index, - int value)
        -
        -
        Put or replace an int value.
        -
        - -
        put(int index, - long value)
        -
        -
        Put or replace a long value.
        -
        - -
        put(int index, - Object value)
        -
        -
        Put or replace an object value in the JSONArray.
        -
        - -
        put(int index, - Collection<?> value)
        -
        -
        Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
        -
        - -
        put(int index, - Map<?,?> value)
        -
        -
        Put a value in the JSONArray, where the value will be a JSONObject that - is produced from a Map.
        -
        - -
        put(int index, - Map<?,?> value, - JSONParserConfiguration jsonParserConfiguration)
        -
        -
        Put a value in the JSONArray, where the value will be a JSONObject that - is produced from a Map.
        -
        - -
        put(long value)
        -
        -
        Append an long value.
        -
        - -
        put(Object value)
        -
        -
        Append an object value.
        -
        - -
        put(Collection<?> value)
        -
        -
        Put a value in the JSONArray, where the value will be a JSONArray which - is produced from a Collection.
        -
        - -
        put(Map<?,?> value)
        -
        -
        Put a value in the JSONArray, where the value will be a JSONObject which - is produced from a Map.
        -
        - -
        putAll(Iterable<?> iter)
        -
        -
        Put an Iterable's elements in to the JSONArray.
        -
        - -
        putAll(Object array)
        -
        -
        Put an array's elements in to the JSONArray.
        -
        - -
        putAll(Collection<?> collection)
        -
        -
        Put a collection's elements in to the JSONArray.
        -
        - - -
        -
        Put a JSONArray's elements in to the JSONArray.
        -
        - -
        query(String jsonPointer)
        -
        -
        Creates a JSONPointer using an initialization string and tries to - match it to an item within this JSONArray.
        -
        - -
        query(JSONPointer jsonPointer)
        -
        -
        Uses a user initialized JSONPointer and tries to - match it to an item within this JSONArray.
        -
        - -
        remove(int index)
        -
        -
        Remove an index and close the hole.
        -
        -
        boolean
        -
        similar(Object other)
        -
        -
        Determine if two JSONArrays are similar.
        -
        - - -
        -
        Produce a JSONObject by combining a JSONArray of names with the values of - this JSONArray.
        -
        - - -
        -
        Returns a java.util.List containing all of the elements in this array.
        -
        - - -
        -
        Make a JSON text of this JSONArray.
        -
        - -
        toString(int indentFactor)
        -
        -
        Make a pretty-printed JSON text of this JSONArray.
        -
        - -
        write(Writer writer)
        -
        -
        Write the contents of the JSONArray as JSON text to a writer.
        -
        - -
        write(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 Details

      -
        -
      • -
        -

        JSONArray

        -
        public JSONArray()
        +
    +
    +
      +
    • + + + +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Instance Methods Concrete Methods 
        Modifier and TypeMethod and Description
        voidclear() +
        Removes all of the elements from this JSONArray.
        +
        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.
        +
        BooleanoptBooleanObject(int index) +
        Get the optional Boolean object associated with an index.
        +
        BooleanoptBooleanObject(int index, + Boolean defaultValue) +
        Get the optional Boolean object 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.
        +
        DoubleoptDoubleObject(int index) +
        Get the optional Double object associated with an index.
        +
        DoubleoptDoubleObject(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.
        +
        FloatoptFloatObject(int index) +
        Get the optional Float object associated with an index.
        +
        FloatoptFloatObject(int index, + Float defaultValue) +
        Get the optional Float object 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.
        +
        IntegeroptIntegerObject(int index) +
        Get the optional Integer object associated with an index.
        +
        IntegeroptIntegerObject(int index, + Integer defaultValue) +
        Get the optional Integer object associated with an index.
        +
        JSONArrayoptJSONArray(int index) +
        Get the optional JSONArray associated with an index.
        +
        JSONArrayoptJSONArray(int index, + JSONArray defaultValue) +
        Get the optional JSONArray associated with an index.
        +
        JSONObjectoptJSONObject(int index) +
        Get the optional JSONObject associated with an index.
        +
        JSONObjectoptJSONObject(int index, + JSONObject defaultValue) +
        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.
        +
        LongoptLongObject(int index) +
        Get the optional Long object associated with an index.
        +
        LongoptLongObject(int index, + Long defaultValue) +
        Get the optional Long object 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, + Map<?,?> value, + JSONParserConfiguration jsonParserConfiguration) +
        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(JSONTokener x,
          +                 JSONParserConfiguration jsonParserConfiguration)
          +          throws JSONException
          +
          Constructs a JSONArray from a JSONTokener and a JSONParserConfiguration.
          +
          +
          Parameters:
          +
          x - A JSONTokener instance from which the JSONArray is constructed.
          +
          jsonParserConfiguration - A JSONParserConfiguration instance that controls the behavior of the parser.
          +
          Throws:
          +
          JSONException - If a syntax error occurs during the construction of the JSONArray.
          +
          +
        • +
        + + + +
          +
        • +

          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.
          +
          Throws:
          +
          JSONException - If there is a syntax error.
          -
        • -
        • -
          -

          JSONArray

          -
          public JSONArray(Collection<?> collection)
          +
        + + + +
          +
        • +

          JSONArray

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

          JSONArray

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

          JSONArray

          -
          public JSONArray(Collection<?> collection, - JSONParserConfiguration jsonParserConfiguration)
          +
        + + + +
          +
        • +

          JSONArray

          +
          public JSONArray(Collection<?> collection,
          +                 JSONParserConfiguration jsonParserConfiguration)
          Construct a JSONArray from a Collection.
          -
          -
          Parameters:
          +
          +
          Parameters:
          collection - A Collection.
          jsonParserConfiguration - Configuration object for the JSON parser
          - -
        • -
        • -
          -

          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.
          -
          -
        - + + + +
          +
        • +

          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 Details

      - + + + +
        +
      • +

        get

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

      getBoolean

      -
      public boolean getBoolean(int index) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The truth.
      -
      Throws:
      -
      JSONException - If there is no value for the index or if the value is not +
      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
      +
    + + + +
      +
    • +

      getDouble

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

      getFloat

      +
      public float getFloat(int index)
      +               throws JSONException
      Get the float value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The numeric value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value is not a Number +
      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
      +
    + + + +
      +
    • +

      getNumber

      +
      public Number getNumber(int index)
      +                 throws JSONException
      Get the Number value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The numeric value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value is not a Number +
      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
      +
    + + + +
      +
    • +

      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:
      +
      +
      Type Parameters:
      E - Enum Type
      -
      Parameters:
      +
      Parameters:
      clazz - The type of enum to retrieve.
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The enum value at the index location
      -
      Throws:
      -
      JSONException - if the key is not found or if the value cannot be converted +
      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
      +
    + + + +
      +
    • +

      getBigDecimal

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

      getBigInteger

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

      getInt

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

      getJSONArray

      -
      public JSONArray getJSONArray(int index) - throws JSONException
      +
    + + + +
      +
    • +

      getJSONArray

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

      getJSONObject

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

      getLong

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

      getString

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

      isNull

      -
      public boolean isNull(int index)
      +
    + + + +
      +
    • +

      isNull

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

      join

      -
      public String join(String separator) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      separator - A string that will be inserted between the elements.
      -
      Returns:
      +
      Returns:
      a string.
      -
      Throws:
      -
      JSONException - If the array contains an invalid number.
      +
      Throws:
      +
      JSONException - If the array contains an invalid number.
      -
    • -
    • -
      -

      length

      -
      public int length()
      +
    + + + +
      +
    • +

      length

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

      clear

      -
      public void clear()
      +
    + + + +
      +
    • +

      clear

      +
      public void clear()
      Removes all of the elements from this JSONArray. The JSONArray will be empty after this call returns.
      -
    • -
    • -
      -

      opt

      -
      public Object opt(int index)
      +
    + + + +
      +
    • +

      opt

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

      optBoolean

      -
      public boolean optBoolean(int 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The truth.
      -
    • -
    • -
      -

      optBoolean

      -
      public boolean optBoolean(int index, - boolean defaultValue)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - A boolean default.
      -
      Returns:
      +
      Returns:
      The truth.
      -
    • -
    • -
      -

      optBooleanObject

      -
      public Boolean optBooleanObject(int index)
      +
    + + + +
      +
    • +

      optBooleanObject

      +
      public Boolean optBooleanObject(int index)
      Get the optional Boolean object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The truth.
      -
    • -
    • -
      -

      optBooleanObject

      -
      public Boolean optBooleanObject(int index, - Boolean defaultValue)
      +
    + + + +
      +
    • +

      optBooleanObject

      +
      public Boolean optBooleanObject(int index,
      +                                Boolean defaultValue)
      Get the optional Boolean object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - A boolean default.
      -
      Returns:
      +
      Returns:
      The truth.
      -
    • -
    • -
      -

      optDouble

      -
      public double optDouble(int index)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optDouble

      -
      public double optDouble(int index, - double defaultValue)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - subscript
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optDoubleObject

      -
      public Double optDoubleObject(int index)
      +
    + + + +
      +
    • +

      optDoubleObject

      +
      public Double optDoubleObject(int index)
      Get the optional Double object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optDoubleObject

      -
      public Double optDoubleObject(int index, - Double defaultValue)
      +
    + + + +
      +
    • +

      optDoubleObject

      +
      public Double optDoubleObject(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:
      +
      +
      Parameters:
      index - subscript
      defaultValue - The default object.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optFloat

      -
      public float optFloat(int index)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optFloat

      -
      public float optFloat(int index, - float defaultValue)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - subscript
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optFloatObject

      -
      public Float optFloatObject(int index)
      +
    + + + +
      +
    • +

      optFloatObject

      +
      public Float optFloatObject(int index)
      Get the optional Float object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optFloatObject

      -
      public Float optFloatObject(int index, - Float defaultValue)
      +
    + + + +
      +
    • +

      optFloatObject

      +
      public Float optFloatObject(int index,
      +                            Float defaultValue)
      Get the optional Float object 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:
      +
      +
      Parameters:
      index - subscript
      defaultValue - The default object.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optInt

      -
      public int optInt(int index)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optInt

      -
      public int optInt(int index, - int defaultValue)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optIntegerObject

      -
      public Integer optIntegerObject(int index)
      +
    + + + +
      +
    • +

      optIntegerObject

      +
      public Integer optIntegerObject(int index)
      Get the optional Integer object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optIntegerObject

      -
      public Integer optIntegerObject(int index, - Integer defaultValue)
      +
    + + + +
      +
    • +

      optIntegerObject

      +
      public Integer optIntegerObject(int index,
      +                                Integer defaultValue)
      Get the optional Integer object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default object.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optEnum

      -
      public <E extends Enum<E>> E optEnum(Class<E> clazz, - int index)
      +
    + + + +
      +
    • +

      optEnum

      +
      public <E extends Enum<E>> E optEnum(Class<E> clazz,
      +                                     int index)
      Get the enum value associated with a key.
      -
      -
      Type Parameters:
      +
      +
      Type Parameters:
      E - Enum Type
      -
      Parameters:
      +
      Parameters:
      clazz - The type of enum to retrieve.
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      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)
      +
    + + + + + +
      +
    • +

      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:
      +
      +
      Type Parameters:
      E - Enum Type
      -
      Parameters:
      +
      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:
      +
      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)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optBigDecimal

      -
      public BigDecimal optBigDecimal(int index, - BigDecimal defaultValue)
      +
    + + + +
      +
    • +

      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 BigDecimal(double) + is float or double, the BigDecimal(double) constructor will be used. See notes on the constructor for conversion issues that may arise.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optJSONArray

      -
      public JSONArray optJSONArray(int index)
      +
    + + + +
      +
    • +

      optJSONArray

      +
      public JSONArray optJSONArray(int index)
      Get the optional JSONArray associated with an index. Null is returned if there is no value at that index or if the value is not a JSONArray.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      A JSONArray value.
      -
    • -
    • -
      -

      optJSONArray

      -
      public JSONArray optJSONArray(int index, - JSONArray defaultValue)
      +
    + + + +
      +
    • +

      optJSONArray

      +
      public JSONArray optJSONArray(int index,
      +                              JSONArray defaultValue)
      Get the optional JSONArray associated with an index. The defaultValue is returned if there is no value at that index or if the value is not a JSONArray.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      A JSONArray value.
      -
    • -
    • -
      -

      optJSONObject

      -
      public JSONObject optJSONObject(int index)
      +
    + + + +
      +
    • +

      optJSONObject

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

      optJSONObject

      -
      public JSONObject optJSONObject(int index, - JSONObject defaultValue)
      +
    + + + +
      +
    • +

      optJSONObject

      +
      public JSONObject optJSONObject(int index,
      +                                JSONObject defaultValue)
      Get the optional JSONObject associated with an index. The defaultValue is returned if there is no value at that index or if the value is not a JSONObject.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      A JSONObject value.
      -
    • -
    • -
      -

      optLong

      -
      public long optLong(int index)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optLong

      -
      public long optLong(int index, - long defaultValue)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
    • -
    • -
      -

      optLongObject

      -
      public Long optLongObject(int index)
      +
    + + + +
      +
    • +

      optLongObject

      +
      public Long optLongObject(int index)
      Get the optional Long object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optLongObject

      -
      public Long optLongObject(int index, - Long defaultValue)
      +
    + + + +
      +
    • +

      optLongObject

      +
      public Long optLongObject(int index,
      +                          Long defaultValue)
      Get the optional Long object 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default object.
      -
      Returns:
      +
      Returns:
      The object.
      -
    • -
    • -
      -

      optNumber

      -
      public Number optNumber(int index)
      -
      Get an optional Number value associated with a key, or null +
    + + + +
      +
    • +

      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 + 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      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 +
    + + + +
      +
    • +

      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 + 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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
    • -
    • -
      -

      optString

      -
      public String optString(int index)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      -
      Returns:
      +
      Returns:
      A String value.
      -
    • -
    • -
      -

      optString

      -
      public String optString(int index, - String defaultValue)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The index must be between 0 and length() - 1.
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      A String value.
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(boolean value)
      +
    + + + +
      +
    • +

      put

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

      put

      -
      public JSONArray put(Collection<?> value)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      value - A Collection value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the value is non-finite number.
      +
      Throws:
      +
      JSONException - If the value is non-finite number.
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(double value) - throws JSONException
      +
    + + + +
      +
    • +

      put

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

      put

      -
      public JSONArray put(float value) - throws JSONException
      +
    + + + +
      +
    • +

      put

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

      put

      -
      public JSONArray put(int value)
      +
    + + + +
      +
    • +

      put

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

      put

      -
      public JSONArray put(long value)
      +
    + + + +
      +
    • +

      put

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

      put

      -
      public JSONArray put(Map<?,?> value)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      value - A Map value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If a value in the map is non-finite number.
      -
      NullPointerException - If a key in the map is null
      +
      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)
      +
    + + + +
      +
    • +

      put

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

      put

      -
      public JSONArray put(int index, - boolean value) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The subscript.
      value - A boolean value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative.
      +
      Throws:
      +
      JSONException - If the index is negative.
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(int index, - Collection<?> value) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The subscript.
      value - A Collection value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative or if the value is non-finite.
      +
      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

      +
      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:
      +
      +
      Parameters:
      index - The subscript.
      value - A double value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative or if the value is non-finite.
      +
      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

      +
      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:
      +
      +
      Parameters:
      index - The subscript.
      value - A float value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative or if the value is non-finite.
      +
      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

      +
      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:
      +
      +
      Parameters:
      index - The subscript.
      value - An int value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative.
      +
      Throws:
      +
      JSONException - If the index is negative.
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(int index, - long value) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The subscript.
      value - A long value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative.
      +
      Throws:
      +
      JSONException - If the index is negative.
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(int index, - Map<?,?> value) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      index - The subscript.
      value - The Map value.
      -
      Returns:
      +
      Returns:
      reference to self
      -
      Throws:
      -
      JSONException - If the index is negative or if the value is an invalid +
      Throws:
      +
      JSONException - If the index is negative or if the value is an invalid number.
      -
      NullPointerException - If a key in the map is null
      +
      NullPointerException - If a key in the map is null
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(int index, - Map<?,?> value, - JSONParserConfiguration jsonParserConfiguration) - throws JSONException
      +
    + + + +
      +
    • +

      put

      +
      public JSONArray put(int index,
      +                     Map<?,?> value,
      +                     JSONParserConfiguration jsonParserConfiguration)
      +              throws JSONException
      Put a value in the JSONArray, where the value will be a JSONObject that is produced from a Map.
      -
      -
      Parameters:
      +
      +
      Parameters:
      index - The subscript
      value - The Map value.
      jsonParserConfiguration - Configuration object for the JSON parser
      -
      Returns:
      +
      Returns:
      reference to self
      -
      Throws:
      -
      JSONException - If the index is negative or if the value is an invalid +
      Throws:
      +
      JSONException - If the index is negative or if the value is an invalid number.
      -
    • -
    • -
      -

      put

      -
      public JSONArray put(int index, - Object value) - throws JSONException
      +
    + + + +
      +
    • +

      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:
      +
      +
      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:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the index is negative or if the value is an invalid +
      Throws:
      +
      JSONException - If the index is negative or if the value is an invalid number.
      -
    • -
    • -
      -

      putAll

      -
      public JSONArray putAll(Collection<?> collection)
      +
    + + + +
      +
    • +

      putAll

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

      putAll

      -
      public JSONArray putAll(Iterable<?> iter)
      +
    + + + +
      +
    • +

      putAll

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

      putAll

      -
      public JSONArray putAll(JSONArray array)
      +
    + + + +
      +
    • +

      putAll

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

      putAll

      -
      public JSONArray putAll(Object array) - throws JSONException
      +
    + + + +
      +
    • +

      putAll

      +
      public JSONArray putAll(Object array)
      +                 throws JSONException
      Put an array's elements in to the JSONArray.
      -
      -
      Parameters:
      +
      +
      Parameters:
      array - Array. If the parameter passed is null, or not an array or Iterable, an exception will be thrown.
      -
      Returns:
      +
      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.
      +
      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)
      +
    + + + + + + + + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      jsonPointer - the string representation of the JSON pointer
      -
      Returns:
      +
      Returns:
      the queried value or null
      -
      Throws:
      -
      IllegalArgumentException - if jsonPointer has invalid syntax
      +
      Throws:
      +
      IllegalArgumentException - if jsonPointer has invalid syntax
      -
    • -
    • -
      -

      optQuery

      -
      public Object optQuery(JSONPointer jsonPointer)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      jsonPointer - The JSON pointer
      -
      Returns:
      +
      Returns:
      the queried value or null
      -
      Throws:
      -
      IllegalArgumentException - if jsonPointer has invalid syntax
      +
      Throws:
      +
      IllegalArgumentException - if jsonPointer has invalid syntax
      -
    • -
    • -
      -

      remove

      -
      public Object remove(int index)
      +
    + + + +
      +
    • +

      remove

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

      similar

      -
      public boolean similar(Object other)
      +
    + + + +
      +
    • +

      similar

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

      toJSONObject

      -
      public JSONObject toJSONObject(JSONArray names) - throws JSONException
      +
    + + + +
      +
    • +

      toJSONObject

      +
      public JSONObject toJSONObject(JSONArray names)
      +                        throws JSONException
      Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.
      -
      -
      Parameters:
      +
      +
      Parameters:
      names - A JSONArray containing a list of key strings. These will be paired with the values.
      -
      Returns:
      +
      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.
      +
      Throws:
      +
      JSONException - If any of the names are null.
      -
    • -
    • -
      -

      toString

      -
      public String toString()
      +
    + + + +
      +
    • +

      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 @@ -2115,25 +2577,28 @@ implements -
      Overrides:
      -
      toString in class Object
      -
      Returns:
      +
      +
      Overrides:
      +
      toString in class Object
      +
      Returns:
      a printable, displayable, transmittable representation of the array.
      -
    • -
    • -
      -

      toString

      -
      public String toString(int indentFactor) - throws JSONException
      +
    + + + + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      writer - the writer object
      -
      Returns:
      +
      Returns:
      The writer.
      -
      Throws:
      -
      JSONException - if a called function fails
      +
      Throws:
      +
      JSONException - if a called function fails
      -
    • -
    • -
      -

      write

      -
      public Writer write(Writer writer, - int indentFactor, - int indent) - throws JSONException
      +
    + + + + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      a java.util.List containing the elements of this array
      -
    • -
    • -
      -

      isEmpty

      -
      public boolean isEmpty()
      +
    + + + +
      +
    • +

      isEmpty

      +
      public boolean isEmpty()
      Check if JSONArray is empty.
      -
      -
      Returns:
      +
      +
      Returns:
      true if JSONArray is empty, otherwise false.
      -
    - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONException.html b/src/main/java/JSON-Java/org/json/JSONException.html index d4b0c64..13256d4 100644 --- a/src/main/java/JSON-Java/org/json/JSONException.html +++ b/src/main/java/JSON-Java/org/json/JSONException.html @@ -1,193 +1,316 @@ - + + - + JSONException - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONException

    +
    org.json
    +

    Class JSONException

    - -
    -
    +
    + +
    +
    -
    -
      + +
    +
    +
    +
    +
    +
      +
    • -
    • -
      -

      Constructor Details

      -
        -
      • -
        -

        JSONException

        -
        public JSONException(String message)
        +
          +
        • + + +

          Constructor Detail

          + + + +
            +
          • +

            JSONException

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

        JSONException

        -
        public JSONException(String message, - Throwable cause)
        +
      + + + +
        +
      • +

        JSONException

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

      JSONException

      -
      public JSONException(Throwable cause)
      +
    + + + +
      +
    • +

      JSONException

      +
      public JSONException(Throwable cause)
      Constructs a new JSONException with the specified cause.
      -
      -
      Parameters:
      +
      +
      Parameters:
      cause - The cause.
      -
    - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONML.html b/src/main/java/JSON-Java/org/json/JSONML.html index 1672ca2..20b618e 100644 --- a/src/main/java/JSON-Java/org/json/JSONML.html +++ b/src/main/java/JSON-Java/org/json/JSONML.html @@ -1,265 +1,332 @@ - + + - + JSONML - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONML

    +
    org.json
    +

    Class JSONML

    -
    java.lang.Object -
    org.json.JSONML
    -
    -
    +
    + +
    +
      +

    • -
      public class JSONML -extends Object
      +
      +
      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.
      -
    -
    -
      + +
    +
    +
    + + + + +
      +
    • +

      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 @@ -269,25 +336,28 @@ loadScripts(document, 'script'); 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:
      + 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:
    +
    Returns:
    A JSONArray containing the structured data from the XML string.
    -
    Throws:
    -
    JSONException - Thrown on error converting to a JSONArray
    +
    Throws:
    +
    JSONException - Thrown on error converting to a JSONArray
    - -
  • -
    -

    toJSONArray

    -
    public static JSONArray toJSONArray(String string, - JSONMLParserConfiguration config) - throws JSONException
    + + + + +
      +
    • +

      toJSONArray

      +
      public static JSONArray toJSONArray(String string,
      +                                    JSONMLParserConfiguration config)
      +                             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 @@ -297,27 +367,30 @@ loadScripts(document, 'script'); 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:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored.
  • +
    +
    Parameters:
    string - The source string.
    config - The parser configuration: JSONMLParserConfiguration.ORIGINAL is the default behaviour; JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean or numeric values and will instead be left as strings
    -
    Returns:
    +
    Returns:
    A JSONArray containing the structured data from the XML string.
    -
    Throws:
    -
    JSONException - Thrown on error converting to a JSONArray
    +
    Throws:
    +
    JSONException - Thrown on error converting to a JSONArray
    - -
  • -
    -

    toJSONArray

    -
    public static JSONArray toJSONArray(XMLTokener x, - JSONMLParserConfiguration config) - throws JSONException
    + + + + +
      +
    • +

      toJSONArray

      +
      public static JSONArray toJSONArray(XMLTokener x,
      +                                    JSONMLParserConfiguration config)
      +                             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 @@ -327,27 +400,30 @@ loadScripts(document, 'script'); 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:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored. +
      +
      Parameters:
      x - An XMLTokener.
      config - The parser configuration: JSONMLParserConfiguration.ORIGINAL is the default behaviour; JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean or numeric values and will instead be left as strings
      -
      Returns:
      +
      Returns:
      A JSONArray containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONArray
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONArray
      -
  • -
  • -
    -

    toJSONArray

    -
    public static JSONArray toJSONArray(XMLTokener x, - boolean keepStrings) - throws JSONException
    + + + + +
      +
    • +

      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 @@ -357,46 +433,52 @@ loadScripts(document, 'script'); 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:
      + 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:
      +
      Returns:
      A JSONArray containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONArray
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONArray
      -
  • -
  • -
    -

    toJSONArray

    -
    public static JSONArray toJSONArray(XMLTokener x) - 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
      &lt;[ [ ]]>
      are ignored.
      -
      -
      Parameters:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored. +
      +
      Parameters:
      x - An XMLTokener.
      -
      Returns:
      +
      Returns:
      A JSONArray containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONArray
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONArray
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(String string) - throws JSONException
    + + + + +
      +
    • +

      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 @@ -404,23 +486,26 @@ loadScripts(document, 'script'); 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:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored. +
      +
      Parameters:
      string - The XML source text.
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONObject
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONObject
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(String string, - boolean keepStrings) - throws JSONException
    + + + + +
      +
    • +

      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 @@ -428,25 +513,28 @@ loadScripts(document, 'script'); 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:
      + 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:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONObject
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONObject
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(String string, - JSONMLParserConfiguration config) - throws JSONException
    + + + + +
      +
    • +

      toJSONObject

      +
      public static JSONObject toJSONObject(String string,
      +                                      JSONMLParserConfiguration config)
      +                               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 @@ -454,26 +542,29 @@ loadScripts(document, 'script'); 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:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored. +
      +
      Parameters:
      string - The XML source text.
      config - The parser configuration: JSONMLParserConfiguration.ORIGINAL is the default behaviour; JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean or numeric values and will instead be left as strings
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONObject
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONObject
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(XMLTokener x) - 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 @@ -481,23 +572,26 @@ loadScripts(document, 'script'); 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:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored. +
      +
      Parameters:
      x - An XMLTokener of the XML source text.
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONObject
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONObject
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(XMLTokener x, - boolean keepStrings) - throws JSONException
    + + + + +
      +
    • +

      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 @@ -505,25 +599,28 @@ loadScripts(document, 'script'); 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:
      + 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:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONObject
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONObject
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(XMLTokener x, - JSONMLParserConfiguration config) - throws JSONException
    + + + + +
      +
    • +

      toJSONObject

      +
      public static JSONObject toJSONObject(XMLTokener x,
      +                                      JSONMLParserConfiguration config)
      +                               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 @@ -531,64 +628,128 @@ loadScripts(document, 'script'); 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:
      + Comments, prologs, DTDs, and
       &lt;[ [ ]]>
      are ignored. +
      +
      Parameters:
      x - An XMLTokener of the XML source text.
      config - The parser configuration: JSONMLParserConfiguration.ORIGINAL is the default behaviour; JSONMLParserConfiguration.KEEP_STRINGS means values will not be coerced into boolean or numeric values and will instead be left as strings
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a JSONObject
      +
      Throws:
      +
      JSONException - Thrown on error converting to a JSONObject
      -
  • -
  • -
    -

    toString

    -
    public static String toString(JSONArray ja) - throws JSONException
    + + + + +
      +
    • +

      toString

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

    toString

    -
    public static String toString(JSONObject jo) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      jo - A JSONObject.
      -
      Returns:
      +
      Returns:
      An XML string.
      -
      Throws:
      -
      JSONException - Thrown on error converting to a string
      +
      Throws:
      +
      JSONException - Thrown on error converting to a string
      -
  • - - + + + + - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONMLParserConfiguration.html b/src/main/java/JSON-Java/org/json/JSONMLParserConfiguration.html index 824d888..63714ee 100644 --- a/src/main/java/JSON-Java/org/json/JSONMLParserConfiguration.html +++ b/src/main/java/JSON-Java/org/json/JSONMLParserConfiguration.html @@ -1,312 +1,456 @@ - + + - + JSONMLParserConfiguration - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONMLParserConfiguration

    +
    org.json
    +

    Class JSONMLParserConfiguration

    -
    java.lang.Object -
    org.json.ParserConfiguration -
    org.json.JSONMLParserConfiguration
    -
    -
    -
    +
    + +
    +
      +

    • -
      public class JSONMLParserConfiguration -extends ParserConfiguration
      +
      +
      public class JSONMLParserConfiguration
      +extends ParserConfiguration
      Configuration object for the XML to JSONML parser. The configuration is immutable.
      -
    -
    -
      + +
    +
    +
    + - + -
  • -
    -

    Method Details

    - + + + +
      +
    • +

      withKeepStrings

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

    withMaxNestingDepth

    -
    public JSONMLParserConfiguration withMaxNestingDepth(int maxNestingDepth)
    -
    Description copied from class: ParserConfiguration
    + + + + +
      +
    • +

      withMaxNestingDepth

      +
      public JSONMLParserConfiguration withMaxNestingDepth(int maxNestingDepth)
      +
      Description copied from class: ParserConfiguration
      Defines the maximum nesting depth that the parser will descend before throwing an exception - when parsing the XML into JSONML. The default max nesting depth is 512, which means the parser - will throw a JsonException if the maximum depth is reached. + when parsing an object (e.g. Map, Collection) into JSON-related objects. + The default max nesting depth is 512, which means the parser will throw a JsonException if + the maximum depth is reached. Using any negative value as a parameter is equivalent to setting no limit to the nesting depth, which means the parses will go as deep as the maximum call stack size allows.
      -
      -
      Overrides:
      -
      withMaxNestingDepth in class ParserConfiguration
      -
      Parameters:
      +
      +
      Overrides:
      +
      withMaxNestingDepth in class ParserConfiguration
      +
      Parameters:
      maxNestingDepth - the maximum nesting depth allowed to the XML parser
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONObject.html b/src/main/java/JSON-Java/org/json/JSONObject.html index 2140246..f2fb1b2 100644 --- a/src/main/java/JSON-Java/org/json/JSONObject.html +++ b/src/main/java/JSON-Java/org/json/JSONObject.html @@ -1,83 +1,114 @@ - + + - + JSONObject - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONObject

    +
    org.json
    +

    Class JSONObject

    -
    java.lang.Object -
    org.json.JSONObject
    -
    -
    +
    + +
    +
      +

    • -
      public class JSONObject -extends Object
      +
      +
      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 @@ -126,741 +157,915 @@ loadScripts(document, 'script'); if they are not the reserved words true, false, or null.
    -
    -
    -
      + +
    +
    +
    + + + + +
      +
    • +

      JSONObject

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

      JSONObject

      -
      public JSONObject(Map<?,?> m)
      +
    + + + +
      +
    • +

      JSONObject

      +
      public JSONObject(JSONTokener x,
      +                  JSONParserConfiguration jsonParserConfiguration)
      +           throws JSONException
      +
      Construct a JSONObject from a JSONTokener with custom json parse configurations.
      +
      +
      Parameters:
      +
      x - A JSONTokener object containing the source string.
      +
      jsonParserConfiguration - Variable to pass parser custom configuration for json parsing.
      +
      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:
      +
      +
      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
      +
      Throws:
      +
      JSONException - If a value in the map is non-finite number.
      +
      NullPointerException - If a key in the map is null
      -
    • -
    • -
      -

      JSONObject

      -
      public JSONObject(Map<?,?> m, - JSONParserConfiguration jsonParserConfiguration)
      +
    + + + +
      +
    • +

      JSONObject

      +
      public JSONObject(Map<?,?> m,
      +                  JSONParserConfiguration jsonParserConfiguration)
      Construct a JSONObject from a Map with custom json parse configurations.
      -
      -
      Parameters:
      +
      +
      Parameters:
      m - A map object that can be used to initialize the contents of the JSONObject.
      jsonParserConfiguration - Variable to pass parser custom configuration for json parsing.
      -
    • -
    • -
      -

      JSONObject

      -
      public JSONObject(Object bean)
      +
    + + + +
      +
    • +

      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 @@ -880,7 +1085,7 @@ loadScripts(document, 'script'); "Larry Fine", then the JSONObject will contain "name": "Larry Fine".

      - The JSONPropertyName annotation can be used on a bean getter to + 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:

      @@ -889,7 +1094,7 @@ loadScripts(document, 'script');
        
      The resulting JSON object would contain "FullName": "Larry Fine"

      - Similarly, the JSONPropertyName annotation can be used on non- + 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: @@ -899,11 +1104,11 @@ loadScripts(document, 'script'); 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 + 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 + 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: @@ -912,106 +1117,147 @@ loadScripts(document, 'script'); @JSONPropertyIgnore public String getName() { return this.name; }

      -
      -
      Parameters:
      +
      +
      Parameters:
      bean - An object that has getter methods that should be used to make a JSONObject.
      -
      Throws:
      -
      JSONException - If a getter returned a non-finite number.
      +
      Throws:
      +
      JSONException - If a getter returned a non-finite number.
      -
    • -
    • -
      -

      JSONObject

      -
      public JSONObject(Object object, - String... names)
      +
    + + + +
      +
    • +

      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:
      +
      +
      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
      +
    + + + +
      +
    • +

      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:
      +
      +
      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 +
      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
      +
    + + + +
      +
    • +

      JSONObject

      +
      public JSONObject(String source,
      +                  JSONParserConfiguration jsonParserConfiguration)
      +           throws JSONException
      +
      Construct a JSONObject from a source JSON text string with custom json parse configurations. + This is the most commonly used JSONObject constructor.
      +
      +
      Parameters:
      +
      source - A string beginning with { (left + brace) and ending with } +  (right brace).
      +
      jsonParserConfiguration - Variable to pass parser custom configuration for json parsing.
      +
      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:
      +
      +
      Parameters:
      baseName - The ResourceBundle base name.
      locale - The Locale to load the ResourceBundle for.
      -
      Throws:
      -
      JSONException - If any JSONExceptions are detected.
      +
      Throws:
      +
      JSONException - If any JSONExceptions are detected.
      -
    • -
    • -
      -

      JSONObject

      -
      protected JSONObject(int initialCapacity)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      initialCapacity - initial capacity of the internal map.
      -
    - + -
  • -
    -

    Method Details

    -
      -
    • -
      -

      getMapType

      -
      public Class<? extends Map> getMapType()
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          getMapType

          +
          public Class<? extends Map> getMapType()
          Retrieves the type of the underlying Map in this class.
          -
          -
          Returns:
          +
          +
          Returns:
          The class object representing the type of the underlying Map.
          -
    • -
    • -
      -

      accumulate

      -
      public JSONObject accumulate(String key, - Object value) - throws JSONException
      +
    + + + +
      +
    • +

      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 @@ -1021,1204 +1267,1410 @@ loadScripts(document, 'script'); 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:
      +
      +
      Parameters:
      key - A key string.
      value - An object to be accumulated under the key.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the value is non-finite number.
      -
      NullPointerException - If the key is null.
      +
      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

      +
      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:
      +
      +
      Parameters:
      key - A key string.
      value - An object to be accumulated under the key.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the value is non-finite number or if the current value associated with +
      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.
      +
      NullPointerException - If the key is null.
      -
  • -
  • -
    -

    doubleToString

    -
    public static String doubleToString(double d)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      d - A double.
      -
      Returns:
      +
      Returns:
      A String.
      -
  • -
  • -
    -

    get

    -
    public Object get(String key) - throws JSONException
    + + + + +
      +
    • +

      get

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

    getEnum

    -
    public <E extends Enum<E>> E getEnum(Class<E> clazz, - String key) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Type Parameters:
      E - Enum Type
      -
      Parameters:
      +
      Parameters:
      clazz - The type of enum to retrieve.
      key - A key string.
      -
      Returns:
      +
      Returns:
      The enum value associated with the key
      -
      Throws:
      -
      JSONException - if the key is not found or if the value cannot be converted +
      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
    + + + + +
      +
    • +

      getBoolean

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

    getBigInteger

    -
    public BigInteger getBigInteger(String key) - throws JSONException
    + + + + +
      +
    • +

      getBigInteger

      +
      public BigInteger getBigInteger(String key)
      +                         throws JSONException
      Get the BigInteger value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The numeric value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value cannot +
      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
    + + + + +
      +
    • +

      getBigDecimal

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

      getDouble

      +
      public double getDouble(String key)
      +                 throws JSONException
      Get the double value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The numeric value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value is not a Number +
      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
    + + + + +
      +
    • +

      getFloat

      +
      public float getFloat(String key)
      +               throws JSONException
      Get the float value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The numeric value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value is not a Number +
      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
    + + + + +
      +
    • +

      getNumber

      +
      public Number getNumber(String key)
      +                 throws JSONException
      Get the Number value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The numeric value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value is not a Number +
      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
    + + + + +
      +
    • +

      getInt

      +
      public int getInt(String key)
      +           throws JSONException
      Get the int value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The integer value.
      -
      Throws:
      -
      JSONException - if the key is not found or if the value cannot be converted +
      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
    + + + + +
      +
    • +

      getJSONArray

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

    getJSONObject

    -
    public JSONObject getJSONObject(String key) - throws JSONException
    + + + + +
      +
    • +

      getJSONObject

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

    getLong

    -
    public long getLong(String key) - throws JSONException
    + + + + +
      +
    • +

      getLong

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

      getNames

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

    getNames

    -
    public static String[] getNames(Object object)
    + + + + +
      +
    • +

      getNames

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

    getString

    -
    public String getString(String key) - throws JSONException
    + + + + +
      +
    • +

      getString

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

    has

    -
    public boolean has(String key)
    + + + + +
      +
    • +

      has

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

    increment

    -
    public JSONObject increment(String key) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If there is already a property with this name that is not an +
      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)
    + + + + +
      +
    • +

      isNull

      +
      public boolean isNull(String key)
      Determine if the value associated with the key is null or if there is no value.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      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()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      An iterator of the keys.
      -
      See Also:
      -
      - -
      +
      See Also:
      +
      Set.iterator()
      -
  • -
  • -
    -

    keySet

    -
    public Set<String> keySet()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      A keySet.
      -
      See Also:
      -
      - -
      +
      See Also:
      +
      Map.keySet()
      -
  • -
  • -
    -

    entrySet

    -
    protected Set<Map.Entry<String,Object>> entrySet()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      An Entry Set
      -
      See Also:
      -
      - -
      +
      See Also:
      +
      Map.entrySet()
      -
  • -
  • -
    -

    length

    -
    public int length()
    + + + + +
      +
    • +

      length

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

    clear

    -
    public void clear()
    + + + + +
      +
    • +

      clear

      +
      public void clear()
      Removes all of the elements from this JSONObject. The JSONObject will be empty after this call returns.
      -
  • -
  • -
    -

    isEmpty

    -
    public boolean isEmpty()
    + + + + +
      +
    • +

      isEmpty

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

    names

    -
    public JSONArray names()
    + + + + +
      +
    • +

      names

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

    numberToString

    -
    public static String numberToString(Number number) - throws JSONException
    + + + + +
      +
    • +

      numberToString

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

    opt

    -
    public Object opt(String key)
    + + + + +
      +
    • +

      opt

      +
      public Object opt(String key)
      Get an optional value associated with a key.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      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)
    + + + + +
      +
    • +

      optEnum

      +
      public <E extends Enum<E>> E optEnum(Class<E> clazz,
      +                                     String key)
      Get the enum value associated with a key.
      -
      -
      Type Parameters:
      +
      +
      Type Parameters:
      E - Enum Type
      -
      Parameters:
      +
      Parameters:
      clazz - The type of enum to retrieve.
      key - A key string.
      -
      Returns:
      +
      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)
    + + + + + + +
      +
    • +

      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:
      +
      +
      Type Parameters:
      E - Enum Type
      -
      Parameters:
      +
      Parameters:
      clazz - The type of enum to retrieve.
      key - A key string.
      defaultValue - The default in case the value is not found
      -
      Returns:
      +
      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)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The truth.
      -
  • -
  • -
    -

    optBoolean

    -
    public boolean optBoolean(String key, - boolean defaultValue)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      The truth.
      -
  • -
  • -
    -

    optBooleanObject

    -
    public Boolean optBooleanObject(String key)
    + + + + +
      +
    • +

      optBooleanObject

      +
      public Boolean optBooleanObject(String key)
      Get an optional boolean object 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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The truth.
      -
  • -
  • -
    -

    optBooleanObject

    -
    public Boolean optBooleanObject(String key, - Boolean defaultValue)
    + + + + +
      +
    • +

      optBooleanObject

      +
      public Boolean optBooleanObject(String key,
      +                                Boolean defaultValue)
      Get an optional boolean object 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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      The truth.
      -
  • -
  • -
    -

    optBigDecimal

    -
    public BigDecimal optBigDecimal(String key, - BigDecimal defaultValue)
    + + + + +
      +
    • +

      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(double) + is float or double, then the BigDecimal(double) constructor will be used. See notes on the constructor for conversion issues that may arise.
      -
      -
      Parameters:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optBigInteger

    -
    public BigInteger optBigInteger(String key, - BigInteger defaultValue)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optDouble

    -
    public double optDouble(String key)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A string which is the key.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optDouble

    -
    public double optDouble(String key, - double defaultValue)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optDoubleObject

    -
    public Double optDoubleObject(String key)
    + + + + +
      +
    • +

      optDoubleObject

      +
      public Double optDoubleObject(String key)
      Get an optional Double object 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:
      +
      +
      Parameters:
      key - A string which is the key.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optDoubleObject

    -
    public Double optDoubleObject(String key, - Double defaultValue)
    + + + + +
      +
    • +

      optDoubleObject

      +
      public Double optDoubleObject(String key,
      +                              Double defaultValue)
      Get an optional Double object 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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optFloat

    -
    public float optFloat(String key)
    + + + + +
      +
    • +

      optFloat

      +
      public float optFloat(String key)
      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The value.
      -
  • -
  • -
    -

    optFloat

    -
    public float optFloat(String key, - float defaultValue)
    + + + + +
      +
    • +

      optFloat

      +
      public float optFloat(String key,
      +                      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default value.
      -
      Returns:
      +
      Returns:
      The value.
      -
  • -
  • -
    -

    optFloatObject

    -
    public Float optFloatObject(String key)
    + + + + +
      +
    • +

      optFloatObject

      +
      public Float optFloatObject(String key)
      Get the optional Float object 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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      The object.
      -
  • -
  • -
    -

    optFloatObject

    -
    public Float optFloatObject(String key, - Float defaultValue)
    + + + + +
      +
    • +

      optFloatObject

      +
      public Float optFloatObject(String key,
      +                            Float defaultValue)
      Get the optional Float object 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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default object.
      -
      Returns:
      +
      Returns:
      The object.
      -
  • -
  • -
    -

    optInt

    -
    public int optInt(String key)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optInt

    -
    public int optInt(String key, - int defaultValue)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optIntegerObject

    -
    public Integer optIntegerObject(String key)
    + + + + +
      +
    • +

      optIntegerObject

      +
      public Integer optIntegerObject(String key)
      Get an optional Integer object 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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optIntegerObject

    -
    public Integer optIntegerObject(String key, - Integer defaultValue)
    + + + + +
      +
    • +

      optIntegerObject

      +
      public Integer optIntegerObject(String key,
      +                                Integer defaultValue)
      Get an optional Integer object 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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optJSONArray

    -
    public JSONArray optJSONArray(String key)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      A JSONArray which is the value.
      -
  • -
  • -
    -

    optJSONArray

    -
    public JSONArray optJSONArray(String key, - JSONArray defaultValue)
    + + + + +
      +
    • +

      optJSONArray

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

    optJSONObject

    -
    public JSONObject optJSONObject(String key)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      A JSONObject which is the value.
      -
  • -
  • -
    -

    optJSONObject

    -
    public JSONObject optJSONObject(String key, - JSONObject defaultValue)
    + + + + +
      +
    • +

      optJSONObject

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

    optLong

    -
    public long optLong(String key)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optLong

    -
    public long optLong(String key, - long defaultValue)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optLongObject

    -
    public Long optLongObject(String key)
    + + + + +
      +
    • +

      optLongObject

      +
      public Long optLongObject(String key)
      Get an optional Long object 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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optLongObject

    -
    public Long optLongObject(String key, - Long defaultValue)
    + + + + +
      +
    • +

      optLongObject

      +
      public Long optLongObject(String key,
      +                          Long defaultValue)
      Get an optional Long object 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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optNumber

    -
    public Number optNumber(String key)
    -
    Get an optional Number value associated with a key, or null + + + + +
      +
    • +

      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 + 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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      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 + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      An object which is the value.
      -
  • -
  • -
    -

    optString

    -
    public String optString(String key)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      -
      Returns:
      +
      Returns:
      A string which is the value.
      -
  • -
  • -
    -

    optString

    -
    public String optString(String key, - String defaultValue)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      defaultValue - The default.
      -
      Returns:
      +
      Returns:
      A string which is the value.
      -
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - boolean value) - throws JSONException
    + + + + +
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - Collection<?> value) - throws JSONException
    + + + + +
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - double value) - throws JSONException
    + + + + +
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - float value) - throws JSONException
    + + + + +
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - int value) - throws JSONException
    + + + + +
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - long value) - throws JSONException
    + + + + +
  • -
  • -
    -

    put

    -
    public JSONObject put(String key, - Map<?,?> value) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - A key string.
      value - A Map value.
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the value is non-finite number.
      -
      NullPointerException - If the key is null.
      +
      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

      +
      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:
      +
      +
      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:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the value is non-finite number.
      -
      NullPointerException - If the key is null.
      +
      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
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      key - key to insert into
      value - value to insert
      -
      Returns:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - if the key is a duplicate
      +
      Throws:
      +
      JSONException - if the key is a duplicate
      -
  • -
  • -
    -

    putOpt

    -
    public JSONObject putOpt(String key, - Object value) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      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:
      +
      Returns:
      this.
      -
      Throws:
      -
      JSONException - If the value is a non-finite number.
      +
      Throws:
      +
      JSONException - If the value is a non-finite number.
      -
  • -
  • -
    -

    query

    -
    public Object query(String jsonPointer)
    + + + + +
      +
    • +

      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: @@ -2233,18 +2685,21 @@ loadScripts(document, 'script'); Then this method will return the String "c". A JSONPointerException may be thrown from code called by this method.
      -
      -
      Parameters:
      +
      +
      Parameters:
      jsonPointer - string that can be used to create a JSONPointer
      -
      Returns:
      +
      Returns:
      the item matched by the JSONPointer, otherwise null
      -
  • -
  • -
    -

    query

    -
    public Object query(JSONPointer jsonPointer)
    + + + + +
      +
    • +

      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: @@ -2259,224 +2714,263 @@ loadScripts(document, 'script'); Then this method will return the String "c". A JSONPointerException may be thrown from code called by this method.
      -
      -
      Parameters:
      +
      +
      Parameters:
      jsonPointer - string that can be used to create a JSONPointer
      -
      Returns:
      +
      Returns:
      the item matched by the JSONPointer, otherwise null
      -
  • -
  • -
    -

    optQuery

    -
    public Object optQuery(String jsonPointer)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      jsonPointer - the string representation of the JSON pointer
      -
      Returns:
      +
      Returns:
      the queried value or null
      -
      Throws:
      -
      IllegalArgumentException - if jsonPointer has invalid syntax
      +
      Throws:
      +
      IllegalArgumentException - if jsonPointer has invalid syntax
      -
  • -
  • -
    -

    optQuery

    -
    public Object optQuery(JSONPointer jsonPointer)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      jsonPointer - The JSON pointer
      -
      Returns:
      +
      Returns:
      the queried value or null
      -
      Throws:
      -
      IllegalArgumentException - if jsonPointer has invalid syntax
      +
      Throws:
      +
      IllegalArgumentException - if jsonPointer has invalid syntax
      -
  • -
  • -
    -

    quote

    -
    public static String quote(String string)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      string - A String
      -
      Returns:
      +
      Returns:
      A String correctly formatted for insertion in a JSON text.
      -
  • -
  • -
    -

    quote

    -
    public static Writer quote(String string, - Writer w) - throws IOException
    + + + + +
      +
    • +

      quote

      +
      public static Writer quote(String string,
      +                           Writer w)
      +                    throws IOException
      Quotes a string and appends the result to a given Writer.
      -
      -
      Parameters:
      +
      +
      Parameters:
      string - The input string to be quoted.
      w - The Writer to which the quoted string will be appended.
      -
      Returns:
      +
      Returns:
      The same Writer instance after appending the quoted string.
      -
      Throws:
      -
      IOException - If an I/O error occurs while writing to the Writer.
      +
      Throws:
      +
      IOException - If an I/O error occurs while writing to the Writer.
      -
  • -
  • -
    -

    remove

    -
    public Object remove(String key)
    + + + + +
      +
    • +

      remove

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

    similar

    -
    public boolean similar(Object other)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      other - The other JSONObject
      -
      Returns:
      +
      Returns:
      true if they are equal
      -
  • -
  • -
    -

    isDecimalNotation

    -
    protected static boolean isDecimalNotation(String val)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      val - value to test
      -
      Returns:
      +
      Returns:
      true if the string is "-0" or if it contains '.', 'e', or 'E', false otherwise.
      -
  • -
  • -
    -

    stringToValue

    -
    public static Object stringToValue(String string)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      string - A String. can not be null.
      -
      Returns:
      +
      Returns:
      A simple JSON value.
      -
      Throws:
      -
      NullPointerException - Thrown if the string is null.
      +
      Throws:
      +
      NullPointerException - Thrown if the string is null.
      -
  • -
  • -
    -

    stringToNumber

    -
    protected static Number stringToNumber(String val) - throws NumberFormatException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      val - value to convert
      -
      Returns:
      +
      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.
      +
      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.
      -
  • -
  • -
    -

    testValidity

    -
    public static void testValidity(Object o) - throws JSONException
    + + + + +
      +
    • +

      testValidity

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

    toJSONArray

    -
    public JSONArray toJSONArray(JSONArray names) - throws JSONException
    + + + + +
      +
    • +

      toJSONArray

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

    toString

    -
    public String toString()
    + + + + +
      +
    • +

      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:
      +
      +
      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
    + + + + +
      +
    • +

      toString

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

      If

      indentFactor > 0
      and the JSONObject +

      If

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

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

      {
      + multiple lines: 
       {
         "key1": 1,
         "key2": "value 2",
         "key3": 3
      @@ -2484,24 +2978,27 @@ loadScripts(document, 'script');
        

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

      -
      -
      Parameters:
      +
      +
      Parameters:
      indentFactor - The number of spaces to add to each level of indentation.
      -
      Returns:
      +
      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.
      +
      Throws:
      +
      JSONException - If the object contains an invalid number.
      -
  • -
  • -
    -

    valueToString

    -
    public static String valueToString(Object value) - throws JSONException
    + + + + +
      +
    • +

      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. @@ -2515,72 +3012,81 @@ loadScripts(document, 'script');

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

      -
      -
      Parameters:
      +
      +
      Parameters:
      value - The value to be serialized.
      -
      Returns:
      +
      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.
      +
      Throws:
      +
      JSONException - If the value is or contains an invalid number.
      -
  • -
  • -
    -

    wrap

    -
    public static Object wrap(Object object)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      object - The object to wrap
      -
      Returns:
      +
      Returns:
      The wrapped value
      -
  • -
  • -
    -

    write

    -
    public Writer write(Writer writer) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      writer - the writer object
      -
      Returns:
      +
      Returns:
      The writer.
      -
      Throws:
      -
      JSONException - if a called function has an error
      +
      Throws:
      +
      JSONException - if a called function has an error
      -
  • -
  • -
    -

    write

    -
    public Writer write(Writer writer, - int indentFactor, - int indent) - throws JSONException
    + + + + +
      +
    • +

      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 +

      If

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

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

      {
      + multiple lines: 
       {
         "key1": 1,
         "key2": "value 2",
         "key3": 3
      @@ -2588,42 +3094,103 @@ loadScripts(document, 'script');
        

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

      -
      -
      Parameters:
      +
      +
      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:
      +
      Returns:
      The writer.
      -
      Throws:
      -
      JSONException - if a called function has an error or a write error +
      Throws:
      +
      JSONException - if a called function has an error or a write error occurs
      -
  • -
  • -
    -

    toMap

    -
    public Map<String,Object> toMap()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      a java.util.Map containing the entries of this object
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONParserConfiguration.html b/src/main/java/JSON-Java/org/json/JSONParserConfiguration.html index ee5e3de..7f37eaa 100644 --- a/src/main/java/JSON-Java/org/json/JSONParserConfiguration.html +++ b/src/main/java/JSON-Java/org/json/JSONParserConfiguration.html @@ -1,210 +1,448 @@ - + + - + JSONParserConfiguration - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONParserConfiguration

    +
    org.json
    +

    Class JSONParserConfiguration

    -
    java.lang.Object -
    org.json.ParserConfiguration -
    org.json.JSONParserConfiguration
    -
    -
    -
    +
    + +
    +
      +

    • -
      public class JSONParserConfiguration -extends ParserConfiguration
      +
      +
      public class JSONParserConfiguration
      +extends ParserConfiguration
      Configuration object for the JSON parser. The configuration is immutable.
      -
    -
    -
      + +
    +
    +
    + - + + + +
      +
    • +

      withOverwriteDuplicateKey

      +
      public JSONParserConfiguration withOverwriteDuplicateKey(boolean overwriteDuplicateKey)
      +
      Controls the parser's behavior when meeting duplicate keys. + If set to false, the parser will throw a JSONException when meeting a duplicate key. + Or the duplicate key's value will be overwritten.
      +
      +
      Parameters:
      +
      overwriteDuplicateKey - defines should the parser overwrite duplicate keys.
      +
      Returns:
      +
      The existing configuration will not be modified. A new configuration is returned.
      +
    - + + + +
      +
    • +

      withStrictMode

      +
      public JSONParserConfiguration withStrictMode()
      +
      Sets the strict mode configuration for the JSON parser with default true value +

      + When strict mode is enabled, the parser will throw a JSONException if it encounters an invalid character + immediately following the final ']' character in the input. This is useful for ensuring strict adherence to the + JSON syntax, as any characters after the final closing bracket of a JSON array are considered invalid.

      +
      +
      Returns:
      +
      a new JSONParserConfiguration instance with the updated strict mode setting
      +
      +
    • +
    + + + +
      +
    • +

      withStrictMode

      +
      public JSONParserConfiguration withStrictMode(boolean mode)
      +
      Sets the strict mode configuration for the JSON parser. +

      + When strict mode is enabled, the parser will throw a JSONException if it encounters an invalid character + immediately following the final ']' character in the input. This is useful for ensuring strict adherence to the + JSON syntax, as any characters after the final closing bracket of a JSON array are considered invalid.

      +
      +
      Parameters:
      +
      mode - a boolean value indicating whether strict mode should be enabled or not
      +
      Returns:
      +
      a new JSONParserConfiguration instance with the updated strict mode setting
      +
      +
    • +
    + + + +
      +
    • +

      isOverwriteDuplicateKey

      +
      public boolean isOverwriteDuplicateKey()
      +
      The parser's behavior when meeting duplicate keys, controls whether the parser should + overwrite duplicate keys or not.
      +
      +
      Returns:
      +
      The overwriteDuplicateKey configuration value.
      +
      +
    • +
    + + + +
      +
    • +

      isStrictMode

      +
      public boolean isStrictMode()
      +
      +
      Returns:
      +
      the current strict mode setting.
      +
      +
    • +
    + + + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONPointer.Builder.html b/src/main/java/JSON-Java/org/json/JSONPointer.Builder.html index 08cd321..3b1b454 100644 --- a/src/main/java/JSON-Java/org/json/JSONPointer.Builder.html +++ b/src/main/java/JSON-Java/org/json/JSONPointer.Builder.html @@ -1,220 +1,337 @@ - + + - + JSONPointer.Builder - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONPointer.Builder

    +
    org.json
    +

    Class JSONPointer.Builder

    -
    java.lang.Object -
    org.json.JSONPointer.Builder
    -
    -
    -
    +
    + +
    +
      +
    • +
      Enclosing class:
      -
      JSONPointer
      +
      JSONPointer

      -
      public static class JSONPointer.Builder -extends Object
      +
      +
      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.
      -
    -
    -
      + +
    +
    +
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      token - the new token to be appended to the list
      -
      Returns:
      +
      Returns:
      this
      -
      Throws:
      -
      NullPointerException - if token is null
      +
      Throws:
      +
      NullPointerException - if token is null
      -
    • -
    • -
      -

      append

      -
      public JSONPointer.Builder append(int arrayIndex)
      +
    + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      arrayIndex - the array index to be added to the token list
      -
      Returns:
      +
      Returns:
      this
      -
    - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONPointer.html b/src/main/java/JSON-Java/org/json/JSONPointer.html index 6f4eac0..3ceda17 100644 --- a/src/main/java/JSON-Java/org/json/JSONPointer.html +++ b/src/main/java/JSON-Java/org/json/JSONPointer.html @@ -1,83 +1,114 @@ - + + - + JSONPointer - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONPointer

    +
    org.json
    +

    Class JSONPointer

    -
    java.lang.Object -
    org.json.JSONPointer
    -
    -
    +
    + +
    +
      +

    • -
      public class JSONPointer -extends Object
      +
      +
      public class JSONPointer
      +extends Object
      A JSON Pointer is a simple query language defined for JSON documents by RFC 6901. @@ -91,136 +122,167 @@ loadScripts(document, 'script'); 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.
      -
    -
    -
      - -
    • -
      -

      Nested Class Summary

      -
      Nested Classes
      -
      -
      Modifier and Type
      -
      Class
      -
      Description
      -
      static class 
      - -
      -
      This class allows the user to build a JSONPointer in steps, using - exactly one segment in each step.
      -
      -
      -
      -
    • - -
    • -
      -

      Constructor Summary

      -
      Constructors
      -
      -
      Constructor
      -
      Description
      - -
      -
      Pre-parses and initializes a new JSONPointer instance.
      -
      -
      JSONPointer(List<String> refTokens)
      -
      -
      Constructs a new JSONPointer instance with the provided list of reference tokens.
      -
      -
      -
      -
    • - -
    • -
      -

      Method Summary

      -
      -
      -
      -
      -
      Modifier and Type
      -
      Method
      -
      Description
      - - -
      -
      Static factory method for JSONPointer.Builder.
      -
      - -
      queryFrom(Object document)
      -
      -
      Evaluates this JSON Pointer on the given document.
      -
      - - -
      -
      Returns a string representing the JSONPointer path value using string - representation
      -
      - - -
      -
      Returns a string representing the JSONPointer path value using URI - fragment identifier representation
      -
      -
      -
      -
      -
      -

      Methods inherited from class java.lang.Object

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

      Constructor Details

      -
        -
      • -
        -

        JSONPointer

        -
        public JSONPointer(String pointer)
        +
          +
        • + + +

          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:
            +
            +
            Parameters:
            pointer - the JSON String or URI Fragment representation of the JSON pointer.
            -
            Throws:
            -
            IllegalArgumentException - if pointer is not a valid JSON pointer
            +
            Throws:
            +
            IllegalArgumentException - if pointer is not a valid JSON pointer
            -
      • -
      • -
        -

        JSONPointer

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

        JSONPointer

        +
        public JSONPointer(List<String> refTokens)
        Constructs a new JSONPointer instance with the provided list of reference tokens.
        -
        -
        Parameters:
        +
        +
        Parameters:
        refTokens - A list of strings representing the reference tokens for the JSON Pointer. Each token identifies a step in the path to the targeted value.
        -
    - + -
  • -
    -

    Method Details

    - + + + +
      +
    • +

      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 + 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:
      +
      +
      Parameters:
      document - the JSON document which should be the subject of querying.
      -
      Returns:
      +
      Returns:
      the result of the evaluation
      -
      Throws:
      -
      JSONPointerException - if an error occurs during evaluation
      +
      Throws:
      +
      JSONPointerException - if an error occurs during evaluation
      -
  • -
  • -
    -

    toString

    -
    public String toString()
    + + + + +
      +
    • +

      toString

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

    toURIFragment

    -
    public String toURIFragment()
    + + + + +
      +
    • +

      toURIFragment

      +
      public String toURIFragment()
      Returns a string representing the JSONPointer path value using URI fragment identifier representation
      -
      -
      Returns:
      +
      +
      Returns:
      a uri fragment string
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONPointerException.html b/src/main/java/JSON-Java/org/json/JSONPointerException.html index 1fd9868..57c2559 100644 --- a/src/main/java/JSON-Java/org/json/JSONPointerException.html +++ b/src/main/java/JSON-Java/org/json/JSONPointerException.html @@ -1,177 +1,299 @@ - + + - + JSONPointerException - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONPointerException

    +
    org.json
    +

    Class JSONPointerException

    - -
    -
    +
    + +
    +
    -
    - -
    -
    -
      - -
    • -
      -

      Constructor Details

      -
        -
      • -
        -

        JSONPointerException

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

        Constructor Detail

        + + + +
          +
        • +

          JSONPointerException

          +
          public JSONPointerException(String message)
          +
          Constructs a new JSONPointerException with the specified error message.
          +
          +
          Parameters:
          message - The detail message describing the reason for the exception.
          -
        • -
        • -
          -

          JSONPointerException

          -
          public JSONPointerException(String message, - Throwable cause)
          +
        + + + +
          +
        • +

          JSONPointerException

          +
          public JSONPointerException(String message,
          +                            Throwable cause)
          Constructs a new JSONPointerException with the specified error message and cause.
          -
          -
          Parameters:
          +
          +
          Parameters:
          message - The detail message describing the reason for the exception.
          cause - The cause of the exception.
          -
        -
      - +
    • +
    +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONPropertyIgnore.html b/src/main/java/JSON-Java/org/json/JSONPropertyIgnore.html index 5a7fab5..bd17b6b 100644 --- a/src/main/java/JSON-Java/org/json/JSONPropertyIgnore.html +++ b/src/main/java/JSON-Java/org/json/JSONPropertyIgnore.html @@ -1,84 +1,166 @@ - + + - + JSONPropertyIgnore - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Annotation Interface JSONPropertyIgnore

    +
    org.json
    +

    Annotation Type JSONPropertyIgnore

    -
    +
    +
    +
    + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONPropertyName.html b/src/main/java/JSON-Java/org/json/JSONPropertyName.html index 8c135dd..232f5f4 100644 --- a/src/main/java/JSON-Java/org/json/JSONPropertyName.html +++ b/src/main/java/JSON-Java/org/json/JSONPropertyName.html @@ -1,127 +1,220 @@ - + + - + JSONPropertyName - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Annotation Interface JSONPropertyName

    +
    org.json
    +

    Annotation Type JSONPropertyName

    -
    +
    +
    +
    -
    -
      - -
    • -
      -

      Required Element Summary

      -
      Required Elements
      -
      -
      Modifier and Type
      -
      Required Element
      -
      Description
      - - -
      -
      The value of the JSON property.
      -
      -
      -
    -
    -
    -
      - -
    • -
      -

      Element Details

      -
    +
    +
      +
    • + +
        +
      • + + +

        Required Element Summary

        + + + + + + + + + + +
        Required Elements 
        Modifier and TypeRequired Element and Description
        Stringvalue
        The value of the JSON property.
        -
        -
        Returns:
        +
        +
      • +
      +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Element Detail

        + + + +
          +
        • +

          value

          +
          public abstract String value
          +
          The value of the JSON property.
          +
          +
          Returns:
          The name of the property as to be used in the JSON Object.
          -
        -
      - +
    • +
    +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONString.html b/src/main/java/JSON-Java/org/json/JSONString.html index f0841ad..af4f797 100644 --- a/src/main/java/JSON-Java/org/json/JSONString.html +++ b/src/main/java/JSON-Java/org/json/JSONString.html @@ -1,139 +1,232 @@ - + + - + JSONString - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Interface JSONString

    +
    org.json
    +

    Interface JSONString

    -
    +
    +
    +
      +

    • -
      public 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

      -
      -
      -
      -
      -
      Modifier and Type
      -
      Method
      -
      Description
      - - -
      -
      The toJSONString method allows a class to produce its own JSON - serialization.
      -
      -
      -
      -
      -
    -
    -
    -
      - -
    • -
      -

      Method Details

      -
        -
      • -
        -

        toJSONString

        -
        String toJSONString()
        +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        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/src/main/java/JSON-Java/org/json/JSONStringer.html b/src/main/java/JSON-Java/org/json/JSONStringer.html index cce5151..1d2b20e 100644 --- a/src/main/java/JSON-Java/org/json/JSONStringer.html +++ b/src/main/java/JSON-Java/org/json/JSONStringer.html @@ -1,85 +1,119 @@ - + + - + JSONStringer - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONStringer

    +
    org.json
    +

    Class JSONStringer

    -
    java.lang.Object -
    org.json.JSONWriter -
    org.json.JSONStringer
    -
    -
    -
    +
    + +
    +
      +

    • -
      public class JSONStringer -extends JSONWriter
      +
      +
      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 @@ -106,109 +140,197 @@ loadScripts(document, 'script'); 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.

      -
    -
    -
      + +
    +
    +
    + - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONTokener.html b/src/main/java/JSON-Java/org/json/JSONTokener.html index eb11a4d..e836680 100644 --- a/src/main/java/JSON-Java/org/json/JSONTokener.html +++ b/src/main/java/JSON-Java/org/json/JSONTokener.html @@ -1,561 +1,786 @@ - + + - + JSONTokener - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONTokener

    +
    org.json
    +

    Class JSONTokener

    -
    java.lang.Object -
    org.json.JSONTokener
    -
    -
    -
    +
    + +
    +
      +
    • +
      Direct Known Subclasses:
      -
      HTTPTokener, XMLTokener
      +
      HTTPTokener, XMLTokener

      -
      public class JSONTokener -extends Object
      +
      +
      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
      -
      Description
      -
      JSONTokener(InputStream inputStream)
      -
      -
      Construct a JSONTokener from an InputStream.
      -
      - -
      -
      Construct a JSONTokener from a Reader.
      -
      - -
      -
      Construct a JSONTokener from a string.
      -
      -
      -
    • +
    +
    +
    +
    +
    +
      +
    • -
    • -
      -

      Constructor Details

      -
        -
      • -
        -

        JSONTokener

        -
        public JSONTokener(Reader reader)
        +
          +
        • + + +

          Constructor Detail

          + + + +
            +
          • +

            JSONTokener

            +
            public JSONTokener(Reader reader)
            Construct a JSONTokener from a Reader. The caller must close the Reader.
            -
            -
            Parameters:
            +
            +
            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.
        -
        -
      -
      + + + +
        +
      • +

        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 Details

    -
      -
    • -
      -

      back

      -
      public void back() - throws JSONException
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          getJsonParserConfiguration

          +
          public JSONParserConfiguration getJsonParserConfiguration()
          +
          Getter
          +
          +
          Returns:
          +
          jsonParserConfiguration
          +
          +
        • +
        + + + +
          +
        • +

          setJsonParserConfiguration

          +
          public void setJsonParserConfiguration(JSONParserConfiguration jsonParserConfiguration)
          +
          Setter
          +
          +
          Parameters:
          +
          jsonParserConfiguration - new value for jsonParserConfiguration
          +
          +
        • +
        + + + +
          +
        • +

          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 +
          +
          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)
      +
    + + + +
      +
    • +

      dehexchar

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

    end

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

      end

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

    more

    -
    public boolean more() - throws JSONException
    + + + + +
      +
    • +

      more

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

    next

    -
    public char next() - throws JSONException
    + + + + +
      +
    • +

      next

      +
      public char next()
      +          throws JSONException
      Get the next character in the source string.
      -
      -
      Returns:
      +
      +
      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.
      +
      Throws:
      +
      JSONException - Thrown if there is an error reading the source string.
      -
  • -
  • -
    -

    getPrevious

    -
    protected char getPrevious()
    + + + + +
      +
    • +

      getPrevious

      +
      protected char getPrevious()
      Get the last character read from the input or '\0' if nothing has been read yet.
      -
      -
      Returns:
      +
      +
      Returns:
      the last character read from the input.
      -
  • -
  • -
    -

    next

    -
    public char next(char c) - throws JSONException
    + + + + +
      +
    • +

      next

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

    next

    -
    public String next(int n) - throws JSONException
    + + + + +
      +
    • +

      next

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

    nextClean

    -
    public char nextClean() - throws JSONException
    + + + + +
      +
    • +

      nextClean

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

    nextString

    -
    public String nextString(char quote) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      quote - The quoting character, either " (double quote) or ' (single quote).
      -
      Returns:
      +
      Returns:
      A String.
      -
      Throws:
      -
      JSONException - Unterminated string.
      +
      Throws:
      +
      JSONException - Unterminated string.
      -
  • -
  • -
    -

    nextTo

    -
    public String nextTo(char delimiter) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      delimiter - A delimiter character.
      -
      Returns:
      +
      Returns:
      A string.
      -
      Throws:
      -
      JSONException - Thrown if there is an error while searching +
      Throws:
      +
      JSONException - Thrown if there is an error while searching for the delimiter
      -
  • -
  • -
    -

    nextTo

    -
    public String nextTo(String delimiters) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      delimiters - A set of delimiter characters.
      -
      Returns:
      +
      Returns:
      A string, trimmed.
      -
      Throws:
      -
      JSONException - Thrown if there is an error while searching +
      Throws:
      +
      JSONException - Thrown if there is an error while searching for the delimiter
      -
  • -
  • -
    -

    nextValue

    -
    public Object nextValue() - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      An object.
      -
      Throws:
      -
      JSONException - If syntax error.
      +
      Throws:
      +
      JSONException - If syntax error.
      -
  • -
  • -
    -

    skipTo

    -
    public char skipTo(char to) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      to - A character to skip to.
      -
      Returns:
      +
      Returns:
      The requested character, or zero if the requested character is not found.
      -
      Throws:
      -
      JSONException - Thrown if there is an error while searching +
      Throws:
      +
      JSONException - Thrown if there is an error while searching for the to character
      -
  • -
  • -
    -

    syntaxError

    -
    public JSONException syntaxError(String message)
    + + + + +
      +
    • +

      syntaxError

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

    syntaxError

    -
    public JSONException syntaxError(String message, - Throwable causedBy)
    + + + + +
      +
    • +

      syntaxError

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

    toString

    -
    public String toString()
    + + + + +
      +
    • +

      toString

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

    close

    -
    public void close() - throws IOException
    + + + + +
      +
    • +

      close

      +
      public void close()
      +           throws IOException
      Closes the underlying reader, releasing any resources associated with it.
      -
      -
      Throws:
      -
      IOException - If an I/O error occurs while closing the reader.
      +
      +
      Throws:
      +
      IOException - If an I/O error occurs while closing the reader.
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/JSONWriter.html b/src/main/java/JSON-Java/org/json/JSONWriter.html index e3f98f3..5a8cb93 100644 --- a/src/main/java/JSON-Java/org/json/JSONWriter.html +++ b/src/main/java/JSON-Java/org/json/JSONWriter.html @@ -1,87 +1,118 @@ - + + - + JSONWriter - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class JSONWriter

    +
    org.json
    +

    Class JSONWriter

    -
    java.lang.Object -
    org.json.JSONWriter
    -
    -
    -
    +
    + +
    +
      +
    • +
      Direct Known Subclasses:
      -
      JSONStringer
      +
      JSONStringer

      -
      public class JSONWriter -extends Object
      +
      +
      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 @@ -107,260 +138,315 @@ loadScripts(document, 'script'); 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 Details

      -
        -
      • -
        -

        mode

        -
        protected char mode
        +
          +
        • + + +

          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.
        -
      -
      + + + +
        +
      • +

        writer

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

    Constructor Details

    -
      -
    • -
      -

      JSONWriter

      -
      public JSONWriter(Appendable w)
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          JSONWriter

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

    Method Details

    -
      -
    • -
      -

      array

      -
      public JSONWriter array() - throws JSONException
      +
        +
      • + + +

        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:
          +
          +
          Returns:
          this
          -
          Throws:
          -
          JSONException - If the nesting is too deep, or if the object is +
          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
      +
    + + + +
      +
    • +

      endArray

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

    endObject

    -
    public JSONWriter endObject() - throws JSONException
    + + + + +
      +
    • +

      endObject

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

    key

    -
    public JSONWriter key(String string) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      string - A key string.
      -
      Returns:
      +
      Returns:
      this
      -
      Throws:
      -
      JSONException - If the key is out of place. For example, keys +
      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
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      this
      -
      Throws:
      -
      JSONException - If the nesting is too deep, or if the object is +
      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
    + + + + +
      +
    • +

      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. @@ -374,93 +460,163 @@ loadScripts(document, 'script');

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

      -
      -
      Parameters:
      +
      +
      Parameters:
      value - The value to be serialized.
      -
      Returns:
      +
      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.
      +
      Throws:
      +
      JSONException - If the value is or contains an invalid number.
      -
  • -
  • -
    -

    value

    -
    public JSONWriter value(boolean b) - throws JSONException
    + + + + +
      +
    • +

      value

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

    value

    -
    public JSONWriter value(double d) - throws JSONException
    + + + + +
      +
    • +

      value

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

    value

    -
    public JSONWriter value(long l) - throws JSONException
    + + + + +
      +
    • +

      value

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

    value

    -
    public JSONWriter value(Object object) - throws JSONException
    + + + + +
      +
    • +

      value

      +
      public JSONWriter value(Object object)
      +                 throws JSONException
      Append an object value.
      -
      -
      Parameters:
      +
      +
      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:
      +
      Returns:
      this
      -
      Throws:
      -
      JSONException - If the value is out of sequence.
      +
      Throws:
      +
      JSONException - If the value is out of sequence.
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/ParserConfiguration.html b/src/main/java/JSON-Java/org/json/ParserConfiguration.html index 6cedfc7..8dc3b3c 100644 --- a/src/main/java/JSON-Java/org/json/ParserConfiguration.html +++ b/src/main/java/JSON-Java/org/json/ParserConfiguration.html @@ -1,363 +1,504 @@ - + + - + ParserConfiguration - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class ParserConfiguration

    +
    org.json
    +

    Class ParserConfiguration

    -
    java.lang.Object -
    org.json.ParserConfiguration
    -
    -
    -
    +
    + +
    +
    -
    -
      + +
    +
    +
    +
      +
    • -
    • -
      -

      Field Summary

      -
      Fields
      -
      -
      Modifier and Type
      -
      Field
      -
      Description
      -
      static final int
      - -
      +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + + + + + + + + + + + +
        Fields 
        Modifier and TypeField and Description
        static intDEFAULT_MAXIMUM_NESTING_DEPTH
        The default maximum nesting depth when parsing a document.
        - -
        protected boolean
        - -
        +
        protected booleankeepStrings
        Specifies if values should be kept as strings (true), or if - they should try to be guessed into JSON values (numeric, boolean, string)
        - -
        protected int
        - -
        -
        The maximum nesting depth when parsing a document.
        -
        -
        static final int
        - -
        + they should try to be guessed into JSON values (numeric, boolean, string).
        +
        protected intmaxNestingDepth +
        The maximum nesting depth when parsing an object.
        +
        static intUNDEFINED_MAXIMUM_NESTING_DEPTH
        Used to indicate there's no defined limit to the maximum nesting depth when parsing a document.
        - - - +
      • +
      -
    • -
      -

      Constructor Summary

      -
      Constructors
      -
      -
      Modifier
      -
      Constructor
      -
      Description
      -
       
      - -
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + + + + + +
        Constructors 
        ModifierConstructor and Description
         ParserConfiguration()
        Constructs a new ParserConfiguration with default settings.
        - -
        protected
        -
        ParserConfiguration(boolean keepStrings, - int maxNestingDepth)
        -
        +
        protected ParserConfiguration(boolean keepStrings, + int maxNestingDepth)
        Constructs a new ParserConfiguration with the specified settings.
        - - - +
      • +
      -
    • -
      -

      Method Summary

      -
      -
      -
      -
      -
      Modifier and Type
      -
      Method
      -
      Description
      - - -
      + -
      -
      -
        + +
      +
    • +
      +
        +
      • -
      • -
        -

        Field Details

        -
          -
        • -
          -

          UNDEFINED_MAXIMUM_NESTING_DEPTH

          -
          public static final int UNDEFINED_MAXIMUM_NESTING_DEPTH
          +
            +
          • + + +

            Field Detail

            + + + +
              +
            • +

              UNDEFINED_MAXIMUM_NESTING_DEPTH

              +
              public static final int UNDEFINED_MAXIMUM_NESTING_DEPTH
              Used to indicate there's no defined limit to the maximum nesting depth when parsing a document.
              -
              -
              See Also:
              -
              - -
              +
              +
              See Also:
              +
              Constant Field Values
              -
        • -
        • -
          -

          DEFAULT_MAXIMUM_NESTING_DEPTH

          -
          public static final int DEFAULT_MAXIMUM_NESTING_DEPTH
          +
        + + + +
          +
        • +

          DEFAULT_MAXIMUM_NESTING_DEPTH

          +
          public static final int DEFAULT_MAXIMUM_NESTING_DEPTH
          The default maximum nesting depth when parsing a document.
          -
          -
          See Also:
          -
          - -
          +
          +
          See Also:
          +
          Constant Field Values
          -
        -
      • -
      • -
        -

        keepStrings

        -
        protected boolean keepStrings
        -
        Specifies if values should be kept as strings (true), or if - they should try to be guessed into JSON values (numeric, boolean, string)
        -
        -
      • -
      • -
        -

        maxNestingDepth

        -
        protected int maxNestingDepth
        -
        The maximum nesting depth when parsing a document.
        -
      -
      + + + +
        +
      • +

        keepStrings

        +
        protected boolean keepStrings
        +
        Specifies if values should be kept as strings (true), or if + they should try to be guessed into JSON values (numeric, boolean, string).
      • +
      + + + +
        +
      • +

        maxNestingDepth

        +
        protected int maxNestingDepth
        +
        The maximum nesting depth when parsing an object.
        +
      • +
      +
    • +
    -
  • -
    -

    Constructor Details

    -
      -
    • -
      -

      ParserConfiguration

      -
      public ParserConfiguration()
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          ParserConfiguration

          +
          public ParserConfiguration()
          Constructs a new ParserConfiguration with default settings.
          -
    • -
    • -
      -

      ParserConfiguration

      -
      protected ParserConfiguration(boolean keepStrings, - int maxNestingDepth)
      +
    + + + +
      +
    • +

      ParserConfiguration

      +
      protected ParserConfiguration(boolean keepStrings,
      +                              int maxNestingDepth)
      Constructs a new ParserConfiguration with the specified settings.
      -
      -
      Parameters:
      +
      +
      Parameters:
      keepStrings - A boolean indicating whether to preserve strings during parsing.
      maxNestingDepth - An integer representing the maximum allowed nesting depth.
      -
  • - + -
  • -
    -

    Method Details

    - + + + +
      +
    • +

      isKeepStrings

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

    withKeepStrings

    -
    public <T extends ParserConfiguration> T withKeepStrings(boolean newVal)
    + + + + +
      +
    • +

      withKeepStrings

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

    getMaxNestingDepth

    -
    public int getMaxNestingDepth()
    + + + + +
      +
    • +

      getMaxNestingDepth

      +
      public int getMaxNestingDepth()
      The maximum nesting depth that the parser will descend before throwing an exception - when parsing the XML into JSONML.
      -
      -
      Returns:
      + when parsing an object (e.g. Map, Collection) into JSON-related objects.
  • +
    +
    Returns:
    the maximum nesting depth set for this configuration
    - -
  • -
    -

    withMaxNestingDepth

    -
    public <T extends ParserConfiguration> T withMaxNestingDepth(int maxNestingDepth)
    + + + + +
      +
    • +

      withMaxNestingDepth

      +
      public <T extends ParserConfiguration> T withMaxNestingDepth(int maxNestingDepth)
      Defines the maximum nesting depth that the parser will descend before throwing an exception - when parsing the XML into JSONML. The default max nesting depth is 512, which means the parser - will throw a JsonException if the maximum depth is reached. + when parsing an object (e.g. Map, Collection) into JSON-related objects. + The default max nesting depth is 512, which means the parser will throw a JsonException if + the maximum depth is reached. Using any negative value as a parameter is equivalent to setting no limit to the nesting depth, which means the parses will go as deep as the maximum call stack size allows.
      -
      -
      Type Parameters:
      +
      +
      Type Parameters:
      T - the type of the configuration object
      -
      Parameters:
      +
      Parameters:
      maxNestingDepth - the maximum nesting depth allowed to the XML parser
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • - - + + + + - + + + + diff --git a/src/main/java/JSON-Java/org/json/Property.html b/src/main/java/JSON-Java/org/json/Property.html index 9a9d20d..a45319e 100644 --- a/src/main/java/JSON-Java/org/json/Property.html +++ b/src/main/java/JSON-Java/org/json/Property.html @@ -1,195 +1,308 @@ - + + - + Property - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class Property

    +
    org.json
    +

    Class Property

    -
    java.lang.Object -
    org.json.Property
    -
    -
    +
    + +
    +
      +

    • -
      public class Property -extends Object
      +
      +
      public class Property
      +extends Object
      Converts a Property file data into JSONObject and back.
      -
    -
    -
      + +
    +
    +
    + - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/StringBuilderWriter.html b/src/main/java/JSON-Java/org/json/StringBuilderWriter.html new file mode 100644 index 0000000..7e8b821 --- /dev/null +++ b/src/main/java/JSON-Java/org/json/StringBuilderWriter.html @@ -0,0 +1,509 @@ + + + + + +StringBuilderWriter + + + + + + + + + + + + +
    +
    org.json
    +

    Class StringBuilderWriter

    +
    +
    + +
    + +
    +
    + +
    +
    + +
    +
    + + + + + + + diff --git a/src/main/java/JSON-Java/org/json/XML.html b/src/main/java/JSON-Java/org/json/XML.html index 513bc29..42330a6 100644 --- a/src/main/java/JSON-Java/org/json/XML.html +++ b/src/main/java/JSON-Java/org/json/XML.html @@ -1,423 +1,529 @@ - + + - + XML - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class XML

    +
    org.json
    +

    Class XML

    -
    java.lang.Object -
    org.json.XML
    -
    -
    +
    + +
    +
      +

    • -
      public class XML -extends Object
      +
      +
      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.
      -
    -
    -
      + +
    +
    +
    + + + + +
      +
    • +

      EQ

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

      GT

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

      GT

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

      LT

      -
      public static final Character LT
      +
    + + + +
      +
    • +

      LT

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

      QUEST

      -
      public static final Character QUEST
      +
    + + + +
      +
    • +

      QUEST

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

      QUOT

      -
      public static final Character QUOT
      +
    + + + +
      +
    • +

      QUOT

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

      SLASH

      -
      public static final Character SLASH
      +
    + + + +
      +
    • +

      SLASH

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

      NULL_ATTR

      -
      public static final String NULL_ATTR
      +
    + + + + + + + + - + -
  • -
    -

    Constructor Details

    -
      -
    • -
      -

      XML

      -
      public XML()
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          XML

          +
          public XML()
          Constructs a new XML object.
          -
    -
  • + -
  • -
    -

    Method Details

    -
      -
    • -
      -

      escape

      -
      public static String escape(String string)
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          escape

          +
          public static String escape(String string)
          Replace special characters with XML escapes:
          
          @@ -427,75 +533,90 @@ loadScripts(document, 'script');
            &quot; (double quote) is replaced by &amp;quot;
            &apos; (single quote / apostrophe) is replaced by &amp;apos;
            
          -
          -
          Parameters:
          +
          +
          Parameters:
          string - The string to be escaped.
          -
          Returns:
          +
          Returns:
          The escaped string.
          -
    • -
    • -
      -

      unescape

      -
      public static String unescape(String string)
      +
    + + + +
      +
    • +

      unescape

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

    noSpace

    -
    public static void noSpace(String string) - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      string - A string.
      -
      Throws:
      -
      JSONException - Thrown if the string contains whitespace or is empty.
      +
      Throws:
      +
      JSONException - Thrown if the string contains whitespace or is empty.
      -
  • -
  • -
    -

    stringToValue

    -
    public static Object stringToValue(String string, - XMLXsiTypeConverter<?> typeConverter)
    + + + + +
      +
    • +

      stringToValue

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

      stringToValue

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

    toJSONObject

    -
    public static JSONObject toJSONObject(String string) - throws JSONException
    + + + + +
      +
    • +

      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, @@ -506,21 +627,24 @@ loadScripts(document, 'script'); "content" member. Comments, prologs, DTDs, and
      
        &lt;[ [ ]]>
      are ignored.
      -
      -
      Parameters:
      +
      +
      Parameters:
      string - The source string.
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown if there is an errors while parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an errors while parsing the string
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(Reader reader) - throws JSONException
    + + + + +
      +
    • +

      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, @@ -531,22 +655,25 @@ loadScripts(document, 'script'); "content" member. Comments, prologs, DTDs, and
      
        &lt;[ [ ]]>
      are ignored.
      -
      -
      Parameters:
      +
      +
      Parameters:
      reader - The XML source reader.
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown if there is an errors while parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an errors while parsing the string
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(Reader reader, - boolean keepStrings) - throws JSONException
    + + + + +
      +
    • +

      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, @@ -560,24 +687,27 @@ loadScripts(document, 'script'); 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:
      +
      +
      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:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown if there is an errors while parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an errors while parsing the string
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(Reader reader, - XMLParserConfiguration config) - throws JSONException
    + + + + +
      +
    • +

      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, @@ -591,23 +721,26 @@ loadScripts(document, 'script'); 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:
      +
      +
      Parameters:
      reader - The XML source reader.
      config - Configuration options for the parser
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown if there is an errors while parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an errors while parsing the string
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(String string, - boolean keepStrings) - throws JSONException
    + + + + +
      +
    • +

      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, @@ -621,24 +754,27 @@ loadScripts(document, 'script'); 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:
      +
      +
      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:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown if there is an errors while parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an errors while parsing the string
      -
  • -
  • -
    -

    toJSONObject

    -
    public static JSONObject toJSONObject(String string, - XMLParserConfiguration config) - throws JSONException
    + + + + +
      +
    • +

      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, @@ -652,136 +788,212 @@ loadScripts(document, 'script'); 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:
      +
      +
      Parameters:
      string - The source string.
      config - Configuration options for the parser.
      -
      Returns:
      +
      Returns:
      A JSONObject containing the structured data from the XML string.
      -
      Throws:
      -
      JSONException - Thrown if there is an errors while parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an errors while parsing the string
      -
  • -
  • -
    -

    toString

    -
    public static String toString(Object object) - throws JSONException
    + + + + +
      +
    • +

      toString

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

    toString

    -
    public static String toString(Object object, - String tagName)
    + + + + +
      +
    • +

      toString

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

      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:
      +
      +
      Parameters:
      object - A JSONObject.
      tagName - The optional name of the enclosing tag.
      config - Configuration that can control output to XML.
      -
      Returns:
      +
      Returns:
      A string.
      -
      Throws:
      -
      JSONException - Thrown if there is an error parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an error parsing the string
      -
  • -
  • -
    -

    toString

    -
    public static String toString(Object object, - int indentFactor)
    + + + + +
      +
    • +

      toString

      +
      public static String toString(Object object,
      +                              int indentFactor)
      Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
      -
      -
      Parameters:
      +
      +
      Parameters:
      object - A JSONObject.
      indentFactor - The number of spaces to add to each level of indentation.
      -
      Returns:
      +
      Returns:
      A string.
      -
      Throws:
      -
      JSONException - Thrown if there is an error parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an error parsing the string
      -
  • -
  • -
    -

    toString

    -
    public static String toString(Object object, - String tagName, - int indentFactor)
    + + + + +
      +
    • +

      toString

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

    toString

    -
    public static String toString(Object object, - String tagName, - XMLParserConfiguration config, - int indentFactor) - throws JSONException
    + + + + +
      +
    • +

      toString

      +
      public static String toString(Object object,
      +                              String tagName,
      +                              XMLParserConfiguration config,
      +                              int indentFactor)
      +                       throws JSONException
      Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
      -
      -
      Parameters:
      +
      +
      Parameters:
      object - A JSONObject.
      tagName - The optional name of the enclosing tag.
      config - Configuration that can control output to XML.
      indentFactor - The number of spaces to add to each level of indentation.
      -
      Returns:
      +
      Returns:
      A string.
      -
      Throws:
      -
      JSONException - Thrown if there is an error parsing the string
      +
      Throws:
      +
      JSONException - Thrown if there is an error parsing the string
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/XMLParserConfiguration.html b/src/main/java/JSON-Java/org/json/XMLParserConfiguration.html index 6b1d4b2..28e4793 100644 --- a/src/main/java/JSON-Java/org/json/XMLParserConfiguration.html +++ b/src/main/java/JSON-Java/org/json/XMLParserConfiguration.html @@ -1,384 +1,480 @@ - + + - + XMLParserConfiguration - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class XMLParserConfiguration

    +
    org.json
    +

    Class XMLParserConfiguration

    -
    java.lang.Object -
    org.json.ParserConfiguration -
    org.json.XMLParserConfiguration
    -
    -
    -
    +
    + +
    +
      +

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

      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.
      -
    + 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:
    +
    +
    Parameters:
    cDataTagName - null 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 + + + + +
      +
    • +

      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.
      -
    + This constructor may be removed in a future release.
    Configure the parser to use custom settings.
    -
    -
    Parameters:
    +
    +
    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.
    -
  • -
  • -
    -

    XMLParserConfiguration

    -
    @Deprecated -public XMLParserConfiguration(boolean keepStrings, - String cDataTagName, - boolean convertNilAttributeToNull)
    -
    Deprecated. -
    This constructor has been deprecated in favor of using the new builder + + + + +
      +
    • +

      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.
      -
    + This constructor may be removed or marked private in a future release.
    Configure the parser to use custom settings.
    -
    -
    Parameters:
    +
    +
    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 @@ -386,233 +482,336 @@ loadScripts(document, 'script');
    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 Details

    - + + + +
      +
    • +

      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)
      -
      -
      Overrides:
      -
      withKeepStrings in class ParserConfiguration
      -
      Parameters:
      +
      +
      Overrides:
      +
      withKeepStrings in class ParserConfiguration
      +
      Parameters:
      newVal - new value to use for the keepStrings configuration option.
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • -
  • -
    -

    getcDataTagName

    -
    public String getcDataTagName()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      The cDataTagName configuration value.
      -
  • -
  • -
    -

    withcDataTagName

    -
    public XMLParserConfiguration withcDataTagName(String newVal)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      newVal - new value to use for the cDataTagName configuration option.
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • -
  • -
    -

    isConvertNilAttributeToNull

    -
    public boolean isConvertNilAttributeToNull()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      The convertNilAttributeToNull configuration value.
      -
  • -
  • -
    -

    withConvertNilAttributeToNull

    -
    public XMLParserConfiguration withConvertNilAttributeToNull(boolean newVal)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      newVal - new value to use for the convertNilAttributeToNull configuration option.
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • -
  • -
    -

    getXsiTypeMap

    -
    public Map<String,XMLXsiTypeConverter<?>> getXsiTypeMap()
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      xsiTypeMap unmodifiable configuration map.
      -
  • -
  • -
    -

    withXsiTypeMap

    -
    public XMLParserConfiguration withXsiTypeMap(Map<String,XMLXsiTypeConverter<?>> xsiTypeMap)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      xsiTypeMap - new HashMap<String, XMLXsiTypeConverter<?>>() to parse values with attribute xsi:type="integer" as integer, xsi:type="string" as string
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • -
  • -
    -

    getForceList

    -
    public Set<String> getForceList()
    + + + + +
      +
    • +

      getForceList

      +
      public Set<String> getForceList()
      When parsing the XML into JSON, specifies that tags that will be converted to arrays in this configuration Set<String> to parse the provided tags' values as arrays
      -
      -
      Returns:
      +
      +
      Returns:
      forceList unmodifiable configuration set.
      -
  • -
  • -
    -

    withForceList

    -
    public XMLParserConfiguration withForceList(Set<String> forceList)
    + + + + +
      +
    • +

      withForceList

      +
      public XMLParserConfiguration withForceList(Set<String> forceList)
      When parsing the XML into JSON, specifies that tags that will be converted to arrays in this configuration Set<String> to parse the provided tags' values as arrays
      -
      -
      Parameters:
      +
      +
      Parameters:
      forceList - new HashSet<String>() to parse the provided tags' values as arrays
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • -
  • -
    -

    withMaxNestingDepth

    -
    public XMLParserConfiguration withMaxNestingDepth(int maxNestingDepth)
    + + + + +
      +
    • +

      withMaxNestingDepth

      +
      public XMLParserConfiguration withMaxNestingDepth(int maxNestingDepth)
      Defines the maximum nesting depth that the parser will descend before throwing an exception when parsing the XML into JSON. The default max nesting depth is 512, which means the parser will throw a JsonException if the maximum depth is reached. Using any negative value as a parameter is equivalent to setting no limit to the nesting depth, which means the parses will go as deep as the maximum call stack size allows.
      -
      -
      Overrides:
      -
      withMaxNestingDepth in class ParserConfiguration
      -
      Parameters:
      +
      +
      Overrides:
      +
      withMaxNestingDepth in class ParserConfiguration
      +
      Parameters:
      maxNestingDepth - the maximum nesting depth allowed to the XML parser
      -
      Returns:
      +
      Returns:
      The existing configuration will not be modified. A new configuration is returned.
      -
  • -
  • -
    -

    withCloseEmptyTag

    -
    public XMLParserConfiguration withCloseEmptyTag(boolean closeEmptyTag)
    + + + + +
      +
    • +

      withCloseEmptyTag

      +
      public XMLParserConfiguration withCloseEmptyTag(boolean closeEmptyTag)
      To enable explicit end tag with empty value.
      -
      -
      Parameters:
      +
      +
      Parameters:
      closeEmptyTag - new value for the closeEmptyTag property
      -
      Returns:
      +
      Returns:
      same instance of configuration with empty tag config updated
      -
  • -
  • -
    -

    withShouldTrimWhitespace

    -
    public XMLParserConfiguration withShouldTrimWhitespace(boolean shouldTrimWhiteSpace)
    + + + + +
      +
    • +

      withShouldTrimWhitespace

      +
      public XMLParserConfiguration withShouldTrimWhitespace(boolean shouldTrimWhiteSpace)
      Sets whether whitespace should be trimmed inside of tags. *NOTE* Do not use this if you expect your XML tags to have names that are the same as cDataTagName as this is unsupported. cDataTagName should be set to a distinct value in these cases.
      -
      -
      Parameters:
      +
      +
      Parameters:
      shouldTrimWhiteSpace - boolean to set trimming on or off. Off is default.
      -
      Returns:
      +
      Returns:
      same instance of configuration with empty tag config updated
      -
  • -
  • -
    -

    isCloseEmptyTag

    -
    public boolean isCloseEmptyTag()
    + + + + +
      +
    • +

      isCloseEmptyTag

      +
      public boolean isCloseEmptyTag()
      Checks if the parser should automatically close empty XML tags.
      -
      -
      Returns:
      +
      +
      Returns:
      true if empty XML tags should be automatically closed, false otherwise.
      -
  • -
  • -
    -

    shouldTrimWhiteSpace

    -
    public boolean shouldTrimWhiteSpace()
    + + + + +
      +
    • +

      shouldTrimWhiteSpace

      +
      public boolean shouldTrimWhiteSpace()
      Checks if the parser should trim white spaces from XML content.
      -
      -
      Returns:
      +
      +
      Returns:
      true if white spaces should be trimmed, false otherwise.
      -
  • - - + + + + - + + + + diff --git a/src/main/java/JSON-Java/org/json/XMLTokener.html b/src/main/java/JSON-Java/org/json/XMLTokener.html index 6378c48..1c52063 100644 --- a/src/main/java/JSON-Java/org/json/XMLTokener.html +++ b/src/main/java/JSON-Java/org/json/XMLTokener.html @@ -1,373 +1,516 @@ - + + - + XMLTokener - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Class XMLTokener

    +
    org.json
    +

    Class XMLTokener

    -
    java.lang.Object -
    org.json.JSONTokener -
    org.json.XMLTokener
    -
    -
    -
    +
    + +
    +
      +

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

      Field Details

      -
        -
      • -
        -

        entity

        -
        public static final HashMap<String,Character> entity
        +
          +
        • + + +

          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 Details

    -
      -
    • -
      -

      XMLTokener

      -
      public XMLTokener(Reader r)
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          XMLTokener

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

      XMLTokener

      -
      public XMLTokener(String s)
      +
    + + + +
      +
    • +

      XMLTokener

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

    XMLTokener

    -
    public XMLTokener(Reader r, - XMLParserConfiguration configuration)
    + + + + +
      +
    • +

      XMLTokener

      +
      public XMLTokener(Reader r,
      +                  XMLParserConfiguration configuration)
      Construct an XMLTokener from a Reader and an XMLParserConfiguration.
      -
      -
      Parameters:
      +
      +
      Parameters:
      r - A source reader.
      configuration - the configuration that can be used to set certain flags
      -
  • - + -
  • -
    -

    Method Details

    - + + + +
      +
    • +

      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 + 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 +
      +
      Returns:
      +
      A string, or a
       '<' 
      Character, or null if there is no more source text.
      -
      Throws:
      -
      JSONException - if a called function has an error
      +
      Throws:
      +
      JSONException - if a called function has an error
      -
  • -
  • -
    -

    nextEntity

    -
    public Object nextEntity(char ampersand) - throws JSONException
    + + + + +
      +
    • +

      nextEntity

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

    nextMeta

    -
    public Object nextMeta() - throws JSONException
    -
    
    +
    +
    +
    +
    +
      +
    • +

      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
      +
      +
      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 +
      Throws:
      +
      JSONException - If a string is not properly closed or if the XML is badly structured.
      -
  • -
  • -
    -

    nextToken

    -
    public Object nextToken() - throws JSONException
    + + + + +
      +
    • +

      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:
      +
      +
      Returns:
      a String or a Character.
      -
      Throws:
      -
      JSONException - If the XML is not well formed.
      +
      Throws:
      +
      JSONException - If the XML is not well formed.
      -
  • -
  • -
    -

    skipPast

    -
    public void skipPast(String to)
    + + + + +
      +
    • +

      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:
      +
      +
      Parameters:
      to - A string to skip past.
      -
  • - - + + +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/XMLXsiTypeConverter.html b/src/main/java/JSON-Java/org/json/XMLXsiTypeConverter.html index d06854c..e7f574e 100644 --- a/src/main/java/JSON-Java/org/json/XMLXsiTypeConverter.html +++ b/src/main/java/JSON-Java/org/json/XMLXsiTypeConverter.html @@ -1,83 +1,109 @@ - + + - + XMLXsiTypeConverter - - - - - + - - - - - - + + -
    - -
    -
    -
    Package org.json
    -

    Interface XMLXsiTypeConverter<T>

    +
    org.json
    +

    Interface XMLXsiTypeConverter<T>

    -
    -
    -
    Type Parameters:
    +
    +
    +
      +
    • +
      +
      Type Parameters:
      T - return type of convert method

      -
      public interface XMLXsiTypeConverter<T>
      +
      +
      public interface XMLXsiTypeConverter<T>
      Type conversion configuration interface to be used with xsi:type attributes.
        XML Sample
      @@ -112,60 +138,127 @@ loadScripts(document, 'script');
             });
        
        
      -
    -
    -
      - -
    • -
      -

      Method Summary

      -
      -
      -
      -
      -
      Modifier and Type
      -
      Method
      -
      Description
      - -
      convert(String value)
      -
      -
      Converts an XML xsi:type attribute value to the specified type T.
      -
      -
      -
      -
      -
    -
    -
    -
      - -
    • -
      -

      Method Details

      -
        -
      • -
        -

        convert

        -
        T convert(String value)
        +
    +
    +
      +
    • + + +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          convert

          +
          T convert(String value)
          +
          Converts an XML xsi:type attribute value to the specified type T.
          +
          +
          Parameters:
          value - The string representation of the XML xsi:type attribute value to be converted.
          -
          Returns:
          +
          Returns:
          An object of type T representing the converted value.
          -
        -
      - +
    • +
    +
    +
    - + + + + diff --git a/src/main/java/JSON-Java/org/json/package-frame.html b/src/main/java/JSON-Java/org/json/package-frame.html new file mode 100644 index 0000000..c6ec014 --- /dev/null +++ b/src/main/java/JSON-Java/org/json/package-frame.html @@ -0,0 +1,55 @@ + + + + + +org.json + + + + + +

    org.json

    + + + diff --git a/src/main/java/JSON-Java/org/json/package-summary.html b/src/main/java/JSON-Java/org/json/package-summary.html index 0f6f2b1..cbe8e32 100644 --- a/src/main/java/JSON-Java/org/json/package-summary.html +++ b/src/main/java/JSON-Java/org/json/package-summary.html @@ -1,205 +1,345 @@ - + + - + org.json - - - - - + - - - - - - + + -
    - -
    -
    -

    Package org.json

    +

    Package org.json

    -
    -
    package org.json
    -
    -
      -
    • -
      -
      -
      -
      -
      Class
      -
      Description
      - -
      -
      This provides static methods to convert comma (or otherwise) delimited text into a - JSONArray, and to convert a JSONArray into comma (or otherwise) delimited text.
      -
      - -
      -
      Convert a web browser cookie specification to a JSONObject and back.
      -
      - -
      -
      Convert a web browser cookie list string to a JSONObject and back.
      -
      - -
      -
      Convert an HTTP header to a JSONObject and back.
      -
      - -
      -
      The HTTPTokener extends the JSONTokener to provide additional methods - for the parsing of HTTP headers.
      -
      - -
      -
      A JSONArray is an ordered sequence of values.
      -
      - -
      -
      The JSONException is thrown by the JSON.org classes when things are amiss.
      -
      - -
      -
      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.
      -
      - -
      -
      Configuration object for the XML to JSONML parser.
      -
      - -
      -
      A JSONObject is an unordered collection of name/value pairs.
      -
      - -
      -
      Configuration object for the JSON parser.
      -
      - -
      -
      A JSON Pointer is a simple query language defined for JSON documents by - RFC 6901.
      -
      - -
      -
      This class allows the user to build a JSONPointer in steps, using - exactly one segment in each step.
      -
      - -
      -
      The JSONPointerException is thrown by JSONPointer if an error occurs - during evaluating a pointer.
      -
      - -
      -
      Use this annotation on a getter method to override the Bean name - parser for Bean -> JSONObject mapping.
      -
      - -
      -
      Use this annotation on a getter method to override the Bean name - parser for Bean -> JSONObject mapping.
      -
      - -
      +
      +
        +
      • + + + + + + + + + + + + + + + + +
        Interface Summary 
        InterfaceDescription
        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).
        - - -
        +
        XMLXsiTypeConverter<T> +
        Type conversion configuration interface to be used with xsi:type attributes.
        +
        +
      • +
      • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Class Summary 
        ClassDescription
        CDL +
        This provides static methods to convert comma (or otherwise) delimited text into a + JSONArray, and to convert a JSONArray into comma (or otherwise) delimited text.
        +
        Cookie +
        Convert a web browser cookie specification to a JSONObject and back.
        +
        CookieList +
        Convert a web browser cookie list string to a JSONObject and back.
        +
        HTTP +
        Convert an HTTP header to a JSONObject and back.
        +
        HTTPTokener +
        The HTTPTokener extends the JSONTokener to provide additional methods + for the parsing of HTTP headers.
        +
        JSONArray +
        A JSONArray is an ordered sequence of values.
        +
        JSONML +
        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.
        +
        JSONMLParserConfiguration +
        Configuration object for the XML to JSONML parser.
        +
        JSONObject +
        A JSONObject is an unordered collection of name/value pairs.
        +
        JSONParserConfiguration +
        Configuration object for the JSON parser.
        +
        JSONPointer +
        A JSON Pointer is a simple query language defined for JSON documents by + RFC 6901.
        +
        JSONPointer.Builder +
        This class allows the user to build a JSONPointer in steps, using + exactly one segment in each step.
        +
        JSONStringer
        JSONStringer provides a quick and convenient way of producing JSON text.
        - - -
        +
        JSONTokener
        A JSONTokener takes a source string and extracts characters and tokens from it.
        - - -
        +
        JSONWriter
        JSONWriter provides a quick and convenient way of producing JSON text.
        - - -
        +
        ParserConfiguration
        Configuration base object for parsers.
        - - -
        +
        Property
        Converts a Property file data into JSONObject and back.
        - - -
        +
        StringBuilderWriter +
        Performance optimised alternative for StringWriter + using internally a StringBuilder instead of a StringBuffer.
        +
        XML
        This provides static methods to convert an XML text into a JSONObject, and to covert a JSONObject into an XML text.
        - - -
        +
        XMLParserConfiguration
        Configuration object for the XML parser.
        - - -
        +
        XMLTokener
        The XMLTokener extends the JSONTokener to provide additional methods for the parsing of XML texts.
        - - -
        -
        Type conversion configuration interface to be used with xsi:type attributes.
        -
        - - - +
        +
      • +
      • + + + + + + + + + + + + + + + + +
        Exception Summary 
        ExceptionDescription
        JSONException +
        The JSONException is thrown by the JSON.org classes when things are amiss.
        +
        JSONPointerException +
        The JSONPointerException is thrown by JSONPointer if an error occurs + during evaluating a pointer.
        +
        +
      • +
      • + + + + + + + + + + + + + + + + +
        Annotation Types Summary 
        Annotation TypeDescription
        JSONPropertyIgnore +
        Use this annotation on a getter method to override the Bean name + parser for Bean -> JSONObject mapping.
        +
        JSONPropertyName +
        Use this annotation on a getter method to override the Bean name + parser for Bean -> JSONObject mapping.
        +
      -
    -
    + + + + diff --git a/src/main/java/JSON-Java/org/json/package-tree.html b/src/main/java/JSON-Java/org/json/package-tree.html index cff9bc7..06e9947 100644 --- a/src/main/java/JSON-Java/org/json/package-tree.html +++ b/src/main/java/JSON-Java/org/json/package-tree.html @@ -1,97 +1,117 @@ - + + - + org.json Class Hierarchy - - - - - + - - - - - - + + -
    - -
    -

    Hierarchy For Package org.json

    -
    +

    Class Hierarchy

    -

    Interface Hierarchy

    -
    -
    -

    Annotation Interface Hierarchy

    +

    Annotation Type Hierarchy

    -
    -
    + + + + diff --git a/src/main/java/JSON-Java/overview-tree.html b/src/main/java/JSON-Java/overview-tree.html index e3d7781..f3b3aa1 100644 --- a/src/main/java/JSON-Java/overview-tree.html +++ b/src/main/java/JSON-Java/overview-tree.html @@ -1,101 +1,121 @@ - + + - + Class Hierarchy - - - - - + - - - - - - + + -
    - -
    -

    Hierarchy For All Packages

    -Package Hierarchies: +Package Hierarchies:
    -
    +

    Class Hierarchy

    -

    Interface Hierarchy

    -
    -
    -

    Annotation Interface Hierarchy

    +

    Annotation Type Hierarchy

    -
    -
    + + + + diff --git a/src/main/java/JSON-Java/package-list b/src/main/java/JSON-Java/package-list new file mode 100644 index 0000000..6374a8e --- /dev/null +++ b/src/main/java/JSON-Java/package-list @@ -0,0 +1 @@ +org.json diff --git a/src/main/java/JSON-Java/script.js b/src/main/java/JSON-Java/script.js index 0765364..b346356 100644 --- a/src/main/java/JSON-Java/script.js +++ b/src/main/java/JSON-Java/script.js @@ -1,132 +1,30 @@ -/* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - */ - -var moduleSearchIndex; -var packageSearchIndex; -var typeSearchIndex; -var memberSearchIndex; -var tagSearchIndex; -function loadScripts(doc, tag) { - createElem(doc, tag, 'search.js'); - - createElem(doc, tag, 'module-search-index.js'); - createElem(doc, tag, 'package-search-index.js'); - createElem(doc, tag, 'type-search-index.js'); - createElem(doc, tag, 'member-search-index.js'); - createElem(doc, tag, 'tag-search-index.js'); -} - -function createElem(doc, tag, path) { - var script = doc.createElement(tag); - var scriptElement = doc.getElementsByTagName(tag)[0]; - script.src = pathtoroot + path; - scriptElement.parentNode.insertBefore(script, scriptElement); -} - -function show(tableId, selected, columns) { - if (tableId !== selected) { - document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')') - .forEach(function(elem) { - elem.style.display = 'none'; - }); +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'; } - document.querySelectorAll('div.' + selected) - .forEach(function(elem, index) { - elem.style.display = ''; - var isEvenRow = index % (columns * 2) < columns; - elem.classList.remove(isEvenRow ? oddRowColor : evenRowColor); - elem.classList.add(isEvenRow ? evenRowColor : oddRowColor); - }); - updateTabs(tableId, selected); + updateTabs(type); } -function updateTabs(tableId, selected) { - document.querySelector('div#' + tableId +' .summary-table') - .setAttribute('aria-labelledby', selected); - document.querySelectorAll('button[id^="' + tableId + '"]') - .forEach(function(tab, index) { - if (selected === tab.id || (tableId === selected && index === 0)) { - tab.className = activeTableTab; - tab.setAttribute('aria-selected', true); - tab.setAttribute('tabindex',0); - } else { - tab.className = tableTab; - tab.setAttribute('aria-selected', false); - tab.setAttribute('tabindex',-1); - } - }); -} - -function switchTab(e) { - var selected = document.querySelector('[aria-selected=true]'); - if (selected) { - if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) { - // left or up arrow key pressed: move focus to previous tab - selected.previousSibling.click(); - selected.previousSibling.focus(); - e.preventDefault(); - } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) { - // right or down arrow key pressed: move focus to next tab - selected.nextSibling.click(); - selected.nextSibling.focus(); - e.preventDefault(); +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] + ""; } } } - -var updateSearchResults = function() {}; - -function indexFilesLoaded() { - return moduleSearchIndex - && packageSearchIndex - && typeSearchIndex - && memberSearchIndex - && tagSearchIndex; -} - -// Workaround for scroll position not being included in browser history (8249133) -document.addEventListener("DOMContentLoaded", function(e) { - var contentDiv = document.querySelector("div.flex-content"); - window.addEventListener("popstate", function(e) { - if (e.state !== null) { - contentDiv.scrollTop = e.state; - } - }); - window.addEventListener("hashchange", function(e) { - history.replaceState(contentDiv.scrollTop, document.title); - }); - contentDiv.addEventListener("scroll", function(e) { - var timeoutID; - if (!timeoutID) { - timeoutID = setTimeout(function() { - history.replaceState(contentDiv.scrollTop, document.title); - timeoutID = null; - }, 100); - } - }); - if (!location.hash) { - history.replaceState(contentDiv.scrollTop, document.title); - } -}); diff --git a/src/main/java/JSON-Java/serialized-form.html b/src/main/java/JSON-Java/serialized-form.html index 856ba3f..c4936cd 100644 --- a/src/main/java/JSON-Java/serialized-form.html +++ b/src/main/java/JSON-Java/serialized-form.html @@ -1,86 +1,146 @@ - + + - + Serialized Form - - - - - + - - - - - - + + -
    - -
    -

    Serialized Form

    - -
    + + + +