Interface TypeResolverBuilder<T extends TypeResolverBuilder<T>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      TypeDeserializer buildTypeDeserializer​(DeserializationConfig config, JavaType baseType, java.util.Collection<NamedType> subtypes)
      Method for building type deserializer based on current configuration of this builder.
      TypeSerializer buildTypeSerializer​(SerializationConfig config, JavaType baseType, java.util.Collection<NamedType> subtypes)
      Method for building type serializer based on current configuration of this builder.
      T defaultImpl​(java.lang.Class<?> defaultImpl)
      Method for specifying default implementation to use if type id is either not available, or cannot be resolved.
      java.lang.Class<?> getDefaultImpl()
      Accessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolution
      T inclusion​(com.fasterxml.jackson.annotation.JsonTypeInfo.As includeAs)
      Method for specifying mechanism to use for including type metadata in JSON.
      T init​(com.fasterxml.jackson.annotation.JsonTypeInfo.Id idType, TypeIdResolver res)
      Initialization method that is called right after constructing the builder instance.
      default T init​(com.fasterxml.jackson.annotation.JsonTypeInfo.Value settings, TypeIdResolver res)
      Initialization method that is called right after constructing the builder instance, in cases where information could not be passed directly (for example when instantiated for an annotation)
      T typeIdVisibility​(boolean isVisible)
      Method for specifying whether type id should be visible to JsonDeserializers or not.
      T typeProperty​(java.lang.String propName)
      Method for specifying name of property used for including type information.
      default T withDefaultImpl​(java.lang.Class<?> defaultImpl)
      "Mutant factory" method for creating a new instance with different default implementation.
      default T withSettings​(com.fasterxml.jackson.annotation.JsonTypeInfo.Value typeInfo)
      Method for overriding type information.
    • Method Detail

      • getDefaultImpl

        java.lang.Class<?> getDefaultImpl()
        Accessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolution
      • buildTypeSerializer

        TypeSerializer buildTypeSerializer​(SerializationConfig config,
                                           JavaType baseType,
                                           java.util.Collection<NamedType> subtypes)
        Method for building type serializer based on current configuration of this builder.
        Parameters:
        baseType - Base type that constructed resolver will handle; super type of all types it will be used for.
      • buildTypeDeserializer

        TypeDeserializer buildTypeDeserializer​(DeserializationConfig config,
                                               JavaType baseType,
                                               java.util.Collection<NamedType> subtypes)
        Method for building type deserializer based on current configuration of this builder.
        Parameters:
        baseType - Base type that constructed resolver will handle; super type of all types it will be used for.
        subtypes - Known subtypes of the base type.
      • init

        T init​(com.fasterxml.jackson.annotation.JsonTypeInfo.Id idType,
               TypeIdResolver res)
        Initialization method that is called right after constructing the builder instance.
        Parameters:
        idType - Which type metadata is used
        res - (optional) Custom type id resolver used, if any
        Returns:
        Resulting builder instance (usually this builder, but not necessarily)
      • init

        default T init​(com.fasterxml.jackson.annotation.JsonTypeInfo.Value settings,
                       TypeIdResolver res)
        Initialization method that is called right after constructing the builder instance, in cases where information could not be passed directly (for example when instantiated for an annotation)

        NOTE: This method is abstract in Jackson 3.0, at the moment of writing.

        Parameters:
        settings - Configuration settings to apply.
        Returns:
        Resulting builder instance (usually this builder, but not necessarily)
        Since:
        2.16 (backported from Jackson 3.0)
      • inclusion

        T inclusion​(com.fasterxml.jackson.annotation.JsonTypeInfo.As includeAs)
        Method for specifying mechanism to use for including type metadata in JSON. If not explicitly called, setting defaults to JsonTypeInfo.As.PROPERTY.
        Parameters:
        includeAs - Mechanism used for including type metadata in JSON
        Returns:
        Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}
      • typeProperty

        T typeProperty​(java.lang.String propName)
        Method for specifying name of property used for including type information. Not used for all inclusion mechanisms; usually only used with JsonTypeInfo.As.PROPERTY.

        If not explicitly called, name of property to use is based on defaults for JsonTypeInfo.Id configured.

        Parameters:
        propName - Name of JSON property to use for including type information
        Returns:
        Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}
      • defaultImpl

        T defaultImpl​(java.lang.Class<?> defaultImpl)
        Method for specifying default implementation to use if type id is either not available, or cannot be resolved.
        Returns:
        Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}
      • typeIdVisibility

        T typeIdVisibility​(boolean isVisible)
        Method for specifying whether type id should be visible to JsonDeserializers or not.
        Returns:
        Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}
        Since:
        2.0
      • withDefaultImpl

        default T withDefaultImpl​(java.lang.Class<?> defaultImpl)
        "Mutant factory" method for creating a new instance with different default implementation.
        Returns:
        Either this instance (if nothing changed) or a new instance with different default implementation
        Since:
        2.13
      • withSettings

        default T withSettings​(com.fasterxml.jackson.annotation.JsonTypeInfo.Value typeInfo)
        Method for overriding type information.
        Since:
        2.16