Class JsonReflectionsSubTypeResolver


  • public class JsonReflectionsSubTypeResolver
    extends com.fasterxml.jackson.databind.jsontype.SubtypeResolver
    A custom resolver that detects sub types automatically using Reflections library instead of reading @JsonSubTypes annotations that had to be maintained manually.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<com.fasterxml.jackson.databind.jsontype.NamedType> collectAndResolveSubtypes​(com.fasterxml.jackson.databind.introspect.AnnotatedClass basetype, com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.AnnotationIntrospector ai)  
      void registerSubtypes​(com.fasterxml.jackson.databind.jsontype.NamedType... types)  
      void registerSubtypes​(java.lang.Class<?>... classes)  
      void registerSubtypes​(java.util.Collection<java.lang.Class<?>> subtypes)  
      • Methods inherited from class com.fasterxml.jackson.databind.jsontype.SubtypeResolver

        collectAndResolveSubtypes, collectAndResolveSubtypesByClass, collectAndResolveSubtypesByClass, collectAndResolveSubtypesByTypeId, collectAndResolveSubtypesByTypeId
      • Methods inherited from class java.lang.Object

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

      • registerSubtypes

        public void registerSubtypes​(com.fasterxml.jackson.databind.jsontype.NamedType... types)
        Specified by:
        registerSubtypes in class com.fasterxml.jackson.databind.jsontype.SubtypeResolver
      • registerSubtypes

        public void registerSubtypes​(java.lang.Class<?>... classes)
        Specified by:
        registerSubtypes in class com.fasterxml.jackson.databind.jsontype.SubtypeResolver
      • collectAndResolveSubtypes

        public java.util.Collection<com.fasterxml.jackson.databind.jsontype.NamedType> collectAndResolveSubtypes​(com.fasterxml.jackson.databind.introspect.AnnotatedClass basetype,
                                                                                                                 com.fasterxml.jackson.databind.cfg.MapperConfig<?> config,
                                                                                                                 com.fasterxml.jackson.databind.AnnotationIntrospector ai)
        Overrides:
        collectAndResolveSubtypes in class com.fasterxml.jackson.databind.jsontype.SubtypeResolver
      • registerSubtypes

        public void registerSubtypes​(java.util.Collection<java.lang.Class<?>> subtypes)
        Specified by:
        registerSubtypes in class com.fasterxml.jackson.databind.jsontype.SubtypeResolver