api

http4k / org.http4k.format / ConfigurableJackson

ConfigurableJackson

open class ConfigurableJackson : AutoMarshallingJson<JsonNode>

Constructors

Name Summary
<init> ConfigurableJackson(mapper: ObjectMapper, defaultContentType: ContentType = APPLICATION_JSON)

Properties

Name Summary
defaultContentType val defaultContentType: ContentType
mapper val mapper: ObjectMapper

Functions

Name Summary
asA open fun <T : Any> asA(input: String, target: KClass<T>): T
open fun <T : Any> asA(j: JsonNode, target: KClass<T>): T
fun <T : Any> JsonNode.asA(): T
asCompactJsonString open fun JsonNode.asCompactJsonString(): String
asCompactJsonStringUsingView fun <T : Any, V : Any> T.asCompactJsonStringUsingView(v: KClass<V>): String
asJsonArray open fun <T : Iterable<JsonNode>> T.asJsonArray(): JsonNode
asJsonObject open fun String.asJsonObject(): JsonNode
open fun <LIST : Iterable<Pair<String, JsonNode>>> LIST.asJsonObject(): JsonNode
open fun asJsonObject(input: Any): JsonNode
asJsonValue open fun String?.asJsonValue(): JsonNode
open fun Int?.asJsonValue(): JsonNode
open fun Double?.asJsonValue(): JsonNode
open fun Long?.asJsonValue(): JsonNode
open fun BigDecimal?.asJsonValue(): JsonNode
open fun BigInteger?.asJsonValue(): JsonNode
open fun Boolean?.asJsonValue(): JsonNode
asPrettyJsonString open fun JsonNode.asPrettyJsonString(): String
asUsingView fun <T : Any, V : Any> String.asUsingView(t: KClass<T>, v: KClass<V>): T
autoBody fun <T : Any> autoBody(description: String? = null, contentNegotiation: ContentNegotiation = None, contentType: ContentType = defaultContentType): BiDiBodyLensSpec<T>
bool open fun bool(value: JsonNode): Boolean
decimal open fun decimal(value: JsonNode): BigDecimal
elements open fun elements(value: JsonNode): Iterable<JsonNode!>
fields open fun fields(node: JsonNode): List<Pair<String!, JsonNode!>>
integer open fun integer(value: JsonNode): Long
text open fun text(value: JsonNode): String
textValueOf open fun textValueOf(node: JsonNode, name: String): String?
typeOf open fun typeOf(value: JsonNode): JsonType

Companion Object Functions

Name Summary
auto fun <T : Any> WsMessage.Companion.auto(): <ERROR CLASS>
fun <T : Any> Body.Companion.auto(description: String? = null, contentNegotiation: ContentNegotiation = None, contentType: ContentType = defaultContentType): BiDiBodyLensSpec<T>
autoView fun <T : Any, V : Any> Body.Companion.autoView(description: String? = null, contentNegotiation: ContentNegotiation = None, contentType: ContentType = APPLICATION_JSON): <ERROR CLASS>
fun <T : Any, V : Any> WsMessage.Companion.autoView(): <ERROR CLASS>

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>
haveBody fun <NODE> Json<NODE>.haveBody(expected: NODE): Matcher<HttpMessage>
fun <NODE> Json<NODE>.haveBody(expected: Matcher<NODE>): Matcher<HttpMessage>
fun <NODE> Json<NODE>.haveBody(expected: String): Matcher<HttpMessage>

Inheritors

Name Summary
Jackson To implement custom JSON configuration, create your own object singleton. Extra mappings can be added before done() is called.object Jackson : ConfigurableJackson