api

http4k / org.http4k.format / JsonLibAutoMarshallingJson

JsonLibAutoMarshallingJson

abstract class JsonLibAutoMarshallingJson<NODE : Any> : AutoMarshallingJson, Json<NODE> (source)

Constructors

Name Summary
<init> JsonLibAutoMarshallingJson()

Functions

Name Summary
asA abstract fun <T : Any> asA(j: NODE, target: KClass<T>): T
fun <T : Any> NODE.asA(): T
fun <T : Any> NODE.asA(target: KClass<T>): T
asJsonObject abstract fun asJsonObject(input: Any): NODE
fun Any.asJsonObject(): NODE
asJsonString open fun asJsonString(input: Any): String
autoBody fun <T : Any> autoBody(description: String? = null, contentNegotiation: ContentNegotiation = ContentNegotiation.None): BiDiBodyLensSpec<T>

Inherited Functions

Name Summary
array open fun <T : NODE> array(value: T): NODE
open fun <T : NODE> array(value: Iterable<T>): NODE
asA fun <T : Any> String.asA(target: KClass<T>): T
asCompactJsonString abstract fun NODE.asCompactJsonString(): String
asInputStream fun asInputStream(input: Any): InputStream
asJsonArray abstract fun <T : Iterable<NODE>> T.asJsonArray(): NODE
asJsonObject abstract fun String.asJsonObject(): NODE
abstract fun <LIST : Iterable<Pair<String, NODE>>> LIST.asJsonObject(): NODE
asJsonValue abstract fun String?.asJsonValue(): NODE
abstract fun Int?.asJsonValue(): NODE
abstract fun Double?.asJsonValue(): NODE
abstract fun Long?.asJsonValue(): NODE
abstract fun BigDecimal?.asJsonValue(): NODE
abstract fun BigInteger?.asJsonValue(): NODE
abstract fun Boolean?.asJsonValue(): NODE
asPrettyJsonString abstract fun NODE.asPrettyJsonString(): String
body open fun body(description: String? = null, contentNegotiation: ContentNegotiation = None): BiDiBodyLensSpec<NODE>
bool abstract fun bool(value: NODE): Boolean
boolean open fun boolean(value: Boolean): NODE
compact open fun compact(node: NODE): String
compactify open fun compactify(input: String): String
decimal abstract fun decimal(value: NODE): BigDecimal
elements abstract fun elements(value: NODE): Iterable<NODE>
fields abstract fun fields(node: NODE): Iterable<Pair<String, NODE>>
integer abstract fun integer(value: NODE): Long
invoke open operator fun <T> invoke(fn: Json<NODE>.() -> T): T
json open fun <IN : Any> BiDiLensSpec<IN, String>.json(): BiDiLensSpec<IN, NODE>
lens open fun <IN : Any> lens(spec: BiDiLensSpec<IN, String>): BiDiLensSpec<IN, NODE>
nullNode open fun nullNode(): NODE
number open fun number(value: Int): NODE
open fun number(value: Double): NODE
open fun number(value: Long): NODE
open fun number(value: BigDecimal): NODE
open fun number(value: BigInteger): NODE
obj open fun obj(): NODE
open fun <T : NODE> obj(value: Iterable<Pair<String, T>>): NODE
open fun <T : NODE> obj(vararg fields: Pair<String, T>): NODE
parse open fun parse(input: String): NODE
prettify open fun prettify(input: String): String
pretty open fun pretty(node: NODE): String
string open fun string(value: String): NODE
text abstract fun text(value: NODE): String
textValueOf abstract fun textValueOf(node: NODE, name: String): String?
typeOf abstract fun typeOf(value: NODE): JsonType

Companion Object Functions

Name Summary
auto fun <T : Any> WsMessage.Companion.auto(): BiDiWsMessageLensSpec<T>
fun <T : Any> Body.Companion.auto(description: String? = null, contentNegotiation: ContentNegotiation = ContentNegotiation.None): BiDiBodyLensSpec<T>

Extension Functions

Name Summary
hasBody fun <NODE> Json<NODE>.hasBody(expected: NODE): Matcher<HttpMessage>
fun <NODE> Json<NODE>.hasBody(expected: Matcher<NODE>): Matcher<HttpMessage>
fun <NODE> Json<NODE>.hasBody(expected: String): Matcher<HttpMessage>
with fun <T> T.with(vararg modifiers: (T) -> T): T

Inheritors

Name Summary
ConfigurableGson open class ConfigurableGson : JsonLibAutoMarshallingJson<JsonElement>
ConfigurableJackson open class ConfigurableJackson : JsonLibAutoMarshallingJson<JsonNode>