Class JSON.Builder

  • Enclosing class:
    JSON

    public static class JSON.Builder
    extends java.lang.Object
    Builder class that needs to be used for certain kind of "static" configuration (settings that can not vary on per-call basis for JSON), such as Extension registration.
    Since:
    2.11
    • Field Detail

      • _features

        protected int _features
      • _prettyPrinter

        protected com.fasterxml.jackson.core.PrettyPrinter _prettyPrinter
      • _streamFactory

        protected final com.fasterxml.jackson.core.JsonFactory _streamFactory
      • _treeCodec

        protected com.fasterxml.jackson.core.TreeCodec _treeCodec
      • _extContext

        protected com.fasterxml.jackson.jr.ob.JSON.ExtContextImpl _extContext
    • Constructor Detail

      • Builder

        public Builder​(com.fasterxml.jackson.core.JsonFactory f)
    • Method Detail

      • build

        public JSON build()
      • register

        public JSON.Builder register​(JacksonJrExtension extension)
        Method for registering given extension to be used by JSON this builder builds.
        Parameters:
        extension - Extension to register
        Returns:
        This builder for call chaining
      • enable

        public JSON.Builder enable​(JSON.Feature... features)
        Method for enabling a set of Features for JSON to be built.
        Parameters:
        features - Features to enable
        Returns:
        This builder for call chaining
      • disable

        public JSON.Builder disable​(JSON.Feature... features)
        Method for disabling a set of Features for JSON to be built.
        Parameters:
        features - Features to disable
        Returns:
        This builder for call chaining
      • prettyPrinter

        public JSON.Builder prettyPrinter​(com.fasterxml.jackson.core.PrettyPrinter pp)
        Method for specifying PrettyPrinter JSON to be built should use on serialization.
        Parameters:
        pp - Pretty printer to use
        Returns:
        This builder for call chaining
      • treeCodec

        public JSON.Builder treeCodec​(com.fasterxml.jackson.core.TreeCodec tc)
        Method for specifying TreeCodec JSON to be built should use for reading and writing TreeNode values.

        Note: by default no TreeCodec is configured.

        Parameters:
        tc - TreeCodec to use
        Returns:
        This builder for call chaining
      • featureMask

        public int featureMask()
      • prettyPrinter

        public com.fasterxml.jackson.core.PrettyPrinter prettyPrinter()
      • streamFactory

        public com.fasterxml.jackson.core.JsonFactory streamFactory()
      • treeCodec

        public com.fasterxml.jackson.core.TreeCodec treeCodec()