public class JacksonSupport
Utilities and serialisers for working with JSON representations of basic types. This adds Jackson support for the java.time API, some core types, and Kotlin data classes.
Note that Jackson can also be used to serialise/deserialise other formats such as Yaml and XML.
public static JacksonSupport INSTANCE
Utilities and serialisers for working with JSON representations of basic types. This adds Jackson support for the java.time API, some core types, and Kotlin data classes.
Note that Jackson can also be used to serialise/deserialise other formats such as Yaml and XML.
@NotNull public com.fasterxml.jackson.databind.Module getCordaModule()
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(@NotNull CordaRPCOps rpc, @NotNull com.fasterxml.jackson.core.JsonFactory factory, boolean fuzzyIdentityMatch, boolean fullParties)
Creates a Jackson ObjectMapper that uses RPC to deserialise parties from string names.
fuzzyIdentityMatch
- If false, fields mapped to class Party
objects must be in X.500 name form and preciselymatch an identity known from the network map. If true, the name is matched more leniently but if the matchis ambiguous a JsonParseException is thrown.fullParties
- If true then class Party
objects will be serialised as JSON objects, with the owning key serialisedin addition to the name. For class PartyAndCertificate
objects the cert path will be included.@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(@NotNull CordaRPCOps rpc, @NotNull com.fasterxml.jackson.core.JsonFactory factory, boolean fuzzyIdentityMatch)
Creates a Jackson ObjectMapper that uses RPC to deserialise parties from string names.
fuzzyIdentityMatch
- If false, fields mapped to class Party
objects must be in X.500 name form and preciselymatch an identity known from the network map. If true, the name is matched more leniently but if the matchis ambiguous a JsonParseException is thrown.@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(@NotNull CordaRPCOps rpc, @NotNull com.fasterxml.jackson.core.JsonFactory factory)
Creates a Jackson ObjectMapper that uses RPC to deserialise parties from string names.
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(@NotNull CordaRPCOps rpc)
Creates a Jackson ObjectMapper that uses RPC to deserialise parties from string names.
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createNonRpcMapper(@NotNull com.fasterxml.jackson.core.JsonFactory factory, boolean fullParties)
For testing or situations where deserialising parties is not required
fullParties
- If true then class Party
objects will be serialised as JSON objects, with the owning key serialisedin addition to the name. For class PartyAndCertificate
objects the cert path will be included.@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createNonRpcMapper(@NotNull com.fasterxml.jackson.core.JsonFactory factory)
For testing or situations where deserialising parties is not required
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createNonRpcMapper()
For testing or situations where deserialising parties is not required
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createInMemoryMapper(@NotNull IdentityService identityService, @NotNull com.fasterxml.jackson.core.JsonFactory factory, boolean fuzzyIdentityMatch, boolean fullParties)
Creates a Jackson ObjectMapper that uses an interface IdentityService
directly inside the node to deserialise parties from string names.
fuzzyIdentityMatch
- If false, fields mapped to class Party
objects must be in X.500 name form and preciselymatch an identity known from the network map. If true, the name is matched more leniently but if the matchis ambiguous a JsonParseException is thrown.fullParties
- If true then class Party
objects will be serialised as JSON objects, with the owning key serialisedin addition to the name. For class PartyAndCertificate
objects the cert path will be included.interface IdentityService
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createInMemoryMapper(@NotNull IdentityService identityService, @NotNull com.fasterxml.jackson.core.JsonFactory factory, boolean fuzzyIdentityMatch)
Creates a Jackson ObjectMapper that uses an interface IdentityService
directly inside the node to deserialise parties from string names.
fuzzyIdentityMatch
- If false, fields mapped to class Party
objects must be in X.500 name form and preciselymatch an identity known from the network map. If true, the name is matched more leniently but if the matchis ambiguous a JsonParseException is thrown.interface IdentityService
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createInMemoryMapper(@NotNull IdentityService identityService, @NotNull com.fasterxml.jackson.core.JsonFactory factory)
Creates a Jackson ObjectMapper that uses an interface IdentityService
directly inside the node to deserialise parties from string names.
interface IdentityService
@JvmStatic @JvmOverloads @NotNull public static com.fasterxml.jackson.databind.ObjectMapper createInMemoryMapper(@NotNull IdentityService identityService)
Creates a Jackson ObjectMapper that uses an interface IdentityService
directly inside the node to deserialise parties from string names.
interface IdentityService