JacksonSupport
Keywords: net.corda.client.jackson.JacksonSupport class
Date: 2023-09-18

net.corda.client.jackson

## Class JacksonSupport

- net.corda.client.jackson.JacksonSupport

-     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.

- - ### Field Detail

    - #### INSTANCE

          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.

  - ### Method Detail

    - #### getCordaModule

          @NotNull
          public com.fasterxml.jackson.databind.Module getCordaModule()

      Deprecated.

    - #### createDefaultMapper

          @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.

      Parameters:
        `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.

    - #### createDefaultMapper

          @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.

      Parameters:
        `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.

    - #### createDefaultMapper

          @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.

    - #### createDefaultMapper

          @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.

    - #### createNonRpcMapper

          @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

      Parameters:
        `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.

    - #### createNonRpcMapper

          @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

    - #### createNonRpcMapper

          @JvmStatic
           @JvmOverloads
           @NotNull
          public static com.fasterxml.jackson.databind.ObjectMapper createNonRpcMapper()

      For testing or situations where deserialising parties is not required

    - #### createInMemoryMapper

          @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.

      Parameters:
        `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.
      See Also:
        `interface IdentityService`

    - #### createInMemoryMapper

          @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.

      Parameters:
        `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.
      See Also:
        `interface IdentityService`

    - #### createInMemoryMapper

          @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.

      See Also:
        `interface IdentityService`

    - #### createInMemoryMapper

          @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.

      See Also:
        `interface IdentityService`