JsonObject
Represents JSON object.
| To parse string into JsonObject use JsonParse. |
Instance methods
- get(key) ⇒ ?
-
Returns attribute value by the key. Value type depends on the type used in JSON.
Table 1. Parameters key
String
Attribute key
ReturnAttribute value
- keys(): Array
-
Returns attribute array
ReturnAttribute array
- serialize(): String
-
Returns string with serialized JSON
ReturnString with JSON
- set(key, value): void
-
Sets attribute referenced by key to the given value.
Table 2. Parameters key
String
Attribute key
value
String
Attribute new value
- setBoolean(key, value): void
-
Sets a boolean value at the specified key. The value is converted to boolean.
Table 3. Parameters key
String
Attribute key
value
any
Value to convert to boolean
- setNull(key): void
-
Sets a JSON null value at the specified key.
Table 4. Parameters key
String
Attribute key
- setString(key, value): void
-
Sets a string value at the specified key. The value is converted to string.
Table 5. Parameters key
String
Attribute key
value
any
Value to convert to string