All Implemented Interfaces:
Versioned, Serializable

public class MappingJsonFactory extends JsonFactory
Sub-class of JsonFactory that will create a proper ObjectCodec to allow seam-less conversions between JSON content and Java objects (POJOs). The only addition to regular JsonFactory currently is that ObjectMapper is constructed and passed as the codec to use.
See Also:
  • Constructor Details

    • MappingJsonFactory

      public MappingJsonFactory()
    • MappingJsonFactory

      public MappingJsonFactory(ObjectMapper mapper)
    • MappingJsonFactory

      public MappingJsonFactory(JsonFactory src, ObjectMapper mapper)
  • Method Details

    • getCodec

      public final ObjectMapper getCodec()
      We'll override the method to return more specific type; co-variance helps here
      Overrides:
      getCodec in class JsonFactory
    • copy

      public JsonFactory copy()
      Description copied from class: JsonFactory
      Method for constructing a new JsonFactory that has the same settings as this instance, but is otherwise independent (i.e. nothing is actually shared, symbol tables are separate). Note that ObjectCodec reference is not copied but is set to null; caller typically needs to set it after calling this method. Reason for this is that the codec is used for callbacks, and assumption is that there is strict 1-to-1 mapping between codec, factory. Caller has to, then, explicitly set codec after making the copy.
      Overrides:
      copy in class JsonFactory
      Returns:
      Copy of this factory instance
    • getFormatName

      public String getFormatName()
      Sub-classes need to override this method
      Overrides:
      getFormatName in class JsonFactory
      Returns:
      Name of the format handled by parsers, generators this factory creates
    • hasFormat

      public MatchStrength hasFormat(InputAccessor acc) throws IOException
      Sub-classes need to override this method
      Overrides:
      hasFormat in class JsonFactory
      Throws:
      IOException