diff --git a/README.md b/README.md index ae3b8f3..cf6e5b4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ### Java 7+/Android JSON parser/generator, MIT (c) 2020-2024 miktim@mail.ru - **Release notes:** \- Java SE 7+/Android RFC 8259 compliant package @@ -19,8 +18,8 @@ The class contains static methods for parsing/generating text in JSON format. \- in addition to listed types, the generator converts Java Lists to JSON arrays and Java Maps to JSON objects. The null key is converted to a "null" member name. Other Java objects are converted to string representation. -
- Methods: +
+ Methods:
**static Object fromJSON(String jsonText) throws IOException, ParseException** @@ -51,12 +50,11 @@ Methods for converting objects supported by JSON to a Java primitive or an array **static <T\> T cast(Object obj, T sample) throws ClassCastException** Cast Java object by sample -**static <T\> T cast(Object obj, Class- Constructors: +
+ Constructors:
**Json(Object... members) throws IndexOutOfBoundsException** @@ -85,8 +83,8 @@ Create Json object from String **Json(InputStream inStream) throws IOException, ParseException** Create Json object from UTF-8 encoded stream. -- Methods: +
+ Methods:
**String[ ] listNames()** @@ -111,23 +109,28 @@ inherited Returns null, value or array element **Json getJson(String memberName, int... indices) throws ClassCastException, IndexOutOfBoundsException** +Cast member or array element to Json object **String getString(String memberName, int... indices) throws ClassCastException, IndexOutOfBoundsException** - +Cast member or array element to String + **Number getNumber(String memberName, int... indices) throws ClassCastException, IndexOutOfBoundsException** +Cast member or array element to Number **Boolean getBoolean(String memberName, int... indices) throws ClassCastException, IndexOutOfBoundsException** - +Cast member or array element to Boolean + **Object[ ] getArray(String memberName, int... indices) throws ClassCastException, IndexOutOfBoundsException** +Cast member or array element to Object array **<T\> T castMember(T sample, String memberName, int... indices) throws ClassCastException, IndexOutOfBoundsException** -Casting Json member value or array element by sample +Casting Json member value or array element by sample. See notes for a JSON.cast methods -**<T\> T castMember(Class- Constants: +
+ Constants:
**protected static final transient Object IGNORED** Returned from the replacer/reviver methods to skip the field -- Methods: +
+ Methods:
**Json toJson() throws IllegalArgumentException, IllegalAccessException;** @@ -182,16 +186,13 @@ Applies on unloading: **protected Object reviver(String name, Object value);** Applies on loading: -\- name is object field class and name delimited with dot (.), value is Json-supported object -\- first call with the target object class name and Json object as value +\- name is object field class and name delimited with dot (.), value is Json-supported object; +\- first call with the target object class name and the Json object as value; \- returns a value that is compatible with the object field or IGNORED **protected <T> T getTarget( );** Get target object. Accessible from replacer/reviver - **String toString( );** Overridden. Generate JSON text as a single line