StdTypeResolverBuilder
Date: 2016-12-04

com.fasterxml.jackson.databind.jsontype.impl

## Class StdTypeResolverBuilder

- java.lang.Object
- - com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder

- All Implemented Interfaces:
    TypeResolverBuilder<StdTypeResolverBuilder>
  Direct Known Subclasses:
    ObjectMapper.DefaultTypeResolverBuilder

      public class StdTypeResolverBuilder
      extends java.lang.Object
      implements TypeResolverBuilder<StdTypeResolverBuilder>

  Default `TypeResolverBuilder` implementation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TypeIdResolver` | `_customIdResolver`
    `protected java.lang.Class<?>` | `_defaultImpl` Default class to use in case type information is not available or is broken.
    `protected com.fasterxml.jackson.annotation.JsonTypeInfo.Id` | `_idType`
    `protected com.fasterxml.jackson.annotation.JsonTypeInfo.As` | `_includeAs`
    `protected boolean` | `_typeIdVisible` Whether type id should be exposed to deserializers or not
    `protected java.lang.String` | `_typeProperty`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StdTypeResolverBuilder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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.
    `StdTypeResolverBuilder` | `defaultImpl(java.lang.Class<?> defaultImpl)` Method for specifying default implementation to use if type id is either not available, or can not 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
    `java.lang.String` | `getTypeProperty()`
    `protected TypeIdResolver` | `idResolver(MapperConfig<?> config, JavaType baseType, java.util.Collection<NamedType> subtypes, boolean forSer, boolean forDeser)` Helper method that will either return configured custom type id resolver, or construct a standard resolver given configuration.
    `StdTypeResolverBuilder` | `inclusion(com.fasterxml.jackson.annotation.JsonTypeInfo.As includeAs)` Method for specifying mechanism to use for including type metadata in JSON.
    `StdTypeResolverBuilder` | `init(com.fasterxml.jackson.annotation.JsonTypeInfo.Id idType, TypeIdResolver idRes)` Initialization method that is called right after constructing the builder instance.
    `boolean` | `isTypeIdVisible()`
    `static StdTypeResolverBuilder` | `noTypeInfoBuilder()`
    `StdTypeResolverBuilder` | `typeIdVisibility(boolean isVisible)` Method for specifying whether type id should be visible to `JsonDeserializer`s or not.
    `StdTypeResolverBuilder` | `typeProperty(java.lang.String typeIdPropName)` Method for constructing an instance with specified type property name (property name to use for type id when using "as-property" inclusion).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _idType

          protected com.fasterxml.jackson.annotation.JsonTypeInfo.Id _idType

    - #### _includeAs

          protected com.fasterxml.jackson.annotation.JsonTypeInfo.As _includeAs

    - #### _typeProperty

          protected java.lang.String _typeProperty

    - #### _typeIdVisible

          protected boolean _typeIdVisible

      Whether type id should be exposed to deserializers or not

    - #### _defaultImpl

          protected java.lang.Class<?> _defaultImpl

      Default class to use in case type information is not available or is broken.

    - #### _customIdResolver

          protected TypeIdResolver _customIdResolver

  - ### Constructor Detail

    - #### StdTypeResolverBuilder

          public StdTypeResolverBuilder()

  - ### Method Detail

    - #### noTypeInfoBuilder

          public static StdTypeResolverBuilder noTypeInfoBuilder()

    - #### init

          public StdTypeResolverBuilder init(com.fasterxml.jackson.annotation.JsonTypeInfo.Id idType,
                                    TypeIdResolver idRes)

      Description copied from interface: `TypeResolverBuilder`
      Initialization method that is called right after constructing the builder instance.
      Specified by:
        `init` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
      Parameters:
        `idType` - Which type metadata is used
        `idRes` - (optional) Custom type id resolver used, if any
      Returns:
        Resulting builder instance (usually this builder, but not necessarily)

    - #### buildTypeSerializer

          public TypeSerializer buildTypeSerializer(SerializationConfig config,
                                           JavaType baseType,
                                           java.util.Collection<NamedType> subtypes)

      Description copied from interface: `TypeResolverBuilder`
      Method for building type serializer based on current configuration of this builder.
      Specified by:
        `buildTypeSerializer` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
        `baseType` - Base type that constructed resolver will handle; super type of all types it will be used for.

    - #### buildTypeDeserializer

          public TypeDeserializer buildTypeDeserializer(DeserializationConfig config,
                                               JavaType baseType,
                                               java.util.Collection<NamedType> subtypes)

      Description copied from interface: `TypeResolverBuilder`
      Method for building type deserializer based on current configuration of this builder.
      Specified by:
        `buildTypeDeserializer` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
        `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.

    - #### inclusion

          public StdTypeResolverBuilder inclusion(com.fasterxml.jackson.annotation.JsonTypeInfo.As includeAs)

      Description copied from interface: `TypeResolverBuilder`
      Method for specifying mechanism to use for including type metadata in JSON. If not explicitly called, setting defaults to `JsonTypeInfo.As.PROPERTY`.
      Specified by:
        `inclusion` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
      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

          public StdTypeResolverBuilder typeProperty(java.lang.String typeIdPropName)

      Method for constructing an instance with specified type property name (property name to use for type id when using "as-property" inclusion).
      Specified by:
        `typeProperty` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
      Parameters:
        `typeIdPropName` - 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

          public StdTypeResolverBuilder defaultImpl(java.lang.Class<?> defaultImpl)

      Description copied from interface: `TypeResolverBuilder`
      Method for specifying default implementation to use if type id is either not available, or can not be resolved.
      Specified by:
        `defaultImpl` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
      Returns:
        Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

    - #### typeIdVisibility

          public StdTypeResolverBuilder typeIdVisibility(boolean isVisible)

      Description copied from interface: `TypeResolverBuilder`
      Method for specifying whether type id should be visible to `JsonDeserializer`s or not.
      Specified by:
        `typeIdVisibility` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`
      Returns:
        Resulting builder instance (usually this builder, but may be a newly constructed instance for immutable builders}

    - #### getDefaultImpl

          public java.lang.Class<?> getDefaultImpl()

      Description copied from interface: `TypeResolverBuilder`
      Accessor for currently configured default type; implementation class that may be used in case no valid type information is available during type resolution
      Specified by:
        `getDefaultImpl` in interface `TypeResolverBuilder<StdTypeResolverBuilder>`

    - #### getTypeProperty

          public java.lang.String getTypeProperty()

    - #### isTypeIdVisible

          public boolean isTypeIdVisible()

    - #### idResolver

          protected TypeIdResolver idResolver(MapperConfig<?> config,
                                  JavaType baseType,
                                  java.util.Collection<NamedType> subtypes,
                                  boolean forSer,
                                  boolean forDeser)

      Helper method that will either return configured custom type id resolver, or construct a standard resolver given configuration.