Class TypeLiteral<T>

java.lang.Object
com.jsoniter.spi.TypeLiteral<T>

public class TypeLiteral<T> extends Object
  • Field Details

  • Constructor Details

    • TypeLiteral

      protected TypeLiteral()
      Constructs a new type literal. Derives represented class from type parameter. Clients create an empty anonymous subclass. Doing so embeds the type parameter in the anonymous class's type hierarchy so we can reconstitute it at runtime despite erasure.
    • TypeLiteral

      public TypeLiteral(Type type, String decoderCacheKey, String encoderCacheKey)
  • Method Details

    • generateDecoderCacheKey

      private static String generateDecoderCacheKey(Type type)
    • generateEncoderCacheKey

      private static String generateEncoderCacheKey(Type type)
    • generateCacheKey

      private static String generateCacheKey(Type type, String prefix)
    • formatTypeWithoutSpecialCharacter

      private static String formatTypeWithoutSpecialCharacter(Type type)
    • getSuperclassTypeParameter

      static Type getSuperclassTypeParameter(Class<?> subclass)
    • create

      public static TypeLiteral create(Type valueType)
    • createNew

      private static TypeLiteral createNew(Type valueType)
    • getType

      public Type getType()
    • getDecoderCacheKey

      public String getDecoderCacheKey()
    • getDecoderCacheKey

      public String getDecoderCacheKey(String configName)
    • getEncoderCacheKey

      public String getEncoderCacheKey()
    • getEncoderCacheKey

      public String getEncoderCacheKey(String configName)
    • getNativeType

      public TypeLiteral.NativeType getNativeType()
    • toString

      public String toString()
      Overrides:
      toString in class Object