Modifier and Type | Method and Description |
---|---|
static void |
checkJsonCompatibility(String trail,
Object value)
Verify that the given parameter object is of a JSON compatible type (recursively).
|
static Object |
readJson(Reader reader)
Parses to json the provided reader.
|
static Object |
readJson(String rawData)
Parses to json the provided data.
|
static Object |
readJsonLenient(InputStream in)
This function it's only used to read our configuration files and allows
JSON files to contain non strict JSON such as comments or single quotes.
|
static Object |
readJsonLenient(Reader reader)
This function it's only used to read our configuration files and allows
JSON files to contain non strict JSON such as comments or single quotes.
|
static byte[] |
writeJson(Object objectToWrite)
Writes the JSON content of the object passed in parameter.
|
public static void checkJsonCompatibility(String trail, Object value)
trail
- pointer to the verified objectvalue
- object to verifypublic static Object readJson(String rawData) throws IOException
rawData
- The data as a string to read and parse.Map<String, Object>
, List<Object>
, Number
, Boolean
or null
.IOException
- If an exception occurs during parsing the data.readJson(Reader)
public static Object readJson(Reader reader) throws IOException
reader
- The data to parse.Map<String, Object>
, List<Object>
, Number
, Boolean
or null
.IOException
- If an exception occurs during parsing the data.public static Object readJsonLenient(Reader reader) throws IOException
reader
- The stream of data to parse.Map<String, Object>
, List<Object>
, Number
, Boolean
or null
.IOException
- If an error occurs during reading/parsing the data.public static Object readJsonLenient(InputStream in) throws IOException
in
- The input stream containing the json.Map<String, Object>
, List<Object>
, Number
, Boolean
or null
.IOException
- If an error occurs during reading/parsing the data.public static byte[] writeJson(Object objectToWrite) throws IOException
objectToWrite
- The object we want to serialize as JSON output. TheIOException
- If an error occurs during writing/mapping content.Copyright 2011-2015 ForgeRock AS.