@Interface public abstract class JSON extends Object
constructor, prototype
Constructor and Description |
---|
JSON() |
Modifier and Type | Method and Description |
---|---|
static String |
$getStatic(Symbol toStringTag) |
static Object |
parse(String text)
Converts a JavaScript Object Notation (JSON) string into an object.
|
static Object |
parse(String text,
BiFunction<Object,Object,Object> reviver)
Converts a JavaScript Object Notation (JSON) string into an object.
|
static String |
stringify(Object value)
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
static String |
stringify(Object value,
BiFunction<String,Object,Object> replacer)
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
static String |
stringify(Object value,
BiFunction<String,Object,Object> replacer,
Object space)
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
static String |
stringify(Object value,
Object[] replacer)
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
static String |
stringify(Object value,
Object[] replacer,
Object space)
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
$applyStatic, $applyStatic, $delete, $delete, $get, $get, $set, $set, $super, assign, create, create, defineProperties, defineProperty, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, hasOwnProperty, hasOwnProperty, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, propertyIsEnumerable, propertyIsEnumerable, seal, toJSString, toLocaleString, toString, valueOf
public static Object parse(String text, BiFunction<Object,Object,Object> reviver)
text
- A valid JSON string.reviver
- A function that transforms the results. This function is called for each member of the object.
If a member contains nested objects, the nested objects are transformed before the parent object is.public static String stringify(Object value)
value
- A JavaScript value, usually an object or array, to be converted.public static String stringify(Object value, BiFunction<String,Object,Object> replacer)
value
- A JavaScript value, usually an object or array, to be converted.replacer
- A function that transforms the results.public static String stringify(Object value, Object[] replacer)
value
- A JavaScript value, usually an object or array, to be converted.replacer
- Array that transforms the results.public static String stringify(Object value, BiFunction<String,Object,Object> replacer, Object space)
value
- A JavaScript value, usually an object or array, to be converted.replacer
- A function that transforms the results.space
- Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.public static String stringify(Object value, Object[] replacer, Object space)
value
- A JavaScript value, usually an object or array, to be converted.replacer
- Array that transforms the results.space
- Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.public static Object parse(String text)
text
- A valid JSON string.reviver
- A function that transforms the results. This function is called for each member of the object.
If a member contains nested objects, the nested objects are transformed before the parent object is.