Class FastJsonHelper

  • All Implemented Interfaces:

    
    public class FastJsonHelper
    
                        

    FastJson Util, not recommended for use in complex types.

    Since:

    2022-04-22

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      FastJsonHelper()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static void initGlobal(boolean init) init or remove the global default setting
      void enableFeature(@NotNull() JSONReader.Feature f, boolean enable) enable/disable the Feature
      static Array<JSONReader.Feature> DefaultReader()
      void enableFeature(@NotNull() JSONWriter.Feature f, boolean enable) enable/disable the Feature
      static Array<JSONWriter.Feature> DefaultWriter()
      static void enableFilter(@NotNull() String name, @Nullable() Filter filter) enable/disable the Filter by name, sort by adding order
      static Array<Filter> DefaultFilter()
      static <T> T object(@Nullable() String json, @NotNull() ResolvableType targetType) Deserialization with the wings convention
      static <T> T object(@Nullable() String json, @NotNull() TypeDescriptor targetType) Deserialization with the wings convention
      static <T> T object(@Nullable() String json, @NotNull() TypeReference<T> targetType) Deserialization with the wings convention
      static <T> T object(@Nullable() String json, @NotNull() Type targetType) Deserialization with the wings convention
      static <T> T object(@Nullable() String json, @NotNull() Class<T> targetType) Deserialization with the wings convention
      static String string(@Nullable() Object obj) Serialization using the wings convention, output as string wherever possible to ensure data precision, but not affecting Java type inverse parsing
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FastJsonHelper

        FastJsonHelper()
    • Method Detail

      • initGlobal

         static void initGlobal(boolean init)

        init or remove the global default setting

      • enableFeature

         void enableFeature(@NotNull() JSONReader.Feature f, boolean enable)

        enable/disable the Feature

      • enableFeature

         void enableFeature(@NotNull() JSONWriter.Feature f, boolean enable)

        enable/disable the Feature

      • enableFilter

         static void enableFilter(@NotNull() String name, @Nullable() Filter filter)

        enable/disable the Filter by name, sort by adding order

        Parameters:
        name - filter name
        filter - `null` to disable, otherwise to enable
      • object

        @Contract(value = "!null,_->!null") static <T> T object(@Nullable() String json, @NotNull() ResolvableType targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(@Nullable() String json, @NotNull() TypeDescriptor targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(@Nullable() String json, @NotNull() TypeReference<T> targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(@Nullable() String json, @NotNull() Type targetType)

        Deserialization with the wings convention

      • object

        @Contract(value = "!null,_->!null") static <T> T object(@Nullable() String json, @NotNull() Class<T> targetType)

        Deserialization with the wings convention

      • string

        @Contract(value = "!null->!null") static String string(@Nullable() Object obj)

        Serialization using the wings convention, output as string wherever possible to ensure data precision, but not affecting Java type inverse parsing