from

open fun from(source: CharSequence): JsonContent<Any>

Create JSON content from the specified String source. The source can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.

Return

the JSON content

Parameters

source

the JSON content or a .json resource name


open fun from(path: String, resourceLoadClass: Class<out Any>): JsonContent<Any>

Create JSON content from the specified resource path.

Return

the JSON content

Parameters

path

the path of the resource to load

resourceLoadClass

the source class used to load the resource


open fun from(source: Array<Byte>): JsonContent<Any>

Create JSON content from the specified JSON bytes.

Return

the JSON content

Parameters

source

the bytes of JSON


open fun from(source: File): JsonContent<Any>

Create JSON content from the specified JSON file.

Return

the JSON content

Parameters

source

the file containing JSON


open fun from(source: InputStream): JsonContent<Any>

Create JSON content from the specified JSON input stream.

Return

the JSON content

Parameters

source

the input stream containing JSON


open fun from(source: Resource): JsonContent<Any>

Create JSON content from the specified JSON resource.

Return

the JSON content

Parameters

source

the resource containing JSON