public interface JsonFactory
Modifier and Type | Method and Description |
---|---|
JsonBoolean |
create(boolean bool)
Create a JsonBoolean from a Java boolean.
|
JsonNumber |
create(double number)
Create a JsonNumber from a Java double.
|
JsonString |
create(String string)
Create a JsonString from a Java String.
|
JsonArray |
createArray()
Create an empty JsonArray.
|
JsonNull |
createNull()
Create a JsonNull.
|
JsonObject |
createObject()
Create an empty JsonObject.
|
<T extends JsonValue> |
parse(String jsonString)
Parse a String in JSON format and return a JsonValue of the appropriate
type.
|
JsonString create(String string)
string
- a Java StringJsonNumber create(double number)
number
- a Java doubleJsonBoolean create(boolean bool)
bool
- a Java booleanJsonArray createArray()
JsonNull createNull()
JsonObject createObject()
<T extends JsonValue> T parse(String jsonString) throws JsonException
jsonString
- a String in JSON formatJsonException
Copyright © 2016. All rights reserved.