Class GenericTypeIdResolver<T>

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsontype.TypeIdResolver

    public abstract class GenericTypeIdResolver<T>
    extends com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
    Generic type resolver that supports both manual type registration and automatic fallback to unknown types for unrecognized discriminator values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Class<? extends T> unknownType  
      • Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase

        _baseType, _typeFactory
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GenericTypeIdResolver​(java.lang.Class<? extends T> unknownType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()  
      java.lang.String idFromValueAndType​(java.lang.Object value, java.lang.Class<?> suggestedType)  
      protected void registerType​(java.lang.String typeId, java.lang.Class<? extends T> clazz)  
      com.fasterxml.jackson.databind.JavaType typeFromId​(com.fasterxml.jackson.databind.DatabindContext context, java.lang.String id)  
      • Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase

        _resolveToParentAsNecessary, getDescForKnownTypeIds, idFromBaseType, init
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.fasterxml.jackson.databind.jsontype.TypeIdResolver

        idFromValue
    • Field Detail

      • unknownType

        protected final java.lang.Class<? extends T> unknownType
    • Constructor Detail

      • GenericTypeIdResolver

        protected GenericTypeIdResolver​(java.lang.Class<? extends T> unknownType)
    • Method Detail

      • registerType

        protected void registerType​(java.lang.String typeId,
                                    java.lang.Class<? extends T> clazz)
      • idFromValueAndType

        public java.lang.String idFromValueAndType​(java.lang.Object value,
                                                   java.lang.Class<?> suggestedType)
      • getMechanism

        public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()
      • typeFromId

        public com.fasterxml.jackson.databind.JavaType typeFromId​(com.fasterxml.jackson.databind.DatabindContext context,
                                                                  java.lang.String id)
                                                           throws java.io.IOException
        Specified by:
        typeFromId in interface com.fasterxml.jackson.databind.jsontype.TypeIdResolver
        Overrides:
        typeFromId in class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
        Throws:
        java.io.IOException