Class JsonMapper

java.lang.Object
tools.jackson.databind.ObjectMapper
tools.jackson.databind.json.JsonMapper
All Implemented Interfaces:
Serializable, tools.jackson.core.TreeCodec, tools.jackson.core.Versioned

public class JsonMapper extends ObjectMapper
JSON-specific ObjectMapper implementation.
See Also:
  • Constructor Details

    • JsonMapper

      public JsonMapper()
    • JsonMapper

      public JsonMapper(tools.jackson.core.json.JsonFactory f)
    • JsonMapper

      public JsonMapper(JsonMapper.Builder b)
  • Method Details

    • builder

      public static JsonMapper.Builder builder()
    • builder

      public static JsonMapper.Builder builder(tools.jackson.core.json.JsonFactory streamFactory)
    • builderWithJackson2Defaults

      public static JsonMapper.Builder builderWithJackson2Defaults()
      Modifies the settings of this builder to more closely match the default configs used in Jackson 2.x versions.

      This method is still a work in progress and may not yet fully replicate the default settings of Jackson 2.x.

    • rebuild

      public JsonMapper.Builder rebuild()
      Description copied from class: ObjectMapper
      Method for creating a new MapperBuilder for constructing differently configured ObjectMapper instance, starting with current configuration including base settings and registered modules.
      Overrides:
      rebuild in class ObjectMapper
    • shared

      public static JsonMapper shared()
      Accessor method for getting globally shared "default" JsonMapper instance: one that has default configuration, no modules registered, no config overrides. Usable mostly when dealing "untyped" or Tree-style content reading and writing.
    • version

      public tools.jackson.core.Version version()
      Description copied from class: ObjectMapper
      Method that will return version information stored in and read from jar that contains this class.
      Specified by:
      version in interface tools.jackson.core.Versioned
      Overrides:
      version in class ObjectMapper
    • tokenStreamFactory

      public tools.jackson.core.json.JsonFactory tokenStreamFactory()
      Description copied from class: ObjectMapper
      Method that can be used to get hold of TokenStreamFactory that this mapper uses if it needs to construct JsonParsers and/or JsonGenerators.

      WARNING: note that all ObjectReader and ObjectWriter instances created by this mapper usually share the same configured TokenStreamFactory, so changes to its configuration will "leak". To avoid such observed changes you should always use "with()" and "without()" method of ObjectReader and ObjectWriter for changing StreamReadFeature and StreamWriteFeature settings to use on per-call basis.

      Overrides:
      tokenStreamFactory in class ObjectMapper
      Returns:
      TokenStreamFactory that this mapper uses when it needs to construct Json parser and generators
    • isEnabled

      public boolean isEnabled(tools.jackson.core.json.JsonReadFeature f)
    • isEnabled

      public boolean isEnabled(tools.jackson.core.json.JsonWriteFeature f)