parse

open fun parse(@Nullable json: String): Json

Parse a JSON string into a tree.

Return

The parsed object or null if parsing failed or the passed string is null.

Parameters

json

The JSON string to parse; can be null.


open fun parse(@Nullable file: File): Json

Parse a file with JSON into a tree.

Return

The parsed object or null if parsing failed or the passed file is null.

Parameters

file

The file with JSON to parse; can be null.


open fun parse(@Nullable stream: InputStream): Json

Parse a JSON string into a tree.

Return

The parsed object or null if parsing failed or the input stream was null.

Parameters

stream

The JSON stream to parse; can be null. Will be closed.