From 91ce39c6fcdb9be2c1b05400a28fc641ae48119a Mon Sep 17 00:00:00 2001 From: Ralph Niemitz Date: Sun, 30 Jul 2017 18:54:40 +0200 Subject: [PATCH] Release 1.0.0 Signed-off-by: Ralph Niemitz --- README.md | 61 +- docs/allclasses-frame.html | 33 + docs/allclasses-noframe.html | 33 + docs/constant-values.html | 165 ++ docs/de/ralleytn/simple/json/JSONArray.html | 1805 +++++++++++++++++ .../simple/json/JSONAttribute.Type.html | 366 ++++ .../ralleytn/simple/json/JSONAttribute.html | 273 +++ docs/de/ralleytn/simple/json/JSONAware.html | 238 +++ .../simple/json/JSONContainerFactory.html | 255 +++ .../simple/json/JSONContentHandler.html | 484 +++++ .../ralleytn/simple/json/JSONFormatter.html | 471 +++++ docs/de/ralleytn/simple/json/JSONObject.html | 865 ++++++++ .../simple/json/JSONParseException.html | 498 +++++ docs/de/ralleytn/simple/json/JSONParser.html | 600 ++++++ docs/de/ralleytn/simple/json/JSONRoot.html | 172 ++ .../ralleytn/simple/json/JSONSerializer.html | 287 +++ .../ralleytn/simple/json/JSONStreamAware.html | 244 +++ .../json/JSONTypeSerializationHandler.html | 269 +++ docs/de/ralleytn/simple/json/JSONValue.html | 319 +++ .../simple/json/class-use/JSONArray.html | 161 ++ .../json/class-use/JSONAttribute.Type.html | 156 ++ .../simple/json/class-use/JSONAttribute.html | 122 ++ .../simple/json/class-use/JSONAware.html | 155 ++ .../json/class-use/JSONContainerFactory.html | 157 ++ .../json/class-use/JSONContentHandler.html | 173 ++ .../simple/json/class-use/JSONFormatter.html | 122 ++ .../simple/json/class-use/JSONObject.html | 183 ++ .../json/class-use/JSONParseException.html | 287 +++ .../simple/json/class-use/JSONParser.html | 122 ++ .../simple/json/class-use/JSONRoot.html | 122 ++ .../simple/json/class-use/JSONSerializer.html | 122 ++ .../json/class-use/JSONStreamAware.html | 155 ++ .../JSONTypeSerializationHandler.html | 122 ++ .../simple/json/class-use/JSONValue.html | 122 ++ .../ralleytn/simple/json/package-frame.html | 46 + .../ralleytn/simple/json/package-summary.html | 271 +++ .../de/ralleytn/simple/json/package-tree.html | 194 ++ docs/de/ralleytn/simple/json/package-use.html | 177 ++ docs/deprecated-list.html | 122 ++ docs/help-doc.html | 223 ++ docs/index-files/index-1.html | 129 ++ docs/index-files/index-10.html | 155 ++ docs/index-files/index-11.html | 223 ++ docs/index-files/index-12.html | 134 ++ docs/index-files/index-13.html | 181 ++ docs/index-files/index-2.html | 135 ++ docs/index-files/index-3.html | 151 ++ docs/index-files/index-4.html | 149 ++ docs/index-files/index-5.html | 233 +++ docs/index-files/index-6.html | 267 +++ docs/index-files/index-7.html | 133 ++ docs/index-files/index-8.html | 167 ++ docs/index-files/index-9.html | 133 ++ docs/index.html | 72 + docs/overview-tree.html | 198 ++ docs/package-list | 1 + docs/script.js | 30 + docs/serialized-form.html | 176 ++ docs/stylesheet.css | 574 ++++++ src/de/ralleytn/simple/json/JSONArray.java | 15 +- .../simple/json/JSONContainerFactory.java | 2 +- src/de/ralleytn/simple/json/JSONObject.java | 3 +- src/de/ralleytn/simple/json/JSONParser.java | 148 +- .../ralleytn/simple/json/JSONStreamAware.java | 3 +- 64 files changed, 14093 insertions(+), 71 deletions(-) create mode 100644 docs/allclasses-frame.html create mode 100644 docs/allclasses-noframe.html create mode 100644 docs/constant-values.html create mode 100644 docs/de/ralleytn/simple/json/JSONArray.html create mode 100644 docs/de/ralleytn/simple/json/JSONAttribute.Type.html create mode 100644 docs/de/ralleytn/simple/json/JSONAttribute.html create mode 100644 docs/de/ralleytn/simple/json/JSONAware.html create mode 100644 docs/de/ralleytn/simple/json/JSONContainerFactory.html create mode 100644 docs/de/ralleytn/simple/json/JSONContentHandler.html create mode 100644 docs/de/ralleytn/simple/json/JSONFormatter.html create mode 100644 docs/de/ralleytn/simple/json/JSONObject.html create mode 100644 docs/de/ralleytn/simple/json/JSONParseException.html create mode 100644 docs/de/ralleytn/simple/json/JSONParser.html create mode 100644 docs/de/ralleytn/simple/json/JSONRoot.html create mode 100644 docs/de/ralleytn/simple/json/JSONSerializer.html create mode 100644 docs/de/ralleytn/simple/json/JSONStreamAware.html create mode 100644 docs/de/ralleytn/simple/json/JSONTypeSerializationHandler.html create mode 100644 docs/de/ralleytn/simple/json/JSONValue.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONArray.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONAttribute.Type.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONAttribute.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONAware.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONContainerFactory.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONContentHandler.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONFormatter.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONObject.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONParseException.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONParser.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONRoot.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONSerializer.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONStreamAware.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONTypeSerializationHandler.html create mode 100644 docs/de/ralleytn/simple/json/class-use/JSONValue.html create mode 100644 docs/de/ralleytn/simple/json/package-frame.html create mode 100644 docs/de/ralleytn/simple/json/package-summary.html create mode 100644 docs/de/ralleytn/simple/json/package-tree.html create mode 100644 docs/de/ralleytn/simple/json/package-use.html create mode 100644 docs/deprecated-list.html create mode 100644 docs/help-doc.html create mode 100644 docs/index-files/index-1.html create mode 100644 docs/index-files/index-10.html create mode 100644 docs/index-files/index-11.html create mode 100644 docs/index-files/index-12.html create mode 100644 docs/index-files/index-13.html create mode 100644 docs/index-files/index-2.html create mode 100644 docs/index-files/index-3.html create mode 100644 docs/index-files/index-4.html create mode 100644 docs/index-files/index-5.html create mode 100644 docs/index-files/index-6.html create mode 100644 docs/index-files/index-7.html create mode 100644 docs/index-files/index-8.html create mode 100644 docs/index-files/index-9.html create mode 100644 docs/index.html create mode 100644 docs/overview-tree.html create mode 100644 docs/package-list create mode 100644 docs/script.js create mode 100644 docs/serialized-form.html create mode 100644 docs/stylesheet.css diff --git a/README.md b/README.md index c15019d..a82aa4e 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,74 @@ SimpleJSON is an improved version of [json-simple](https://github.com/fangyidong/json-simple). It adds type safety, serialization, tidy formatting and improved performance. +# Why use this library over the original? + +Because the original was made for Java 2. A version of Java where things like generics weren't there yet. That causes code written with the original library to be completly type unsafe. +It was a casting hell. And on top of that, you could not serialize and deserialize objects. + # Requirements - Java 8 or higher -# Example +# Short Example + +JSON: +```json +{ + "first_name":"John", + "last_name":"Doe", + "income":1200.0, + "friends": [ + { + "first_name":"Jane", + "last_name":"Doe", + "income":1000.0, + "friends" [ + "John|Doe" + ] + } + ] +} +``` +Java: ```java +try { + + String myJSONData = ""; + JSONObject object = new JSONObject(myJSONData); + String firstName = object.getString("first_name"); + String friendsFirstName = object.getArray("friends").getObject(0).getString("first_name"); + float income = object.getFloat("income"); + +} catch(JSONParseException exception) { + + exception.printStackTrace(); +} ``` +# List of changes made to the original library + +This list only applies to version 1.0.0 of this library! + + +- The packages of the original are merged into one +- All public classes now have `JSON` in front of their name. This makes it easier to tell which classes come from that library. Also clears a conflict with the `java.text.ParseException`. +- The `JSONParser` now uses actual stacks +- The `JSONParser` now uses `if-else` instead of `switch-case` because it is faster. +- Updated the documentation. +- Fixed a bug that made it impossible to parse valid JSON with white spaces leading and/or trailing. +- Made it possible to serialize and deserialize JSON +- Added the `JSONFormatter` class which makes it possible to format minimized or minimize formatted JSON data. +- Added more constructors to the `JSONArray` class +- Added constructors to the `JSONObject` and `JSONArray` class which allows direct and type safe parsing of JSON data. +- Added getter methods to `JSONObject` and `JSONArray` which allow type safe reading of data. +- Deleted all unneeded and deprecated methods. + + # Links See the [original](https://github.com/fangyidong/json-simple) See the [online documentation](https://ralleytn.github.io/SimpleJSON/) See the [changelog](https://github.com/RalleYTN/SimpleJSON/blob/master/CHANGELOG.md) -See the [download page](https://github.com/RalleYTN/SimpleJSON/releases) \ No newline at end of file +See the [download page](https://github.com/RalleYTN/SimpleJSON/releases) +See the [complete guide](https://github.com/RalleYTN/SimpleJSON/wiki) on how to use the library \ No newline at end of file diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html new file mode 100644 index 0000000..a8e040d --- /dev/null +++ b/docs/allclasses-frame.html @@ -0,0 +1,33 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html new file mode 100644 index 0000000..a6d5933 --- /dev/null +++ b/docs/allclasses-noframe.html @@ -0,0 +1,33 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/docs/constant-values.html b/docs/constant-values.html new file mode 100644 index 0000000..092a83d --- /dev/null +++ b/docs/constant-values.html @@ -0,0 +1,165 @@ + + + + + +Constant Field Values + + + + + + + + + + + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

de.ralleytn.*

+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONArray.html b/docs/de/ralleytn/simple/json/JSONArray.html new file mode 100644 index 0000000..af88be6 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONArray.html @@ -0,0 +1,1805 @@ + + + + + +JSONArray + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONArray

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.util.AbstractCollection<E>
    • +
    • +
        +
      • java.util.AbstractList<E>
      • +
      • +
          +
        • java.util.ArrayList<java.lang.Object>
        • +
        • +
            +
          • de.ralleytn.simple.json.JSONArray
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    JSONAware, JSONStreamAware, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>, java.util.RandomAccess
    +
    +
    +
    +
    public class JSONArray
    +extends java.util.ArrayList<java.lang.Object>
    +implements JSONAware, JSONStreamAware
    +
    Represents a JSON array.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn), Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      JSONArray() +
      Constructs an empty JSONArray.
      +
      JSONArray(boolean[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(byte[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(char[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(java.util.Collection<?> collection) +
      Constructs a JSONArray containing the elements of the specified + Collection, in the order they are returned by the Collection's Iterator.
      +
      JSONArray(double[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(float[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(int[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(long[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(java.lang.Object array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(java.io.Reader jsonReader) +
      Constructs a JSONArray from JSON data read from a Reader.
      +
      JSONArray(short[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      JSONArray(java.lang.String json) +
      Constructs a JSONArray from JSON data.
      +
      JSONArray(T[] array) +
      Constructs a JSONArray containing the elements of the specified array.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      JSONArraygetArray(int index) +
      If the value already is a JSONArray, it will be casted and returned.
      +
      java.lang.BooleangetBoolean(int index) +
      If the value is already a Boolean, it will be casted and returned.
      +
      java.lang.BytegetByte(int index) +
      If the value is a Number, its byte value is returned.
      +
      java.util.DategetDate(int index, + java.text.DateFormat format) +
      If the value already is a Date, it will be casted and returned.
      +
      java.lang.DoublegetDouble(int index) +
      If the value is a Number, its double value is returned.
      +
      <T extends java.lang.Enum>
      T
      getEnum(int index, + java.lang.Class<T> type) +
      If the String representation of the value equals the name of the enum constant + in the given enum type, it will return the enum constant.
      +
      java.lang.FloatgetFloat(int index) +
      If the value is a Number, its float value is returned.
      +
      java.lang.IntegergetInteger(int index) +
      If the value is a Number, its int value is returned.
      +
      java.lang.LonggetLong(int index) +
      If the value is a Number, its long value is returned.
      +
      JSONObjectgetObject(int index) +
      If the value is a JSONObject already, it will be casted and returned.
      +
      java.lang.ShortgetShort(int index) +
      If the value is a Number, its short value is returned.
      +
      java.lang.StringgetString(int index) +
      Returns the same as the value's Object.toString() method.
      +
      JSONArray[]toArrayArray() +
      Converts this JSONArray into an array of JSONArrays using the getArray(int) method.
      +
      java.lang.Boolean[]toBooleanArray() +
      Converts this JSONArray into an array of Booleans using the getBoolean(int) method.
      +
      java.lang.Byte[]toByteArray() +
      Converts this JSONArray into an array of Bytes using the getByte(int) method.
      +
      java.lang.Double[]toDoubleArray() +
      Converts this JSONArray into an array of Doubles using the getDouble(int) method.
      +
      java.lang.Float[]toFloatArray() +
      Converts this JSONArray into an array of Floats using the getFloat(int) method.
      +
      java.lang.Integer[]toIntegerArray() +
      Converts this JSONArray into an array of Integers using the getInteger(int) method.
      +
      java.lang.StringtoJSONString() 
      static java.lang.StringtoJSONString(boolean[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(byte[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(char[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(java.util.Collection<?> collection) +
      Convert a Collection to JSON text.
      +
      static java.lang.StringtoJSONString(double[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(float[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(int[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(long[] array) +
      Convert an array to JSON text.
      +
      static java.lang.StringtoJSONString(short[] array) +
      Convert an array to JSON text.
      +
      static <T> java.lang.StringtoJSONString(T[] array) +
      Convert an array to JSON text.
      +
      java.lang.Long[]toLongArray() +
      Converts this JSONArray into an array of Longs using the getLong(int) method.
      +
      JSONObject[]toObjectArray() +
      Converts this JSONArray into an array of JSONObjects using the getObject(int) method.
      +
      java.lang.Short[]toShortArray() +
      Converts this JSONArray into an array of Shorts using the getShort(int) method.
      +
      java.lang.StringtoString() 
      java.lang.String[]toStringArray() +
      Converts this JSONArray into an array of Strings using the getString(int) method.
      +
      static voidwriteJSONString(boolean[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(byte[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(char[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(java.util.Collection<?> collection, + java.io.Writer writer) +
      Encode a Collection into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(double[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(float[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(int[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(long[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static voidwriteJSONString(short[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      static <T> voidwriteJSONString(T[] array, + java.io.Writer writer) +
      Encode an array into JSON text and write it to a Writer.
      +
      voidwriteJSONString(java.io.Writer writer) +
      Writes a JSON encoded string on a Writer.
      +
      +
        +
      • + + +

        Methods inherited from class java.util.ArrayList

        +add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • +
      +
        +
      • + + +

        Methods inherited from class java.util.AbstractList

        +equals, hashCode
      • +
      +
        +
      • + + +

        Methods inherited from class java.util.AbstractCollection

        +containsAll
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.List

        +containsAll, equals, hashCode
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.Collection

        +parallelStream, stream
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray()
        +
        Constructs an empty JSONArray.
        +
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(java.util.Collection<?> collection)
        +
        Constructs a JSONArray containing the elements of the specified + Collection, in the order they are returned by the Collection's Iterator.
        +
        +
        Parameters:
        +
        collection - the Collection whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(T[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Type Parameters:
        +
        T - the generic type of the given array
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(byte[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(boolean[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(char[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(short[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(int[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(long[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(float[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(double[] array)
        +
        Constructs a JSONArray containing the elements of the specified array.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(java.lang.Object array)
        +
        Constructs a JSONArray containing the elements of the specified array. + This constructor is a little slower than the others because it uses the Reflection API.
        +
        +
        Parameters:
        +
        array - the array whose elements are to be placed into this JSONArray
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(java.lang.String json)
        +          throws JSONParseException
        +
        Constructs a JSONArray from JSON data.
        +
        +
        Parameters:
        +
        json - the JSON data
        +
        Throws:
        +
        JSONParseException - if the JSON data is invalid
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONArray

        +
        public JSONArray(java.io.Reader jsonReader)
        +          throws JSONParseException,
        +                 java.io.IOException
        +
        Constructs a JSONArray from JSON data read from a Reader.
        +
        +
        Parameters:
        +
        jsonReader - the Reader with the JSON data
        +
        Throws:
        +
        JSONParseException - if the JSON data is invalid
        +
        java.io.IOException - if an I/O error occurred
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(java.util.Collection<?> collection,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode a Collection into JSON text and write it to a Writer. + If this list is also a JSONStreamAware or a JSONAware, JSONStreamAware and JSONAware specific behaviors will be ignored at this top level.
        +
        +
        Parameters:
        +
        collection - the Collection which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public void writeJSONString(java.io.Writer writer)
        +                     throws java.io.IOException
        +
        Description copied from interface: JSONStreamAware
        +
        Writes a JSON encoded string on a Writer.
        +
        +
        Specified by:
        +
        writeJSONString in interface JSONStreamAware
        +
        Parameters:
        +
        writer - the Writer to write on
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(byte[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(short[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(int[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(long[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(float[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(double[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(boolean[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(char[] array,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + + + +
        +
      • +

        writeJSONString

        +
        public static final <T> void writeJSONString(T[] array,
        +                                             java.io.Writer writer)
        +                                      throws java.io.IOException
        +
        Encode an array into JSON text and write it to a Writer.
        +
        +
        Type Parameters:
        +
        T - type of the array
        +
        Parameters:
        +
        array - the array which should be written on the Writer
        +
        writer - the Writer to write to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(java.util.Collection<?> collection)
        +
        Convert a Collection to JSON text. The result is a JSON array. + If this Collection is also a JSONAware, JSONAware specific behaviors will be omitted at this top level.
        +
        +
        Parameters:
        +
        collection - the Collection to convert
        +
        Returns:
        +
        JSON text, or "null" if the Collection is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(byte[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(short[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(int[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(long[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(float[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(double[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(boolean[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(char[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + + + +
        +
      • +

        toJSONString

        +
        public static final <T> java.lang.String toJSONString(T[] array)
        +
        Convert an array to JSON text. The result is a JSON array.
        +
        +
        Type Parameters:
        +
        T - type of the array
        +
        Parameters:
        +
        array - the array to convert
        +
        Returns:
        +
        JSON text, or "null" if array is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public java.lang.String toJSONString()
        +
        +
        Specified by:
        +
        toJSONString in interface JSONAware
        +
        Returns:
        +
        a JSON representation of this object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.util.AbstractCollection<java.lang.Object>
        +
        Returns:
        +
        a String representation of this JSONArray. This is equivalent to calling toJSONString().
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getObject

        +
        public JSONObject getObject(int index)
        +
        If the value is a JSONObject already, it will be casted and returned. + If the value is a Map, it will be wrapped in a JSONObject. The wrapped Map will be returned. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a JSONObject or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getArray

        +
        public JSONArray getArray(int index)
        +
        If the value already is a JSONArray, it will be casted and returned. + If the value is an array or Collection, it will be wrapped in a JSONArray. + The result is returned. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a JSONArray or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getBoolean

        +
        public java.lang.Boolean getBoolean(int index)
        +
        If the value is already a Boolean, it will be casted and returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Number, this method will return true in case its long value is 1. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Boolean or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getByte

        +
        public java.lang.Byte getByte(int index)
        +
        If the value is a Number, its byte value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Byte or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getShort

        +
        public java.lang.Short getShort(int index)
        +
        If the value is a Number, its short value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Short or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getInteger

        +
        public java.lang.Integer getInteger(int index)
        +
        If the value is a Number, its int value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Integer or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        public java.lang.Long getLong(int index)
        +
        If the value is a Number, its long value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Long or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public java.lang.Float getFloat(int index)
        +
        If the value is a Number, its float value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Float or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public java.lang.Double getDouble(int index)
        +
        If the value is a Number, its double value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a Double or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public java.lang.String getString(int index)
        +
        Returns the same as the value's Object.toString() method. + If the actual value is null, this method will return null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        Returns:
        +
        a String or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getDate

        +
        public java.util.Date getDate(int index,
        +                              java.text.DateFormat format)
        +                       throws java.text.ParseException
        +
        If the value already is a Date, it will be casted and returned. + Otherwise the result of the value's Object.toString() will be parsed by the given + DateFormat. The result is returned. + If the actual value is null, this method will return null.
        +
        +
        Parameters:
        +
        index - index of the value
        +
        format - the DateFormat used to parse the date
        +
        Returns:
        +
        a Date or null
        +
        Throws:
        +
        java.text.ParseException - if the date could not be parsed
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getEnum

        +
        public <T extends java.lang.Enum> T getEnum(int index,
        +                                            java.lang.Class<T> type)
        +
        If the String representation of the value equals the name of the enum constant + in the given enum type, it will return the enum constant. + In any other case this method returns null.
        +
        +
        Type Parameters:
        +
        T - the return type
        +
        Parameters:
        +
        index - index of the value
        +
        type - the enum type
        +
        Returns:
        +
        an Enum or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toBooleanArray

        +
        public java.lang.Boolean[] toBooleanArray()
        +
        Converts this JSONArray into an array of Booleans using the getBoolean(int) method.
        +
        +
        Returns:
        +
        an array Booleans
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public java.lang.Byte[] toByteArray()
        +
        Converts this JSONArray into an array of Bytes using the getByte(int) method.
        +
        +
        Returns:
        +
        an array of Bytes
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toShortArray

        +
        public java.lang.Short[] toShortArray()
        +
        Converts this JSONArray into an array of Shorts using the getShort(int) method.
        +
        +
        Returns:
        +
        an array of Shorts
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toIntegerArray

        +
        public java.lang.Integer[] toIntegerArray()
        +
        Converts this JSONArray into an array of Integers using the getInteger(int) method.
        +
        +
        Returns:
        +
        an array of Integers
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toLongArray

        +
        public java.lang.Long[] toLongArray()
        +
        Converts this JSONArray into an array of Longs using the getLong(int) method.
        +
        +
        Returns:
        +
        an array of Longs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toFloatArray

        +
        public java.lang.Float[] toFloatArray()
        +
        Converts this JSONArray into an array of Floats using the getFloat(int) method.
        +
        +
        Returns:
        +
        an array of Floats
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toDoubleArray

        +
        public java.lang.Double[] toDoubleArray()
        +
        Converts this JSONArray into an array of Doubles using the getDouble(int) method.
        +
        +
        Returns:
        +
        an array of Doubles
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        toStringArray

        +
        public java.lang.String[] toStringArray()
        +
        Converts this JSONArray into an array of Strings using the getString(int) method.
        +
        +
        Returns:
        +
        an array of Strings
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + + + + + + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONAttribute.Type.html b/docs/de/ralleytn/simple/json/JSONAttribute.Type.html new file mode 100644 index 0000000..77f9b3f --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONAttribute.Type.html @@ -0,0 +1,366 @@ + + + + + +JSONAttribute.Type + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Enum JSONAttribute.Type

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<JSONAttribute.Type>
    • +
    • +
        +
      • de.ralleytn.simple.json.JSONAttribute.Type
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<JSONAttribute.Type>
    +
    +
    +
    Enclosing class:
    +
    JSONAttribute
    +
    +
    +
    +
    public static enum JSONAttribute.Type
    +extends java.lang.Enum<JSONAttribute.Type>
    +
    Represents the type of an attribute. Not the data type but more if it's read only or not.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      GETTER +
      Marks the attribute for reading.
      +
      SETTER +
      Marks the attribute for writing.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static JSONAttribute.TypevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static JSONAttribute.Type[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        GETTER

        +
        public static final JSONAttribute.Type GETTER
        +
        Marks the attribute for reading.
        +
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        SETTER

        +
        public static final JSONAttribute.Type SETTER
        +
        Marks the attribute for writing.
        +
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static JSONAttribute.Type[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (JSONAttribute.Type c : JSONAttribute.Type.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static JSONAttribute.Type valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONAttribute.html b/docs/de/ralleytn/simple/json/JSONAttribute.html new file mode 100644 index 0000000..26523fc --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONAttribute.html @@ -0,0 +1,273 @@ + + + + + +JSONAttribute + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Annotation Type JSONAttribute

+
+
+
+
    +
  • +
    +
    +
    @Retention(value=RUNTIME)
    + @Target(value={FIELD,METHOD})
    +public @interface JSONAttribute
    +
    Marks a JSON attribute for serialization.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Required Element Summary

      + + + + + + + + + + +
      Required Elements 
      Modifier and TypeRequired Element and Description
      java.lang.Stringname 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        name

        +
        public abstract java.lang.String name
        +
        +
        Returns:
        +
        the name of the attribute
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +
        +
      • +

        type

        +
        public abstract JSONAttribute.Type[] type
        +
        JSONAttribute.Type.GETTER is used for serializing an object. If it is used on a method, it is not allowed to have any parameters! + JSONAttribute.Type.SETTER is used for deserializing an object. If it is used on a method, it can only have one parameter! + If this Annotation is used on a field, it has to be accessible!
        +
        +
        Returns:
        +
        the attribute type
        +
        Since:
        +
        1.0.0
        +
        +
        +
        Default:
        +
        {de.ralleytn.simple.json.JSONAttribute.Type.GETTER, de.ralleytn.simple.json.JSONAttribute.Type.SETTER}
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONAware.html b/docs/de/ralleytn/simple/json/JSONAware.html new file mode 100644 index 0000000..ebd63c7 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONAware.html @@ -0,0 +1,238 @@ + + + + + +JSONAware + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Interface JSONAware

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    JSONArray, JSONObject
    +
    +
    +
    +
    public interface JSONAware
    +
    Beans that support customized output of JSON text shall implement this interface.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toJSONString

        +
        java.lang.String toJSONString()
        +
        +
        Returns:
        +
        a JSON representation of this object
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONContainerFactory.html b/docs/de/ralleytn/simple/json/JSONContainerFactory.html new file mode 100644 index 0000000..4809116 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONContainerFactory.html @@ -0,0 +1,255 @@ + + + + + +JSONContainerFactory + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Interface JSONContainerFactory

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

      Method Detail

      + + + +
        +
      • +

        createObjectContainer

        +
        java.util.Map<java.lang.Object,java.lang.Object> createObjectContainer()
        +
        +
        Returns:
        +
        A Map instance to store the data for a JSON object, or null if you want to use JSONObject instead..
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        creatArrayContainer

        +
        java.util.List<java.lang.Object> creatArrayContainer()
        +
        +
        Returns:
        +
        A List instance to store data for a JSON array, or null if you want to use JSONArray instead.
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONContentHandler.html b/docs/de/ralleytn/simple/json/JSONContentHandler.html new file mode 100644 index 0000000..f8df155 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONContentHandler.html @@ -0,0 +1,484 @@ + + + + + +JSONContentHandler + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Interface JSONContentHandler

+
+
+
+
    +
  • +
    +
    +
    public interface JSONContentHandler
    +
    A simplified and stoppable SAX-like content handler for stream processing of JSON text.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn)
    +
    See Also:
    +
    ContentHandler, +JSONParser.parse(java.io.Reader, JSONContentHandler, boolean)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      booleanendArray() +
      Receives a notification when a JSON array ends.
      +
      voidendJSON() +
      Receives a notification when the JSON processing ends.
      +
      booleanendObject() +
      Receives a notification when a JSON object ends.
      +
      booleanendObjectEntry() +
      Receives a notification when a JSON entry ends.
      +
      booleanprimitive(java.lang.Object value) +
      Receives a notification when a primitive JSON value is reached: + + String + Number + Boolean + null +
      +
      booleanstartArray() +
      Receives a notification when a JSON array begins.
      +
      voidstartJSON() +
      Receives a notification when the JSON processing begins.
      +
      booleanstartObject() +
      Receives a notification when a JSON object begins.
      +
      booleanstartObjectEntry(java.lang.String key) +
      Receives a notification when a JSON object entry begins.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        startJSON

        +
        void startJSON()
        +        throws JSONParseException,
        +               java.io.IOException
        +
        Receives a notification when the JSON processing begins. + The JSONParser will invoke this method only once.
        +
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        endJSON

        +
        void endJSON()
        +      throws JSONParseException,
        +             java.io.IOException
        +
        Receives a notification when the JSON processing ends.
        +
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        startObject

        +
        boolean startObject()
        +             throws JSONParseException,
        +                    java.io.IOException
        +
        Receives a notification when a JSON object begins.
        +
        +
        Returns:
        +
        false if the JSONContentHandler wants to stop parsing after return
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        endJSON()
        +
        +
      • +
      + + + +
        +
      • +

        endObject

        +
        boolean endObject()
        +           throws JSONParseException,
        +                  java.io.IOException
        +
        Receives a notification when a JSON object ends.
        +
        +
        Returns:
        +
        false if the JSONContentHandler wants to stop parsing after return
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        startObject()
        +
        +
      • +
      + + + +
        +
      • +

        startObjectEntry

        +
        boolean startObjectEntry(java.lang.String key)
        +                  throws JSONParseException,
        +                         java.io.IOException
        +
        Receives a notification when a JSON object entry begins.
        +
        +
        Parameters:
        +
        key - name of the object entry
        +
        Returns:
        +
        false if the JSONContentHandler wants to stop parsing after return
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        endObjectEntry()
        +
        +
      • +
      + + + + + + + +
        +
      • +

        startArray

        +
        boolean startArray()
        +            throws JSONParseException,
        +                   java.io.IOException
        +
        Receives a notification when a JSON array begins.
        +
        +
        Returns:
        +
        false if the JSONContentHandler wants to stop parsing after return
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        endArray()
        +
        +
      • +
      + + + +
        +
      • +

        endArray

        +
        boolean endArray()
        +          throws JSONParseException,
        +                 java.io.IOException
        +
        Receives a notification when a JSON array ends.
        +
        +
        Returns:
        +
        false if the JSONContentHandler wants to stop parsing after return
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        startArray()
        +
        +
      • +
      + + + +
        +
      • +

        primitive

        +
        boolean primitive(java.lang.Object value)
        +           throws JSONParseException,
        +                  java.io.IOException
        +
        Receives a notification when a primitive JSON value is reached: +
          +
        • String
        • +
        • Number
        • +
        • Boolean
        • +
        • null
        • +
        +
        +
        Parameters:
        +
        value - the primitive JSON value
        +
        Returns:
        +
        false if the JSONContentHandler wants to stop parsing after return
        +
        Throws:
        +
        JSONParseException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        java.io.IOException - JSONParser will stop and throw the same Exception to the caller when receiving this Exception.
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONFormatter.html b/docs/de/ralleytn/simple/json/JSONFormatter.html new file mode 100644 index 0000000..7ac7a65 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONFormatter.html @@ -0,0 +1,471 @@ + + + + + +JSONFormatter + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONFormatter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.ralleytn.simple.json.JSONFormatter
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class JSONFormatter
    +extends java.lang.Object
    +
    Provides static methods for formatting and minimizing JSON data.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidformat(java.io.Reader jsonReader, + java.io.Writer formattedWriter) + +
      static voidformat(java.io.Reader jsonReader, + java.io.Writer formattedWriter, + int indent) + +
      static voidformat(java.io.Reader jsonReader, + java.io.Writer formattedWriter, + int indent, + boolean useTabs, + boolean windowsLineBreak) +
      Reads the JSON data from the Reader, formats it according to the parameters and writes it on the Writer.
      +
      static java.lang.Stringformat(java.lang.String json) + +
      static java.lang.Stringformat(java.lang.String json, + int indent) + +
      static java.lang.Stringformat(java.lang.String json, + int indent, + boolean useTabs, + boolean windowsLineBreak) +
      Formats JSON data according to the parameters with which this method was called.
      +
      static voidminimize(java.io.Reader jsonReader, + java.io.Writer minimizedWriter) +
      Minimizes formatted JSON data to the bare minimum of what it needs to be valid.
      +
      static java.lang.Stringminimize(java.lang.String json) +
      Minimizes formatted JSON data to the bare minimum of what it needs to be valid.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        format

        +
        public static final void format(java.io.Reader jsonReader,
        +                                java.io.Writer formattedWriter)
        +                         throws java.io.IOException
        +
        Calls format(Reader, Writer, int, boolean, boolean). + UNIX line breaks and tabs will be used. The indent is 1.
        +
        +
        Parameters:
        +
        jsonReader - the Reader from which the JSON data to format comes
        +
        formattedWriter - the Writer on which the formatted JSON data will be written
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        format

        +
        public static final void format(java.io.Reader jsonReader,
        +                                java.io.Writer formattedWriter,
        +                                int indent)
        +                         throws java.io.IOException
        +
        Calls format(Reader, Writer, int, boolean, boolean). + UNIX line breaks and spaces will be used.
        +
        +
        Parameters:
        +
        jsonReader - the Reader from which the JSON data to format comes
        +
        formattedWriter - the Writer on which the formatted JSON data will be written
        +
        indent - number of characters used for one level of indent
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        format

        +
        public static final void format(java.io.Reader jsonReader,
        +                                java.io.Writer formattedWriter,
        +                                int indent,
        +                                boolean useTabs,
        +                                boolean windowsLineBreak)
        +                         throws java.io.IOException
        +
        Reads the JSON data from the Reader, formats it according to the parameters and writes it on the Writer.
        +
        +
        Parameters:
        +
        jsonReader - the Reader from which the JSON data to format comes
        +
        formattedWriter - the Writer on which the formatted JSON data will be written
        +
        indent - number of characters used for one level of indent
        +
        useTabs - if true tabs will be used to for indent, else white spaces will
        +
        windowsLineBreak - if true "\r\n" will be used for line breaks, else "\n" will
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        format

        +
        public static final java.lang.String format(java.lang.String json)
        +
        Calls format(String, int, boolean, boolean). + UNIX line breaks and tabs are used. The indent is 1.
        +
        +
        Parameters:
        +
        json - the JSON data to format
        +
        Returns:
        +
        the formatted JSON data
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        format

        +
        public static final java.lang.String format(java.lang.String json,
        +                                            int indent)
        +
        Call format(String, int, boolean, boolean). + UNIX line breaks and white spaces are used.
        +
        +
        Parameters:
        +
        json - the JSON data to format
        +
        indent - number of characters used for one level of indent
        +
        Returns:
        +
        the formatted JSON data
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        format

        +
        public static final java.lang.String format(java.lang.String json,
        +                                            int indent,
        +                                            boolean useTabs,
        +                                            boolean windowsLineBreak)
        +
        Formats JSON data according to the parameters with which this method was called.
        +
        +
        Parameters:
        +
        json - the JSON data to format
        +
        indent - number of characters used for one level of indent
        +
        useTabs - if true tabs will be used to for indent, else white spaces will
        +
        windowsLineBreak - if true "\r\n" will be used for line breaks, else "\n" will
        +
        Returns:
        +
        the formatted JSON data
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        minimize

        +
        public static final void minimize(java.io.Reader jsonReader,
        +                                  java.io.Writer minimizedWriter)
        +                           throws java.io.IOException
        +
        Minimizes formatted JSON data to the bare minimum of what it needs to be valid. + Can be useful for I/O operations to reduce the data that is transfered. + The result of JSONAware.toJSONString() already returns minimized JSON data.
        +
        +
        Parameters:
        +
        jsonReader - the Reader from which the JSON data to minimize should be read from
        +
        minimizedWriter - the Writer to which the minimized JSON data should be written
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        minimize

        +
        public static final java.lang.String minimize(java.lang.String json)
        +
        Minimizes formatted JSON data to the bare minimum of what it needs to be valid. + Can be useful for I/O operations to reduce the data that is transfered. + The result of JSONAware.toJSONString() already returns minimized JSON data.
        +
        +
        Parameters:
        +
        json - the JSON data that should be minimized
        +
        Returns:
        +
        the minimized JSON data
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONObject.html b/docs/de/ralleytn/simple/json/JSONObject.html new file mode 100644 index 0000000..685d4b6 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONObject.html @@ -0,0 +1,865 @@ + + + + + +JSONObject + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONObject

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.util.AbstractMap<K,V>
    • +
    • +
        +
      • java.util.HashMap<K,V>
      • +
      • +
          +
        • java.util.LinkedHashMap<java.lang.Object,java.lang.Object>
        • +
        • +
            +
          • de.ralleytn.simple.json.JSONObject
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    JSONAware, JSONStreamAware, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>
    +
    +
    +
    +
    public class JSONObject
    +extends java.util.LinkedHashMap<java.lang.Object,java.lang.Object>
    +implements JSONAware, JSONStreamAware
    +
    Represents a JSON object.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn), Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.util.AbstractMap

        +java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      JSONArraygetArray(java.lang.String key) +
      If the value already is a JSONArray, it will be casted and returned.
      +
      java.lang.BooleangetBoolean(java.lang.String key) +
      If the value is already a Boolean, it will be casted and returned.
      +
      java.lang.BytegetByte(java.lang.String key) +
      If the value is a Number, its byte value is returned.
      +
      java.util.DategetDate(java.lang.String key, + java.text.DateFormat format) +
      If the value already is a Date, it will be casted and returned.
      +
      java.lang.DoublegetDouble(java.lang.String key) +
      If the value is a Number, its double value is returned.
      +
      <T extends java.lang.Enum>
      T
      getEnum(java.lang.String key, + java.lang.Class<T> type) +
      If the String representation of the value equals the name of the enum constant + in the given enum type, it will return the enum constant.
      +
      java.lang.FloatgetFloat(java.lang.String key) +
      If the value is a Number, its float value is returned.
      +
      java.lang.IntegergetInteger(java.lang.String key) +
      If the value is a Number, its int value is returned.
      +
      java.lang.LonggetLong(java.lang.String key) +
      If the value is a Number, its long value is returned.
      +
      JSONObjectgetObject(java.lang.String key) +
      If the value is a JSONObject already, it will be casted and returned.
      +
      java.lang.ShortgetShort(java.lang.String key) +
      If the value is a Number, its short value is returned.
      +
      java.lang.StringgetString(java.lang.String key) +
      Returns the same as the value's Object.toString() method.
      +
      java.lang.StringtoJSONString() 
      static java.lang.StringtoJSONString(java.util.Map<?,?> map) +
      Convert a Map to JSON text.
      +
      java.lang.StringtoString() 
      static voidwriteJSONString(java.util.Map<?,?> map, + java.io.Writer writer) +
      Encode a Map into JSON text and write it to out.
      +
      voidwriteJSONString(java.io.Writer writer) +
      Writes a JSON encoded string on a Writer.
      +
      +
        +
      • + + +

        Methods inherited from class java.util.LinkedHashMap

        +clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
      • +
      +
        +
      • + + +

        Methods inherited from class java.util.HashMap

        +clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
      • +
      +
        +
      • + + +

        Methods inherited from class java.util.AbstractMap

        +equals, hashCode
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.Map

        +compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject()
        +
        Constructs an empty JSONObject
        +
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(java.util.Map<?,?> map)
        +
        Allows creation of a JSONObject from a Map. After that, both the + generated JSONObject and the Map can be modified independently.
        +
        +
        Parameters:
        +
        map - the Map from which the JSONObject should be created
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(java.lang.String json)
        +           throws JSONParseException
        +
        Constructs a JSONObject from JSON data.
        +
        +
        Parameters:
        +
        json - the JSON data
        +
        Throws:
        +
        JSONParseException - if the JSON data is invalid
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        JSONObject

        +
        public JSONObject(java.io.Reader jsonReader)
        +           throws java.io.IOException,
        +                  JSONParseException
        +
        Constructs a JSONObject from JSON data read from a Reader.
        +
        +
        Parameters:
        +
        jsonReader - the Reader with the JSON data
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurred
        +
        JSONParseException - if the JSON data is invalid
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        writeJSONString

        +
        public static final void writeJSONString(java.util.Map<?,?> map,
        +                                         java.io.Writer writer)
        +                                  throws java.io.IOException
        +
        Encode a Map into JSON text and write it to out. This method will not close or flush the given Writer! + If this Map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviors will be ignored at this top level.
        +
        +
        Parameters:
        +
        map - the Map to write
        +
        writer - the Writer to which the Map should be written to
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.writeJSONString(Object, Writer)
        +
        +
      • +
      + + + +
        +
      • +

        writeJSONString

        +
        public void writeJSONString(java.io.Writer writer)
        +                     throws java.io.IOException
        +
        Description copied from interface: JSONStreamAware
        +
        Writes a JSON encoded string on a Writer.
        +
        +
        Specified by:
        +
        writeJSONString in interface JSONStreamAware
        +
        Parameters:
        +
        writer - the Writer to write on
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public static final java.lang.String toJSONString(java.util.Map<?,?> map)
        +
        Convert a Map to JSON text. The result is a JSON object. + If this Map is also a JSONAware, JSONAware specific behaviors will be omitted at this top level.
        +
        +
        Parameters:
        +
        map - the Map to convert
        +
        Returns:
        +
        JSON text, or "null" if the Map is null.
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONValue.toJSONString(Object)
        +
        +
      • +
      + + + +
        +
      • +

        toJSONString

        +
        public java.lang.String toJSONString()
        +
        +
        Specified by:
        +
        toJSONString in interface JSONAware
        +
        Returns:
        +
        a JSON representation of this object
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.util.AbstractMap<java.lang.Object,java.lang.Object>
        +
        Returns:
        +
        a String representation of this JSONObject. This is equivalent to calling toJSONString().
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getObject

        +
        public JSONObject getObject(java.lang.String key)
        +
        If the value is a JSONObject already, it will be casted and returned. + If the value is a Map, it will be wrapped in a JSONObject. The wrapped Map will be returned. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a JSONObject or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getArray

        +
        public JSONArray getArray(java.lang.String key)
        +
        If the value already is a JSONArray, it will be casted and returned. + If the value is an array or Collection, it will be wrapped in a JSONArray. + The result is returned. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a JSONArray or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getBoolean

        +
        public java.lang.Boolean getBoolean(java.lang.String key)
        +
        If the value is already a Boolean, it will be casted and returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Number, this method will return true in case its long value is 1. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Boolean or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getByte

        +
        public java.lang.Byte getByte(java.lang.String key)
        +
        If the value is a Number, its byte value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Byte or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getShort

        +
        public java.lang.Short getShort(java.lang.String key)
        +
        If the value is a Number, its short value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Short or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getInteger

        +
        public java.lang.Integer getInteger(java.lang.String key)
        +
        If the value is a Number, its int value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Integer or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        public java.lang.Long getLong(java.lang.String key)
        +
        If the value is a Number, its long value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Long or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getFloat

        +
        public java.lang.Float getFloat(java.lang.String key)
        +
        If the value is a Number, its float value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Float or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public java.lang.Double getDouble(java.lang.String key)
        +
        If the value is a Number, its double value is returned. + If the value is a String, it will be parsed. The result is returned. + If the value is a Boolean, this method returns 1 in case the value is true otherwise 0. + In any other case this method returns null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a Double or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public java.lang.String getString(java.lang.String key)
        +
        Returns the same as the value's Object.toString() method. + If the actual value is null, this method will return null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        Returns:
        +
        a String or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getDate

        +
        public java.util.Date getDate(java.lang.String key,
        +                              java.text.DateFormat format)
        +                       throws java.text.ParseException
        +
        If the value already is a Date, it will be casted and returned. + Otherwise the result of the value's Object.toString() will be parsed by the given + DateFormat. The result is returned. + If the actual value is null, this method will return null.
        +
        +
        Parameters:
        +
        key - key of the value
        +
        format - the DateFormat to parse the date with
        +
        Returns:
        +
        a Date or null
        +
        Throws:
        +
        java.text.ParseException - if the date could not be parsed
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getEnum

        +
        public <T extends java.lang.Enum> T getEnum(java.lang.String key,
        +                                            java.lang.Class<T> type)
        +
        If the String representation of the value equals the name of the enum constant + in the given enum type, it will return the enum constant. + In any other case this method returns null.
        +
        +
        Type Parameters:
        +
        T - the generic return type
        +
        Parameters:
        +
        key - key of the value
        +
        type - the enum type
        +
        Returns:
        +
        an Enum or null
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONParseException.html b/docs/de/ralleytn/simple/json/JSONParseException.html new file mode 100644 index 0000000..da8d127 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONParseException.html @@ -0,0 +1,498 @@ + + + + + +JSONParseException + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONParseException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • de.ralleytn.simple.json.JSONParseException
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    +
    public class JSONParseException
    +extends java.lang.Exception
    +
    ParseException explains why and where the error occurs in source JSON text.
    +
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn), Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        ERROR_UNEXPECTED_CHAR

        +
        public static final int ERROR_UNEXPECTED_CHAR
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        ERROR_UNEXPECTED_TOKEN

        +
        public static final int ERROR_UNEXPECTED_TOKEN
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        ERROR_UNEXPECTED_EXCEPTION

        +
        public static final int ERROR_UNEXPECTED_EXCEPTION
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONParseException

        +
        public JSONParseException(int errorType)
        +
      • +
      + + + +
        +
      • +

        JSONParseException

        +
        public JSONParseException(int errorType,
        +                          java.lang.Object unexpectedObject)
        +
      • +
      + + + +
        +
      • +

        JSONParseException

        +
        public JSONParseException(int position,
        +                          int errorType,
        +                          java.lang.Object unexpectedObject)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getErrorType

        +
        public int getErrorType()
        +
      • +
      + + + +
        +
      • +

        setErrorType

        +
        public void setErrorType(int errorType)
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public int getPosition()
        +
        +
        Returns:
        +
        The character position (starting with 0) of the input where the error occurs.
        +
        See Also:
        +
        JSONParser.getPosition()
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        public void setPosition(int position)
        +
      • +
      + + + +
        +
      • +

        getUnexpectedObject

        +
        public java.lang.Object getUnexpectedObject()
        +
        +
        Returns:
        +
        One of the following base on the value of errorType: + ERROR_UNEXPECTED_CHAR java.lang.Character + ERROR_UNEXPECTED_TOKEN org.json.simple.parser.Yytoken + ERROR_UNEXPECTED_EXCEPTION java.lang.Exception
        +
        See Also:
        +
        Yytoken
        +
        +
      • +
      + + + +
        +
      • +

        setUnexpectedObject

        +
        public void setUnexpectedObject(java.lang.Object unexpectedObject)
        +
      • +
      + + + +
        +
      • +

        getMessage

        +
        public java.lang.String getMessage()
        +
        +
        Overrides:
        +
        getMessage in class java.lang.Throwable
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONParser.html b/docs/de/ralleytn/simple/json/JSONParser.html new file mode 100644 index 0000000..148b871 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONParser.html @@ -0,0 +1,600 @@ + + + + + +JSONParser + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONParser

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.ralleytn.simple.json.JSONParser
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class JSONParser
    +extends java.lang.Object
    +
    Parser for JSON text. Please note that JSONParser is NOT thread-safe.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn), Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JSONParser

        +
        public JSONParser()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the parser to the initial state without resetting the underlying reader.
        +
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset(java.io.Reader reader)
        +
        Resets the parser to the initial state with a new character reader.
        +
        +
        Parameters:
        +
        reader - the new character reader.
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public int getPosition()
        +
        +
        Returns:
        +
        the position of the beginning of the current token.
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        parse

        +
        public java.lang.Object parse(java.lang.String string)
        +                       throws JSONParseException
        +
        Parses JSON data.
        +
        +
        Parameters:
        +
        string - text with the JSON data
        +
        Returns:
        +
        An instance of: +
        +
        Throws:
        +
        JSONParseException - if the JSON data is invalid
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + + + + + +
        +
      • +

        parse

        +
        public java.lang.Object parse(java.io.Reader reader)
        +                       throws java.io.IOException,
        +                              JSONParseException
        +
        Parses JSON data.
        +
        +
        Parameters:
        +
        reader - the Reader from which the JSON data comes
        +
        Returns:
        +
        An instance of: +
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        JSONParseException - if the JSON data is invalid
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        parse

        +
        public void parse(java.lang.String string,
        +                  JSONContentHandler contentHandler,
        +                  boolean resume)
        +           throws JSONParseException
        +
        Goes over JSON data step by step using a JSONContentHandler.
        +
        +
        Parameters:
        +
        string - text with the JSON data
        +
        contentHandler - the JSONContentHandler
        +
        resume - Indicates if it continues previous parsing operation. If set to true, resume parsing the old stream, and parameter reader will be ignored. If this method is called for the first time in this instance, resume will be ignored.
        +
        Throws:
        +
        JSONParseException - if the JSON data is invalid or the JSONContentHandler throws it
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + + + + + +
        +
      • +

        parse

        +
        public void parse(java.io.Reader reader,
        +                  JSONContentHandler contentHandler,
        +                  boolean resume)
        +           throws java.io.IOException,
        +                  JSONParseException
        +
        Goes over JSON data step by step using a JSONContentHandler.
        +
        +
        Parameters:
        +
        reader - the Reader containing the JSON data
        +
        contentHandler - the JSONContentHandler
        +
        resume - Indicates if it continues previous parsing operation. If set to true, resume parsing the old stream, and parameter reader will be ignored. If this method is called for the first time in this instance, resume will be ignored.
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs or the JSONContentHandler throws it
        +
        JSONParseException - if the JSON data is invalid or the JSONContentHandler throws it
        +
        Since:
        +
        1.0.0
        +
        See Also:
        +
        JSONContentHandler
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONRoot.html b/docs/de/ralleytn/simple/json/JSONRoot.html new file mode 100644 index 0000000..930de5c --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONRoot.html @@ -0,0 +1,172 @@ + + + + + +JSONRoot + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Annotation Type JSONRoot

+
+
+
+
    +
  • +
    +
    +
    @Retention(value=RUNTIME)
    + @Target(value=TYPE)
    +public @interface JSONRoot
    +
    Marks an class for serialization.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONSerializer.html b/docs/de/ralleytn/simple/json/JSONSerializer.html new file mode 100644 index 0000000..46597c7 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONSerializer.html @@ -0,0 +1,287 @@ + + + + + +JSONSerializer + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONSerializer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.ralleytn.simple.json.JSONSerializer
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class JSONSerializer
    +extends java.lang.Object
    +
    Provides static methods which allow you to convert Java objects into JSONObjects + and the other way around.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voiddeserialize(JSONObject json, + java.lang.Object object) +
      Transfers the data of JSONObject into a Java object.
      +
      static JSONObjectserialize(java.lang.Object object) +
      Converts a Java object into a JSONObject.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        deserialize

        +
        public static final void deserialize(JSONObject json,
        +                                     java.lang.Object object)
        +                              throws java.lang.Exception
        +
        Transfers the data of JSONObject into a Java object.
        +
        +
        Parameters:
        +
        json - the JSON object containing the data
        +
        object - the body of the Java object that should be filled
        +
        Throws:
        +
        java.lang.Exception - if an error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        serialize

        +
        public static final JSONObject serialize(java.lang.Object object)
        +                                  throws java.lang.Exception
        +
        Converts a Java object into a JSONObject.
        +
        +
        Parameters:
        +
        object - the Java object you want to convert
        +
        Returns:
        +
        the resulting JSONObject
        +
        Throws:
        +
        java.lang.Exception - if an error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONStreamAware.html b/docs/de/ralleytn/simple/json/JSONStreamAware.html new file mode 100644 index 0000000..40fc34f --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONStreamAware.html @@ -0,0 +1,244 @@ + + + + + +JSONStreamAware + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Interface JSONStreamAware

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    JSONArray, JSONObject
    +
    +
    +
    +
    public interface JSONStreamAware
    +
    Beans that support customized output of JSON text to a Writer shall implement this interface.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        writeJSONString

        +
        void writeJSONString(java.io.Writer writer)
        +              throws java.io.IOException
        +
        Writes a JSON encoded string on a Writer.
        +
        +
        Parameters:
        +
        writer - the Writer to write on
        +
        Throws:
        +
        java.io.IOException - if an I/O error occurs
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONTypeSerializationHandler.html b/docs/de/ralleytn/simple/json/JSONTypeSerializationHandler.html new file mode 100644 index 0000000..e7119f7 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONTypeSerializationHandler.html @@ -0,0 +1,269 @@ + + + + + +JSONTypeSerializationHandler + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Interface JSONTypeSerializationHandler

+
+
+
+
    +
  • +
    +
    +
    public interface JSONTypeSerializationHandler
    +
    Is needed to manage none-JSON types when serializing or deserializing objects.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      java.lang.Objectdeserialize(java.lang.Class<?> type, + java.lang.Object value) +
      Is called when the needed type is a none-JSON type.
      +
      java.lang.Objectserialize(java.lang.Class<?> type, + java.lang.Object value) +
      Is called when an object is being serialized and a none-JSON type is reached.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        serialize

        +
        java.lang.Object serialize(java.lang.Class<?> type,
        +                           java.lang.Object value)
        +
        Is called when an object is being serialized and a none-JSON type is reached.
        +
        +
        Parameters:
        +
        type - the none-JSON type
        +
        value - the value
        +
        Returns:
        +
        a JSON type value that will be written into the object
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      + + + +
        +
      • +

        deserialize

        +
        java.lang.Object deserialize(java.lang.Class<?> type,
        +                             java.lang.Object value)
        +
        Is called when the needed type is a none-JSON type.
        +
        +
        Parameters:
        +
        type - the needed type
        +
        value - the value from the JSONObject
        +
        Returns:
        +
        the value to which the Java object attribute will be set
        +
        Since:
        +
        1.0.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/JSONValue.html b/docs/de/ralleytn/simple/json/JSONValue.html new file mode 100644 index 0000000..8477d00 --- /dev/null +++ b/docs/de/ralleytn/simple/json/JSONValue.html @@ -0,0 +1,319 @@ + + + + + +JSONValue + + + + + + + + + + + + +
+
de.ralleytn.simple.json
+

Class JSONValue

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.ralleytn.simple.json.JSONValue
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class JSONValue
    +extends java.lang.Object
    +
    Contains a few static methods for JSON values.
    +
    +
    Since:
    +
    1.0.0
    +
    Version:
    +
    1.0.0
    +
    Author:
    +
    FangYidong(fangyidong@yahoo.com.cn), Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static java.lang.Stringescape(java.lang.String string) +
      Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
      +
      static java.lang.StringtoJSONString(java.lang.Object value) +
      Convert an Object to JSON text.
      +
      static voidwriteJSONString(java.lang.Object value, + java.io.Writer writer) +
      Encode an Object into JSON text and write it to a Writer.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ +
+
+ + + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONArray.html b/docs/de/ralleytn/simple/json/class-use/JSONArray.html new file mode 100644 index 0000000..10efc07 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONArray.html @@ -0,0 +1,161 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONArray + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONArray

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONAttribute.Type.html b/docs/de/ralleytn/simple/json/class-use/JSONAttribute.Type.html new file mode 100644 index 0000000..ce8a344 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONAttribute.Type.html @@ -0,0 +1,156 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONAttribute.Type + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONAttribute.Type

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONAttribute.html b/docs/de/ralleytn/simple/json/class-use/JSONAttribute.html new file mode 100644 index 0000000..bd6f4d3 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONAttribute.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONAttribute + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONAttribute

+
+
No usage of de.ralleytn.simple.json.JSONAttribute
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONAware.html b/docs/de/ralleytn/simple/json/class-use/JSONAware.html new file mode 100644 index 0000000..5ad7aad --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONAware.html @@ -0,0 +1,155 @@ + + + + + +Uses of Interface de.ralleytn.simple.json.JSONAware + + + + + + + + + + + +
+

Uses of Interface
de.ralleytn.simple.json.JSONAware

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONContainerFactory.html b/docs/de/ralleytn/simple/json/class-use/JSONContainerFactory.html new file mode 100644 index 0000000..17bdeab --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONContainerFactory.html @@ -0,0 +1,157 @@ + + + + + +Uses of Interface de.ralleytn.simple.json.JSONContainerFactory + + + + + + + + + + + +
+

Uses of Interface
de.ralleytn.simple.json.JSONContainerFactory

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONContentHandler.html b/docs/de/ralleytn/simple/json/class-use/JSONContentHandler.html new file mode 100644 index 0000000..cca9431 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONContentHandler.html @@ -0,0 +1,173 @@ + + + + + +Uses of Interface de.ralleytn.simple.json.JSONContentHandler + + + + + + + + + + + +
+

Uses of Interface
de.ralleytn.simple.json.JSONContentHandler

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONFormatter.html b/docs/de/ralleytn/simple/json/class-use/JSONFormatter.html new file mode 100644 index 0000000..9c68631 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONFormatter.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONFormatter + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONFormatter

+
+
No usage of de.ralleytn.simple.json.JSONFormatter
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONObject.html b/docs/de/ralleytn/simple/json/class-use/JSONObject.html new file mode 100644 index 0000000..df92e8b --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONObject.html @@ -0,0 +1,183 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONObject + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONObject

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONParseException.html b/docs/de/ralleytn/simple/json/class-use/JSONParseException.html new file mode 100644 index 0000000..f6d55d5 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONParseException.html @@ -0,0 +1,287 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONParseException + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONParseException

+
+
+
    +
  • +
      +
    • + + +

      Uses of JSONParseException in de.ralleytn.simple.json

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in de.ralleytn.simple.json that throw JSONParseException 
      Modifier and TypeMethod and Description
      booleanJSONContentHandler.endArray() +
      Receives a notification when a JSON array ends.
      +
      voidJSONContentHandler.endJSON() +
      Receives a notification when the JSON processing ends.
      +
      booleanJSONContentHandler.endObject() +
      Receives a notification when a JSON object ends.
      +
      booleanJSONContentHandler.endObjectEntry() +
      Receives a notification when a JSON entry ends.
      +
      java.lang.ObjectJSONParser.parse(java.io.Reader reader) +
      Parses JSON data.
      +
      java.lang.ObjectJSONParser.parse(java.io.Reader reader, + JSONContainerFactory containerFactory) +
      Parses JSON data using a custom JSONContainerFactory.
      +
      voidJSONParser.parse(java.io.Reader reader, + JSONContentHandler contentHandler) +
      Goes over JSON data step by step using a JSONContentHandler.
      +
      voidJSONParser.parse(java.io.Reader reader, + JSONContentHandler contentHandler, + boolean resume) +
      Goes over JSON data step by step using a JSONContentHandler.
      +
      java.lang.ObjectJSONParser.parse(java.lang.String string) +
      Parses JSON data.
      +
      java.lang.ObjectJSONParser.parse(java.lang.String string, + JSONContainerFactory containerFactory) +
      Parses JSON data using a custom JSONContainerFactory.
      +
      voidJSONParser.parse(java.lang.String string, + JSONContentHandler contentHandler) +
      Goes over JSON data step by step using a JSONContentHandler.
      +
      voidJSONParser.parse(java.lang.String string, + JSONContentHandler contentHandler, + boolean resume) +
      Goes over JSON data step by step using a JSONContentHandler.
      +
      booleanJSONContentHandler.primitive(java.lang.Object value) +
      Receives a notification when a primitive JSON value is reached: + + String + Number + Boolean + null +
      +
      booleanJSONContentHandler.startArray() +
      Receives a notification when a JSON array begins.
      +
      voidJSONContentHandler.startJSON() +
      Receives a notification when the JSON processing begins.
      +
      booleanJSONContentHandler.startObject() +
      Receives a notification when a JSON object begins.
      +
      booleanJSONContentHandler.startObjectEntry(java.lang.String key) +
      Receives a notification when a JSON object entry begins.
      +
      + + + + + + + + + + + + + + + + + + + +
      Constructors in de.ralleytn.simple.json that throw JSONParseException 
      Constructor and Description
      JSONArray(java.io.Reader jsonReader) +
      Constructs a JSONArray from JSON data read from a Reader.
      +
      JSONArray(java.lang.String json) +
      Constructs a JSONArray from JSON data.
      +
      JSONObject(java.io.Reader jsonReader) +
      Constructs a JSONObject from JSON data read from a Reader.
      +
      JSONObject(java.lang.String json) +
      Constructs a JSONObject from JSON data.
      +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONParser.html b/docs/de/ralleytn/simple/json/class-use/JSONParser.html new file mode 100644 index 0000000..f4c2f26 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONParser.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONParser + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONParser

+
+
No usage of de.ralleytn.simple.json.JSONParser
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONRoot.html b/docs/de/ralleytn/simple/json/class-use/JSONRoot.html new file mode 100644 index 0000000..5c02bcf --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONRoot.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONRoot + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONRoot

+
+
No usage of de.ralleytn.simple.json.JSONRoot
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONSerializer.html b/docs/de/ralleytn/simple/json/class-use/JSONSerializer.html new file mode 100644 index 0000000..4d4d379 --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONSerializer.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONSerializer + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONSerializer

+
+
No usage of de.ralleytn.simple.json.JSONSerializer
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONStreamAware.html b/docs/de/ralleytn/simple/json/class-use/JSONStreamAware.html new file mode 100644 index 0000000..29fa2dc --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONStreamAware.html @@ -0,0 +1,155 @@ + + + + + +Uses of Interface de.ralleytn.simple.json.JSONStreamAware + + + + + + + + + + + +
+

Uses of Interface
de.ralleytn.simple.json.JSONStreamAware

+
+
+ +
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONTypeSerializationHandler.html b/docs/de/ralleytn/simple/json/class-use/JSONTypeSerializationHandler.html new file mode 100644 index 0000000..a14c72d --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONTypeSerializationHandler.html @@ -0,0 +1,122 @@ + + + + + +Uses of Interface de.ralleytn.simple.json.JSONTypeSerializationHandler + + + + + + + + + + + +
+

Uses of Interface
de.ralleytn.simple.json.JSONTypeSerializationHandler

+
+
No usage of de.ralleytn.simple.json.JSONTypeSerializationHandler
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/class-use/JSONValue.html b/docs/de/ralleytn/simple/json/class-use/JSONValue.html new file mode 100644 index 0000000..a37bccf --- /dev/null +++ b/docs/de/ralleytn/simple/json/class-use/JSONValue.html @@ -0,0 +1,122 @@ + + + + + +Uses of Class de.ralleytn.simple.json.JSONValue + + + + + + + + + + + +
+

Uses of Class
de.ralleytn.simple.json.JSONValue

+
+
No usage of de.ralleytn.simple.json.JSONValue
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/package-frame.html b/docs/de/ralleytn/simple/json/package-frame.html new file mode 100644 index 0000000..bd39d62 --- /dev/null +++ b/docs/de/ralleytn/simple/json/package-frame.html @@ -0,0 +1,46 @@ + + + + + +de.ralleytn.simple.json + + + + + +

de.ralleytn.simple.json

+ + + diff --git a/docs/de/ralleytn/simple/json/package-summary.html b/docs/de/ralleytn/simple/json/package-summary.html new file mode 100644 index 0000000..2944f03 --- /dev/null +++ b/docs/de/ralleytn/simple/json/package-summary.html @@ -0,0 +1,271 @@ + + + + + +de.ralleytn.simple.json + + + + + + + + + + + +
+

Package de.ralleytn.simple.json

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    JSONAware +
    Beans that support customized output of JSON text shall implement this interface.
    +
    JSONContainerFactory +
    Container factory which creates containers for JSONObject and JSONArray.
    +
    JSONContentHandler +
    A simplified and stoppable SAX-like content handler for stream processing of JSON text.
    +
    JSONStreamAware +
    Beans that support customized output of JSON text to a Writer shall implement this interface.
    +
    JSONTypeSerializationHandler +
    Is needed to manage none-JSON types when serializing or deserializing objects.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    JSONArray +
    Represents a JSON array.
    +
    JSONFormatter +
    Provides static methods for formatting and minimizing JSON data.
    +
    JSONObject +
    Represents a JSON object.
    +
    JSONParser +
    Parser for JSON text.
    +
    JSONSerializer +
    Provides static methods which allow you to convert Java objects into JSONObjects + and the other way around.
    +
    JSONValue +
    Contains a few static methods for JSON values.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    JSONAttribute.Type +
    Represents the type of an attribute.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Exception Summary 
    ExceptionDescription
    JSONParseException +
    ParseException explains why and where the error occurs in source JSON text.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + +
    Annotation Types Summary 
    Annotation TypeDescription
    JSONAttribute +
    Marks a JSON attribute for serialization.
    +
    JSONRoot +
    Marks an class for serialization.
    +
    +
  • +
+
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/package-tree.html b/docs/de/ralleytn/simple/json/package-tree.html new file mode 100644 index 0000000..be55c86 --- /dev/null +++ b/docs/de/ralleytn/simple/json/package-tree.html @@ -0,0 +1,194 @@ + + + + + +de.ralleytn.simple.json Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package de.ralleytn.simple.json

+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.util.AbstractCollection<E> (implements java.util.Collection<E>) +
        +
      • java.util.AbstractList<E> (implements java.util.List<E>) +
          +
        • java.util.ArrayList<E> (implements java.lang.Cloneable, java.util.List<E>, java.util.RandomAccess, java.io.Serializable) + +
        • +
        +
      • +
      +
    • +
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>) +
        +
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable) +
          +
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>) + +
        • +
        +
      • +
      +
    • +
    • de.ralleytn.simple.json.JSONFormatter
    • +
    • de.ralleytn.simple.json.JSONParser
    • +
    • de.ralleytn.simple.json.JSONSerializer
    • +
    • de.ralleytn.simple.json.JSONValue
    • +
    • java.lang.Throwable (implements java.io.Serializable) + +
    • +
    +
  • +
+

Interface Hierarchy

+ +

Annotation Type Hierarchy

+
    +
  • de.ralleytn.simple.json.JSONRoot (implements java.lang.annotation.Annotation)
  • +
  • de.ralleytn.simple.json.JSONAttribute (implements java.lang.annotation.Annotation)
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/de/ralleytn/simple/json/package-use.html b/docs/de/ralleytn/simple/json/package-use.html new file mode 100644 index 0000000..21c8826 --- /dev/null +++ b/docs/de/ralleytn/simple/json/package-use.html @@ -0,0 +1,177 @@ + + + + + +Uses of Package de.ralleytn.simple.json + + + + + + + + + + + +
+

Uses of Package
de.ralleytn.simple.json

+
+
+ +
+ + + + + + diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html new file mode 100644 index 0000000..3de8b89 --- /dev/null +++ b/docs/deprecated-list.html @@ -0,0 +1,122 @@ + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/docs/help-doc.html b/docs/help-doc.html new file mode 100644 index 0000000..c37e079 --- /dev/null +++ b/docs/help-doc.html @@ -0,0 +1,223 @@ + + + + + +API Help + + + + + + + + + + + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    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
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    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/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field 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

    +

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

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

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

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

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ + + + + + diff --git a/docs/index-files/index-1.html b/docs/index-files/index-1.html new file mode 100644 index 0000000..cf978a5 --- /dev/null +++ b/docs/index-files/index-1.html @@ -0,0 +1,129 @@ + + + + + +C-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

C

+
+
creatArrayContainer() - Method in interface de.ralleytn.simple.json.JSONContainerFactory
+
 
+
createObjectContainer() - Method in interface de.ralleytn.simple.json.JSONContainerFactory
+
 
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-10.html b/docs/index-files/index-10.html new file mode 100644 index 0000000..4b628d8 --- /dev/null +++ b/docs/index-files/index-10.html @@ -0,0 +1,155 @@ + + + + + +S-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

S

+
+
serialize(Object) - Static method in class de.ralleytn.simple.json.JSONSerializer
+
+
Converts a Java object into a JSONObject.
+
+
serialize(Class<?>, Object) - Method in interface de.ralleytn.simple.json.JSONTypeSerializationHandler
+
+
Is called when an object is being serialized and a none-JSON type is reached.
+
+
setErrorType(int) - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
setPosition(int) - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
setUnexpectedObject(Object) - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
startArray() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a JSON array begins.
+
+
startJSON() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when the JSON processing begins.
+
+
startObject() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a JSON object begins.
+
+
startObjectEntry(String) - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a JSON object entry begins.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-11.html b/docs/index-files/index-11.html new file mode 100644 index 0000000..313d971 --- /dev/null +++ b/docs/index-files/index-11.html @@ -0,0 +1,223 @@ + + + + + +T-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

T

+
+
toArrayArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of JSONArrays using the getArray(int) method.
+
+
toBooleanArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Booleans using the getBoolean(int) method.
+
+
toByteArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Bytes using the getByte(int) method.
+
+
toDoubleArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Doubles using the getDouble(int) method.
+
+
toFloatArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Floats using the getFloat(int) method.
+
+
toIntegerArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Integers using the getInteger(int) method.
+
+
toJSONString(Collection<?>) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert a Collection to JSON text.
+
+
toJSONString(byte[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(short[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(int[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(long[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(float[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(double[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(boolean[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(char[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString(T[]) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Convert an array to JSON text.
+
+
toJSONString() - Method in class de.ralleytn.simple.json.JSONArray
+
 
+
toJSONString() - Method in interface de.ralleytn.simple.json.JSONAware
+
 
+
toJSONString(Map<?, ?>) - Static method in class de.ralleytn.simple.json.JSONObject
+
+
Convert a Map to JSON text.
+
+
toJSONString() - Method in class de.ralleytn.simple.json.JSONObject
+
 
+
toJSONString(Object) - Static method in class de.ralleytn.simple.json.JSONValue
+
+
Convert an Object to JSON text.
+
+
toLongArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Longs using the getLong(int) method.
+
+
toObjectArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of JSONObjects using the getObject(int) method.
+
+
toShortArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Shorts using the getShort(int) method.
+
+
toString() - Method in class de.ralleytn.simple.json.JSONArray
+
 
+
toString() - Method in class de.ralleytn.simple.json.JSONObject
+
 
+
toStringArray() - Method in class de.ralleytn.simple.json.JSONArray
+
+
Converts this JSONArray into an array of Strings using the getString(int) method.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html new file mode 100644 index 0000000..36d645b --- /dev/null +++ b/docs/index-files/index-12.html @@ -0,0 +1,134 @@ + + + + + +V-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

V

+
+
valueOf(String) - Static method in enum de.ralleytn.simple.json.JSONAttribute.Type
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum de.ralleytn.simple.json.JSONAttribute.Type
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-13.html b/docs/index-files/index-13.html new file mode 100644 index 0000000..7244cb1 --- /dev/null +++ b/docs/index-files/index-13.html @@ -0,0 +1,181 @@ + + + + + +W-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

W

+
+
writeJSONString(Collection<?>, Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode a Collection into JSON text and write it to a Writer.
+
+
writeJSONString(Writer) - Method in class de.ralleytn.simple.json.JSONArray
+
 
+
writeJSONString(byte[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(short[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(int[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(long[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(float[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(double[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(boolean[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(char[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(T[], Writer) - Static method in class de.ralleytn.simple.json.JSONArray
+
+
Encode an array into JSON text and write it to a Writer.
+
+
writeJSONString(Map<?, ?>, Writer) - Static method in class de.ralleytn.simple.json.JSONObject
+
+
Encode a Map into JSON text and write it to out.
+
+
writeJSONString(Writer) - Method in class de.ralleytn.simple.json.JSONObject
+
 
+
writeJSONString(Writer) - Method in interface de.ralleytn.simple.json.JSONStreamAware
+
+
Writes a JSON encoded string on a Writer.
+
+
writeJSONString(Object, Writer) - Static method in class de.ralleytn.simple.json.JSONValue
+
+
Encode an Object into JSON text and write it to a Writer.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-2.html b/docs/index-files/index-2.html new file mode 100644 index 0000000..01cd156 --- /dev/null +++ b/docs/index-files/index-2.html @@ -0,0 +1,135 @@ + + + + + +D-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

D

+
+
de.ralleytn.simple.json - package de.ralleytn.simple.json
+
 
+
deserialize(JSONObject, Object) - Static method in class de.ralleytn.simple.json.JSONSerializer
+
+
Transfers the data of JSONObject into a Java object.
+
+
deserialize(Class<?>, Object) - Method in interface de.ralleytn.simple.json.JSONTypeSerializationHandler
+
+
Is called when the needed type is a none-JSON type.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html new file mode 100644 index 0000000..86b110c --- /dev/null +++ b/docs/index-files/index-3.html @@ -0,0 +1,151 @@ + + + + + +E-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

E

+
+
endArray() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a JSON array ends.
+
+
endJSON() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when the JSON processing ends.
+
+
endObject() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a JSON object ends.
+
+
endObjectEntry() - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a JSON entry ends.
+
+
ERROR_UNEXPECTED_CHAR - Static variable in exception de.ralleytn.simple.json.JSONParseException
+
 
+
ERROR_UNEXPECTED_EXCEPTION - Static variable in exception de.ralleytn.simple.json.JSONParseException
+
 
+
ERROR_UNEXPECTED_TOKEN - Static variable in exception de.ralleytn.simple.json.JSONParseException
+
 
+
escape(String) - Static method in class de.ralleytn.simple.json.JSONValue
+
+
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-4.html b/docs/index-files/index-4.html new file mode 100644 index 0000000..faaae9b --- /dev/null +++ b/docs/index-files/index-4.html @@ -0,0 +1,149 @@ + + + + + +F-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

F

+
+
format(Reader, Writer) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+ +
+
format(Reader, Writer, int) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+ +
+
format(Reader, Writer, int, boolean, boolean) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+
Reads the JSON data from the Reader, formats it according to the parameters and writes it on the Writer.
+
+
format(String) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+ +
+
format(String, int) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+ +
+
format(String, int, boolean, boolean) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+
Formats JSON data according to the parameters with which this method was called.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-5.html b/docs/index-files/index-5.html new file mode 100644 index 0000000..3ed7acb --- /dev/null +++ b/docs/index-files/index-5.html @@ -0,0 +1,233 @@ + + + + + +G-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

G

+
+
getArray(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value already is a JSONArray, it will be casted and returned.
+
+
getArray(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value already is a JSONArray, it will be casted and returned.
+
+
getBoolean(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is already a Boolean, it will be casted and returned.
+
+
getBoolean(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is already a Boolean, it will be casted and returned.
+
+
getByte(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a Number, its byte value is returned.
+
+
getByte(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a Number, its byte value is returned.
+
+
getDate(int, DateFormat) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value already is a Date, it will be casted and returned.
+
+
getDate(String, DateFormat) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value already is a Date, it will be casted and returned.
+
+
getDouble(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a Number, its double value is returned.
+
+
getDouble(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a Number, its double value is returned.
+
+
getEnum(int, Class<T>) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the String representation of the value equals the name of the enum constant + in the given enum type, it will return the enum constant.
+
+
getEnum(String, Class<T>) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the String representation of the value equals the name of the enum constant + in the given enum type, it will return the enum constant.
+
+
getErrorType() - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
getFloat(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a Number, its float value is returned.
+
+
getFloat(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a Number, its float value is returned.
+
+
getInteger(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a Number, its int value is returned.
+
+
getInteger(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a Number, its int value is returned.
+
+
getLong(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a Number, its long value is returned.
+
+
getLong(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a Number, its long value is returned.
+
+
getMessage() - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
getObject(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a JSONObject already, it will be casted and returned.
+
+
getObject(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a JSONObject already, it will be casted and returned.
+
+
getPosition() - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
getPosition() - Method in class de.ralleytn.simple.json.JSONParser
+
 
+
getShort(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
If the value is a Number, its short value is returned.
+
+
getShort(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
If the value is a Number, its short value is returned.
+
+
getString(int) - Method in class de.ralleytn.simple.json.JSONArray
+
+
Returns the same as the value's Object.toString() method.
+
+
getString(String) - Method in class de.ralleytn.simple.json.JSONObject
+
+
Returns the same as the value's Object.toString() method.
+
+
getUnexpectedObject() - Method in exception de.ralleytn.simple.json.JSONParseException
+
 
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-6.html b/docs/index-files/index-6.html new file mode 100644 index 0000000..4b4eb43 --- /dev/null +++ b/docs/index-files/index-6.html @@ -0,0 +1,267 @@ + + + + + +J-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

J

+
+
JSONArray - Class in de.ralleytn.simple.json
+
+
Represents a JSON array.
+
+
JSONArray() - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs an empty JSONArray.
+
+
JSONArray(Collection<?>) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified + Collection, in the order they are returned by the Collection's Iterator.
+
+
JSONArray(T[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(byte[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(boolean[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(char[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(short[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(int[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(long[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(float[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(double[]) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(Object) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray containing the elements of the specified array.
+
+
JSONArray(String) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray from JSON data.
+
+
JSONArray(Reader) - Constructor for class de.ralleytn.simple.json.JSONArray
+
+
Constructs a JSONArray from JSON data read from a Reader.
+
+
JSONAttribute - Annotation Type in de.ralleytn.simple.json
+
+
Marks a JSON attribute for serialization.
+
+
JSONAttribute.Type - Enum in de.ralleytn.simple.json
+
+
Represents the type of an attribute.
+
+
JSONAware - Interface in de.ralleytn.simple.json
+
+
Beans that support customized output of JSON text shall implement this interface.
+
+
JSONContainerFactory - Interface in de.ralleytn.simple.json
+
+
Container factory which creates containers for JSONObject and JSONArray.
+
+
JSONContentHandler - Interface in de.ralleytn.simple.json
+
+
A simplified and stoppable SAX-like content handler for stream processing of JSON text.
+
+
JSONFormatter - Class in de.ralleytn.simple.json
+
+
Provides static methods for formatting and minimizing JSON data.
+
+
JSONObject - Class in de.ralleytn.simple.json
+
+
Represents a JSON object.
+
+
JSONObject() - Constructor for class de.ralleytn.simple.json.JSONObject
+
+
Constructs an empty JSONObject
+
+
JSONObject(Map<?, ?>) - Constructor for class de.ralleytn.simple.json.JSONObject
+
+
Allows creation of a JSONObject from a Map.
+
+
JSONObject(String) - Constructor for class de.ralleytn.simple.json.JSONObject
+
+
Constructs a JSONObject from JSON data.
+
+
JSONObject(Reader) - Constructor for class de.ralleytn.simple.json.JSONObject
+
+
Constructs a JSONObject from JSON data read from a Reader.
+
+
JSONParseException - Exception in de.ralleytn.simple.json
+
+
ParseException explains why and where the error occurs in source JSON text.
+
+
JSONParseException(int) - Constructor for exception de.ralleytn.simple.json.JSONParseException
+
 
+
JSONParseException(int, Object) - Constructor for exception de.ralleytn.simple.json.JSONParseException
+
 
+
JSONParseException(int, int, Object) - Constructor for exception de.ralleytn.simple.json.JSONParseException
+
 
+
JSONParser - Class in de.ralleytn.simple.json
+
+
Parser for JSON text.
+
+
JSONParser() - Constructor for class de.ralleytn.simple.json.JSONParser
+
 
+
JSONRoot - Annotation Type in de.ralleytn.simple.json
+
+
Marks an class for serialization.
+
+
JSONSerializer - Class in de.ralleytn.simple.json
+
+
Provides static methods which allow you to convert Java objects into JSONObjects + and the other way around.
+
+
JSONStreamAware - Interface in de.ralleytn.simple.json
+
+
Beans that support customized output of JSON text to a Writer shall implement this interface.
+
+
JSONTypeSerializationHandler - Interface in de.ralleytn.simple.json
+
+
Is needed to manage none-JSON types when serializing or deserializing objects.
+
+
JSONValue - Class in de.ralleytn.simple.json
+
+
Contains a few static methods for JSON values.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-7.html b/docs/index-files/index-7.html new file mode 100644 index 0000000..0bb3421 --- /dev/null +++ b/docs/index-files/index-7.html @@ -0,0 +1,133 @@ + + + + + +M-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

M

+
+
minimize(Reader, Writer) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+
Minimizes formatted JSON data to the bare minimum of what it needs to be valid.
+
+
minimize(String) - Static method in class de.ralleytn.simple.json.JSONFormatter
+
+
Minimizes formatted JSON data to the bare minimum of what it needs to be valid.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-8.html b/docs/index-files/index-8.html new file mode 100644 index 0000000..f36990c --- /dev/null +++ b/docs/index-files/index-8.html @@ -0,0 +1,167 @@ + + + + + +P-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

P

+
+
parse(String) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Parses JSON data.
+
+
parse(String, JSONContainerFactory) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Parses JSON data using a custom JSONContainerFactory.
+
+
parse(Reader) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Parses JSON data.
+
+
parse(Reader, JSONContainerFactory) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Parses JSON data using a custom JSONContainerFactory.
+
+
parse(String, JSONContentHandler) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Goes over JSON data step by step using a JSONContentHandler.
+
+
parse(String, JSONContentHandler, boolean) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Goes over JSON data step by step using a JSONContentHandler.
+
+
parse(Reader, JSONContentHandler) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Goes over JSON data step by step using a JSONContentHandler.
+
+
parse(Reader, JSONContentHandler, boolean) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Goes over JSON data step by step using a JSONContentHandler.
+
+
primitive(Object) - Method in interface de.ralleytn.simple.json.JSONContentHandler
+
+
Receives a notification when a primitive JSON value is reached: + + String + Number + Boolean + null +
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index-files/index-9.html b/docs/index-files/index-9.html new file mode 100644 index 0000000..e94147f --- /dev/null +++ b/docs/index-files/index-9.html @@ -0,0 +1,133 @@ + + + + + +R-Index + + + + + + + + +
+ + + + + + + +
+ + +
C D E F G J M P R S T V W  + + +

R

+
+
reset() - Method in class de.ralleytn.simple.json.JSONParser
+
+
Resets the parser to the initial state without resetting the underlying reader.
+
+
reset(Reader) - Method in class de.ralleytn.simple.json.JSONParser
+
+
Resets the parser to the initial state with a new character reader.
+
+
+C D E F G J M P R S T V W 
+ +
+ + + + + + + +
+ + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..603c789 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,72 @@ + + + + + +Generated Documentation (Untitled) + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="de/ralleytn/simple/json/package-summary.html">Non-frame version</a>.</p> + + + diff --git a/docs/overview-tree.html b/docs/overview-tree.html new file mode 100644 index 0000000..9cdc230 --- /dev/null +++ b/docs/overview-tree.html @@ -0,0 +1,198 @@ + + + + + +Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.util.AbstractCollection<E> (implements java.util.Collection<E>) +
        +
      • java.util.AbstractList<E> (implements java.util.List<E>) +
          +
        • java.util.ArrayList<E> (implements java.lang.Cloneable, java.util.List<E>, java.util.RandomAccess, java.io.Serializable) + +
        • +
        +
      • +
      +
    • +
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>) +
        +
      • java.util.HashMap<K,V> (implements java.lang.Cloneable, java.util.Map<K,V>, java.io.Serializable) +
          +
        • java.util.LinkedHashMap<K,V> (implements java.util.Map<K,V>) + +
        • +
        +
      • +
      +
    • +
    • de.ralleytn.simple.json.JSONFormatter
    • +
    • de.ralleytn.simple.json.JSONParser
    • +
    • de.ralleytn.simple.json.JSONSerializer
    • +
    • de.ralleytn.simple.json.JSONValue
    • +
    • java.lang.Throwable (implements java.io.Serializable) + +
    • +
    +
  • +
+

Interface Hierarchy

+ +

Annotation Type Hierarchy

+
    +
  • de.ralleytn.simple.json.JSONRoot (implements java.lang.annotation.Annotation)
  • +
  • de.ralleytn.simple.json.JSONAttribute (implements java.lang.annotation.Annotation)
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/package-list b/docs/package-list new file mode 100644 index 0000000..979f58d --- /dev/null +++ b/docs/package-list @@ -0,0 +1 @@ +de.ralleytn.simple.json diff --git a/docs/script.js b/docs/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/docs/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/docs/serialized-form.html b/docs/serialized-form.html new file mode 100644 index 0000000..c640da5 --- /dev/null +++ b/docs/serialized-form.html @@ -0,0 +1,176 @@ + + + + + +Serialized Form + + + + + + + + + + + +
+

Serialized Form

+
+
+
    +
  • +

    Package de.ralleytn.simple.json

    +
      +
    • + + +

      Class de.ralleytn.simple.json.JSONArray extends java.util.ArrayList<java.lang.Object> implements Serializable

      +
      +
      serialVersionUID:
      +
      3957988303675231981L
      +
      +
    • +
    • + + +

      Class de.ralleytn.simple.json.JSONObject extends java.util.LinkedHashMap<java.lang.Object,java.lang.Object> implements Serializable

      +
      +
      serialVersionUID:
      +
      -503443796854799292L
      +
      +
    • +
    • + + +

      Class de.ralleytn.simple.json.JSONParseException extends java.lang.Exception implements Serializable

      +
      +
      serialVersionUID:
      +
      -7880698968187728547L
      +
      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          errorType

          +
          int errorType
          +
        • +
        • +

          unexpectedObject

          +
          java.lang.Object unexpectedObject
          +
        • +
        • +

          position

          +
          int position
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/docs/stylesheet.css b/docs/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/docs/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/src/de/ralleytn/simple/json/JSONArray.java b/src/de/ralleytn/simple/json/JSONArray.java index 9de1cc3..eb61a75 100644 --- a/src/de/ralleytn/simple/json/JSONArray.java +++ b/src/de/ralleytn/simple/json/JSONArray.java @@ -214,6 +214,7 @@ import java.util.Collection; import java.util.Date; import java.util.Iterator; +import java.util.Map; /** * Represents a JSON array. @@ -246,6 +247,7 @@ public JSONArray(Collection collection){ /** * Constructs a {@linkplain JSONArray} containing the elements of the specified array. * @param array the array whose elements are to be placed into this {@linkplain JSONArray} + * @param the generic type of the given array * @since 1.0.0 */ public JSONArray(T[] array) { @@ -405,6 +407,7 @@ public JSONArray(Reader jsonReader) throws JSONParseException, IOException { * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param collection the {@linkplain Collection} which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(Collection collection, Writer writer) throws IOException { @@ -457,6 +460,7 @@ public void writeJSONString(Writer writer) throws IOException { * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(byte[] array, Writer writer) throws IOException { @@ -489,6 +493,7 @@ public static final void writeJSONString(byte[] array, Writer writer) throws IOE * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(short[] array, Writer writer) throws IOException { @@ -521,6 +526,7 @@ public static final void writeJSONString(short[] array, Writer writer) throws IO * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(int[] array, Writer writer) throws IOException { @@ -553,6 +559,7 @@ public static final void writeJSONString(int[] array, Writer writer) throws IOEx * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(long[] array, Writer writer) throws IOException { @@ -585,6 +592,7 @@ public static final void writeJSONString(long[] array, Writer writer) throws IOE * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(float[] array, Writer writer) throws IOException { @@ -617,6 +625,7 @@ public static final void writeJSONString(float[] array, Writer writer) throws IO * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(double[] array, Writer writer) throws IOException { @@ -649,6 +658,7 @@ public static final void writeJSONString(double[] array, Writer writer) throws I * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(boolean[] array, Writer writer) throws IOException { @@ -681,6 +691,7 @@ public static final void writeJSONString(boolean[] array, Writer writer) throws * @see de.ralleytn.simple.json.JSONValue#writeJSONString(Object, Writer) * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(char[] array, Writer writer) throws IOException { @@ -714,6 +725,7 @@ public static final void writeJSONString(char[] array, Writer writer) throws IOE * @param array the array which should be written on the {@linkplain Writer} * @param writer the {@linkplain Writer} to write to * @param type of the array + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public static final void writeJSONString(T[] array, Writer writer) throws IOException { @@ -960,7 +972,7 @@ public String toString() { } /** - * If the value is a {@linkplain JSONobject} already, it will be casted and returned. + * If the value is a {@linkplain JSONObject} already, it will be casted and returned. * If the value is a {@linkplain Map}, it will be wrapped in a {@linkplain JSONObject}. The wrapped {@linkplain Map} will be returned. * In any other case this method returns {@code null}. * @param index index of the value @@ -1118,6 +1130,7 @@ public Date getDate(int index, DateFormat format) throws ParseException { * In any other case this method returns {@code null}. * @param index index of the value * @param type the enum type + * @param the return type * @return an {@linkplain Enum} or {@code null} * @since 1.0.0 */ diff --git a/src/de/ralleytn/simple/json/JSONContainerFactory.java b/src/de/ralleytn/simple/json/JSONContainerFactory.java index 96b8b21..2a0bf53 100644 --- a/src/de/ralleytn/simple/json/JSONContainerFactory.java +++ b/src/de/ralleytn/simple/json/JSONContainerFactory.java @@ -208,7 +208,7 @@ /** * Container factory which creates containers for {@linkplain JSONObject} and {@linkplain JSONArray}. - * @see de.ralleytn.simple.json.JSONParser#parse(java.io.Reader, ContainerFactory) + * @see JSONParser#parse(java.io.Reader, JSONContainerFactory) * @author FangYidong(fangyidong@yahoo.com.cn) * @author Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de) * @version 1.0.0 diff --git a/src/de/ralleytn/simple/json/JSONObject.java b/src/de/ralleytn/simple/json/JSONObject.java index 8309e0f..e42bc8b 100644 --- a/src/de/ralleytn/simple/json/JSONObject.java +++ b/src/de/ralleytn/simple/json/JSONObject.java @@ -352,7 +352,7 @@ public String toString() { } /** - * If the value is a {@linkplain JSONobject} already, it will be casted and returned. + * If the value is a {@linkplain JSONObject} already, it will be casted and returned. * If the value is a {@linkplain Map}, it will be wrapped in a {@linkplain JSONObject}. The wrapped {@linkplain Map} will be returned. * In any other case this method returns {@code null}. * @param key key of the value @@ -510,6 +510,7 @@ public Date getDate(String key, DateFormat format) throws ParseException { * In any other case this method returns {@code null}. * @param key key of the value * @param type the enum type + * @param the generic return type * @return an {@linkplain Enum} or {@code null} * @since 1.0.0 */ diff --git a/src/de/ralleytn/simple/json/JSONParser.java b/src/de/ralleytn/simple/json/JSONParser.java index 0fc09f9..30a1a3d 100644 --- a/src/de/ralleytn/simple/json/JSONParser.java +++ b/src/de/ralleytn/simple/json/JSONParser.java @@ -248,8 +248,6 @@ public void reset(){ /** * Resets the parser to the initial state with a new character reader. * @param reader the new character reader. - * @throws IOException - * @throws JSONParseException * @since 1.0.0 */ public void reset(Reader reader) { @@ -268,30 +266,46 @@ public int getPosition() { } /** - * - * @param string - * @return - * @throws JSONParseException + * Parses JSON data. + * @param string text with the JSON data + * @return An instance of: + *
    + *
  • {@linkplain JSONObject}
  • + *
  • {@linkplain JSONArray}
  • + *
  • {@linkplain String}
  • + *
  • {@linkplain Number}
  • + *
  • {@linkplain Boolean}
  • + *
  • {@code null}
  • + *
+ * @throws JSONParseException if the JSON data is invalid * @since 1.0.0 */ public Object parse(String string) throws JSONParseException { - return parse(string, (JSONContainerFactory)null); + return parse(string != null ? string.trim() : null, (JSONContainerFactory)null); } /** - * - * @param string - * @param containerFactory - * @return - * @throws JSONParseException + * Parses JSON data using a custom {@linkplain JSONContainerFactory}. + * @param string text with the JSON data + * @param containerFactory the custom {@linkplain JSONContainerFactory} + * @return An instance of: + *
    + *
  • {@linkplain JSONObject}
  • + *
  • {@linkplain JSONArray}
  • + *
  • {@linkplain String}
  • + *
  • {@linkplain Number}
  • + *
  • {@linkplain Boolean}
  • + *
  • {@code null}
  • + *
+ * @throws JSONParseException if the JSON data is invalid * @since 1.0.0 */ public Object parse(String string, JSONContainerFactory containerFactory) throws JSONParseException { - try(StringReader in = new StringReader(string)) { + try(StringReader reader = new StringReader(string != null ? string.trim() : null)) { - return this.parse(in, containerFactory); + return this.parse(reader, containerFactory); } catch(IOException exception){ @@ -300,33 +314,42 @@ public Object parse(String string, JSONContainerFactory containerFactory) throws } /** - * - * @param in - * @return - * @throws IOException - * @throws JSONParseException + * Parses JSON data. + * @param reader the {@linkplain Reader} from which the JSON data comes + * @return An instance of: + *
    + *
  • {@linkplain JSONObject}
  • + *
  • {@linkplain JSONArray}
  • + *
  • {@linkplain String}
  • + *
  • {@linkplain Number}
  • + *
  • {@linkplain Boolean}
  • + *
  • {@code null}
  • + *
+ * @throws IOException if an I/O error occurs + * @throws JSONParseException if the JSON data is invalid * @since 1.0.0 */ - public Object parse(Reader in) throws IOException, JSONParseException { + public Object parse(Reader reader) throws IOException, JSONParseException { - return this.parse(in, (JSONContainerFactory)null); + return this.parse(reader, (JSONContainerFactory)null); } /** - * Parse JSON text into java object from the input source. - * - * @param reader - * @param containerFactory - Use this factory to create your own JSON object and JSON array containers. - * @return Instance of the following: - * org.json.simple.JSONObject, - * org.json.simple.JSONArray, - * java.lang.String, - * java.lang.Number, - * java.lang.Boolean, - * null - * - * @throws IOException - * @throws JSONParseException + * Parses JSON data using a custom {@linkplain JSONContainerFactory}. + * @param reader the {@linkplain Reader} from which the JSON data comes + * @param containerFactory the custom {@linkplain JSONContainerFactory} + * @return An instance of: + *
    + *
  • {@linkplain JSONObject}
  • + *
  • {@linkplain JSONArray}
  • + *
  • {@linkplain String}
  • + *
  • {@linkplain Number}
  • + *
  • {@linkplain Boolean}
  • + *
  • {@code null}
  • + *
+ * @throws IOException if an I/O error occurs + * @throws JSONParseException if the JSON data is invalid + * @since 1.0.0 */ @SuppressWarnings("unchecked") public Object parse(Reader reader, JSONContainerFactory containerFactory) throws IOException, JSONParseException { @@ -552,28 +575,28 @@ private final List createArrayContainer(JSONContainerFactory containerFa } /** - * - * @param string - * @param contentHandler - * @throws JSONParseException + * Goes over JSON data step by step using a {@linkplain JSONContentHandler}. + * @param string text with the JSON data + * @param contentHandler the {@linkplain JSONContentHandler} + * @throws JSONParseException if the JSON data is invalid or the {@linkplain JSONContentHandler} throws it * @since 1.0.0 */ public void parse(String string, JSONContentHandler contentHandler) throws JSONParseException { - this.parse(string, contentHandler, false); + this.parse(string != null ? string.trim() : null, contentHandler, false); } /** - * - * @param string - * @param contentHandler - * @param resume - * @throws JSONParseException + * Goes over JSON data step by step using a {@linkplain JSONContentHandler}. + * @param string text with the JSON data + * @param contentHandler the {@linkplain JSONContentHandler} + * @param resume Indicates if it continues previous parsing operation. If set to {@code true}, resume parsing the old stream, and parameter {@code reader} will be ignored. If this method is called for the first time in this instance, {@code resume} will be ignored. + * @throws JSONParseException if the JSON data is invalid or the {@linkplain JSONContentHandler} throws it * @since 1.0.0 */ public void parse(String string, JSONContentHandler contentHandler, boolean resume) throws JSONParseException { - try(StringReader reader = new StringReader(string)) { + try(StringReader reader = new StringReader(string != null ? string.trim() : null)) { this.parse(reader, contentHandler, resume); @@ -584,11 +607,11 @@ public void parse(String string, JSONContentHandler contentHandler, boolean resu } /** - * - * @param reader - * @param contentHandler - * @throws IOException - * @throws JSONParseException + * Goes over JSON data step by step using a {@linkplain JSONContentHandler}. + * @param reader the {@linkplain Reader} containing the JSON data + * @param contentHandler the {@linkplain JSONContentHandler} + * @throws IOException if an I/O error occurs or the {@linkplain JSONContentHandler} throws it + * @throws JSONParseException if the JSON data is invalid or the {@linkplain JSONContentHandler} throws it * @since 1.0.0 */ public void parse(Reader reader, JSONContentHandler contentHandler) throws IOException, JSONParseException { @@ -597,31 +620,26 @@ public void parse(Reader reader, JSONContentHandler contentHandler) throws IOExc } /** - * Stream processing of JSON text. - * + * Goes over JSON data step by step using a {@linkplain JSONContentHandler}. * @see JSONContentHandler - * - * @param in - * @param contentHandler - * @param resume - Indicates if it continues previous parsing operation. - * If set to true, resume parsing the old stream, and parameter 'in' will be ignored. - * If this method is called for the first time in this instance, isResume will be ignored. - * - * @throws IOException - * @throws JSONParseException + * @param reader the {@linkplain Reader} containing the JSON data + * @param contentHandler the {@linkplain JSONContentHandler} + * @param resume Indicates if it continues previous parsing operation. If set to {@code true}, resume parsing the old stream, and parameter {@code reader} will be ignored. If this method is called for the first time in this instance, {@code resume} will be ignored. + * @throws IOException if an I/O error occurs or the {@linkplain JSONContentHandler} throws it + * @throws JSONParseException if the JSON data is invalid or the {@linkplain JSONContentHandler} throws it * @since 1.0.0 */ - public void parse(Reader in, JSONContentHandler contentHandler, boolean resume) throws IOException, JSONParseException { + public void parse(Reader reader, JSONContentHandler contentHandler, boolean resume) throws IOException, JSONParseException { if(!resume) { - this.reset(in); + this.reset(reader); this.handlerStatusStack = new Stack<>(); } else if(this.handlerStatusStack == null) { resume = false; - this.reset(in); + this.reset(reader); this.handlerStatusStack = new Stack<>(); } diff --git a/src/de/ralleytn/simple/json/JSONStreamAware.java b/src/de/ralleytn/simple/json/JSONStreamAware.java index ca260bb..aeb9672 100644 --- a/src/de/ralleytn/simple/json/JSONStreamAware.java +++ b/src/de/ralleytn/simple/json/JSONStreamAware.java @@ -216,7 +216,8 @@ public interface JSONStreamAware { /** * Writes a JSON encoded string on a {@linkplain Writer}. - * @param the {@linkplain Writer} to write on + * @param writer the {@linkplain Writer} to write on + * @throws IOException if an I/O error occurs * @since 1.0.0 */ public void writeJSONString(Writer writer) throws IOException;