Class JsonSerializer

    • Field Detail

      • PROP_DEBUG_MODE

        public static final String PROP_DEBUG_MODE
        The System property to use to dump json being serialized or deserialized to the log.
        See Also:
        Constant Field Values
      • DEBUG_MODE

        public static final boolean DEBUG_MODE
        A flag indicating whether to dump json to the log.

        This will impact performance and should only be used in testing.

      • f_genson

        protected final Genson f_genson
        Genson runtime for serialization/deserialization operations.
      • f_fCompatibleMode

        protected final boolean f_fCompatibleMode
        Flag indicating Maps should be serialized in a JSON compatible fashion. This is useful for the cases when JSON produced by this library needs to be consumed by another JSON parsing library other than Genson.
    • Constructor Detail

      • JsonSerializer

        public JsonSerializer()
        Default constructor.
      • JsonSerializer

        public JsonSerializer​(ClassLoader loader)
        Constructs a GensonJsonSerializer that will use the provided ClassLoader.
        Parameters:
        loader - the ClassLoader to use during deserialization operations
      • JsonSerializer

        public JsonSerializer​(ClassLoader loader,
                              Modifier<GensonBuilder> builderModifier,
                              boolean compatibleMode)
        Constructs a GensonJsonSerializer that will use the provided ClassLoader.
        Parameters:
        loader - the ClassLoader to use during deserialization operations
        builderModifier - the Modifier that will be invoked to allow customization of the serialization
        compatibleMode - true if consuming JSON from an endpoint that doesn't use our JSON serialization library.