Class TypeNameIdResolver

    • Field Detail

      • _typeToId

        protected final Map<String,​String> _typeToId
        Mappings from class name to type id, used for serialization
      • _idToType

        protected final Map<String,​JavaType> _idToType
        Mappings from type id to JavaType, used for deserialization
    • Method Detail

      • getMechanism

        public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()
        Description copied from interface: TypeIdResolver
        Accessor for mechanism that this resolver uses for determining type id from type. Mostly informational; not required to be called or used.
      • idFromValue

        public String idFromValue​(Object value)
        Description copied from interface: TypeIdResolver
        Method called to serialize type of the type of given value as a String to include in serialized JSON content.
      • idFromClass

        protected String idFromClass​(Class<?> clazz)
      • idFromValueAndType

        public String idFromValueAndType​(Object value,
                                         Class<?> type)
        Description copied from interface: TypeIdResolver
        Alternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type. Most common implementation will use suggested type as is.
      • _defaultTypeId

        protected static String _defaultTypeId​(Class<?> cls)
        If no name was explicitly given for a class, we will just use non-qualified class name