Class JacksonFactory


  • public final class JacksonFactory
    extends JsonFactory
    Low-level JSON library implementation based on Jackson 2.

    Implementation is thread-safe, and sub-classes must be thread-safe. For maximum efficiency, applications should use a single globally-shared instance of the JSON factory.

    Since:
    1.11
    Author:
    Yaniv Inbar
    • Constructor Detail

      • JacksonFactory

        public JacksonFactory()
    • Method Detail

      • getDefaultInstance

        public static JacksonFactory getDefaultInstance()
        Returns a global thread-safe instance.
        Since:
        1.16
      • createJsonParser

        public JsonParser createJsonParser​(InputStream in)
                                    throws IOException
        Description copied from class: JsonFactory
        Returns a new instance of a low-level JSON parser for the given input stream. The parser tries to detect the charset of the input stream by itself.
        Specified by:
        createJsonParser in class JsonFactory
        Parameters:
        in - input stream
        Returns:
        new instance of a low-level JSON parser
        Throws:
        IOException
      • createJsonParser

        public JsonParser createJsonParser​(InputStream in,
                                           Charset charset)
                                    throws IOException
        Description copied from class: JsonFactory
        Returns a new instance of a low-level JSON parser for the given input stream.
        Specified by:
        createJsonParser in class JsonFactory
        Parameters:
        in - input stream
        charset - charset in which the input stream is encoded or null to let the parser detect the charset
        Returns:
        new instance of a low-level JSON parser
        Throws:
        IOException