AbstractTypeMaterializer
Date: 2017-02-10

com.fasterxml.jackson.module.mrbean

## Class AbstractTypeMaterializer

- java.lang.Object
- - com.fasterxml.jackson.databind.AbstractTypeResolver
  - - com.fasterxml.jackson.module.mrbean.AbstractTypeMaterializer

- All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned

      public class AbstractTypeMaterializer
      extends com.fasterxml.jackson.databind.AbstractTypeResolver
      implements com.fasterxml.jackson.core.Versioned

  Nifty class for pulling implementations of classes out of thin air.

  ... friends call him Mister Bean... :-)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AbstractTypeMaterializer.Feature` Enumeration that defines togglable features that guide the serialization feature.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected com.fasterxml.jackson.module.mrbean.AbstractTypeMaterializer.MyClassLoader` | `_classLoader` We will use per-materializer class loader for now; would be nice to find a way to reduce number of class loaders (and hence number of generated classes!) constructed...
    `protected java.lang.String` | `_defaultPackage` Package name to use as prefix for generated classes.
    `protected int` | `_featureFlags` Bit set that contains all enabled features
    `protected static int` | `DEFAULT_FEATURE_FLAGS` Bitfield (set of flags) of all Features that are enabled by default.
    `static java.lang.String` | `DEFAULT_PACKAGE_FOR_GENERATED` Default package to use for generated classes.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTypeMaterializer()`
    `AbstractTypeMaterializer(java.lang.ClassLoader parentClassLoader)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `disable(AbstractTypeMaterializer.Feature f)` Method for disabling specified feature.
    `void` | `enable(AbstractTypeMaterializer.Feature f)` Method for enabling specified feature.
    `boolean` | `isEnabled(AbstractTypeMaterializer.Feature f)` Method for checking whether given feature is enabled or not
    `java.lang.Class<?>` | `materializeClass(com.fasterxml.jackson.databind.DeserializationConfig config, com.fasterxml.jackson.databind.JavaType type)` Deprecated. Since 2.4 use `materializeType(MapperConfig, JavaType)` instead
    `java.lang.Class<?>` | `materializeGenericType(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.JavaType type)`
    `java.lang.Class<?>` | `materializeRawType(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, java.lang.Class<?> rawType)` NOTE: should not be called for generic types.
    `java.lang.Class<?>` | `materializeType(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.JavaType type)` Method that will find implementation for given abstract class; if called multiple times on same materializer, will return same Class.
    `com.fasterxml.jackson.databind.JavaType` | `resolveAbstractType(com.fasterxml.jackson.databind.DeserializationConfig config, com.fasterxml.jackson.databind.JavaType type)` Entry-point for `AbstractTypeResolver` that Jackson calls to materialize an abstract type.
    `void` | `set(AbstractTypeMaterializer.Feature f, boolean state)` Method for enabling or disabling specified feature.
    `void` | `setDefaultPackage(java.lang.String defPkg)` Method for specifying package to use for generated classes.
    `com.fasterxml.jackson.core.Version` | `version()` Method that will return version information stored in and read from jar that contains this class.

    - ### Methods inherited from class com.fasterxml.jackson.databind.AbstractTypeResolver

      `findTypeMapping, resolveAbstractType`

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

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

- - ### Field Detail

    - #### DEFAULT_FEATURE_FLAGS

          protected static final int DEFAULT_FEATURE_FLAGS

      Bitfield (set of flags) of all Features that are enabled by default.

    - #### DEFAULT_PACKAGE_FOR_GENERATED

          public static final java.lang.String DEFAULT_PACKAGE_FOR_GENERATED

      Default package to use for generated classes.

      Note that before 2.6, defaulted to "org.codehaus.jackson.generated.", changed as per [mrbean#21]

      See Also:
        Constant Field Values

    - #### _classLoader

          protected final com.fasterxml.jackson.module.mrbean.AbstractTypeMaterializer.MyClassLoader _classLoader

      We will use per-materializer class loader for now; would be nice to find a way to reduce number of class loaders (and hence number of generated classes!) constructed...

    - #### _featureFlags

          protected int _featureFlags

      Bit set that contains all enabled features

    - #### _defaultPackage

          protected java.lang.String _defaultPackage

      Package name to use as prefix for generated classes.

  - ### Constructor Detail

    - #### AbstractTypeMaterializer

          public AbstractTypeMaterializer()

    - #### AbstractTypeMaterializer

          public AbstractTypeMaterializer(java.lang.ClassLoader parentClassLoader)

      Parameters:
        `parentClassLoader` - Class loader to use for generated classes; if null, will use class loader that loaded materializer itself.

  - ### Method Detail

    - #### version

          public com.fasterxml.jackson.core.Version version()

      Method that will return version information stored in and read from jar that contains this class.
      Specified by:
        `version` in interface `com.fasterxml.jackson.core.Versioned`

    - #### isEnabled

          public final boolean isEnabled(AbstractTypeMaterializer.Feature f)

      Method for checking whether given feature is enabled or not

    - #### enable

          public void enable(AbstractTypeMaterializer.Feature f)

      Method for enabling specified feature.

    - #### disable

          public void disable(AbstractTypeMaterializer.Feature f)

      Method for disabling specified feature.

    - #### set

          public void set(AbstractTypeMaterializer.Feature f,
                 boolean state)

      Method for enabling or disabling specified feature.

    - #### setDefaultPackage

          public void setDefaultPackage(java.lang.String defPkg)

      Method for specifying package to use for generated classes.

    - #### resolveAbstractType

          public com.fasterxml.jackson.databind.JavaType resolveAbstractType(com.fasterxml.jackson.databind.DeserializationConfig config,
                                                                    com.fasterxml.jackson.databind.JavaType type)

      Entry-point for `AbstractTypeResolver` that Jackson calls to materialize an abstract type.
      Overrides:
        `resolveAbstractType` in class `com.fasterxml.jackson.databind.AbstractTypeResolver`

    - #### materializeType

          public java.lang.Class<?> materializeType(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config,
                                           com.fasterxml.jackson.databind.JavaType type)

      Method that will find implementation for given abstract class; if called multiple times on same materializer, will return same Class.
      Parameters:
        `config` - Configuration settings to use; mostly needed to be able to access `TypeFactory`
      Since:
        2.4

    - #### materializeGenericType

          public java.lang.Class<?> materializeGenericType(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config,
                                                  com.fasterxml.jackson.databind.JavaType type)

      Since:
        2.4

    - #### materializeRawType

          public java.lang.Class<?> materializeRawType(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config,
                                              java.lang.Class<?> rawType)

      NOTE: should not be called for generic types.
      Since:
        2.4

    - #### materializeClass

          @Deprecated
          public java.lang.Class<?> materializeClass(com.fasterxml.jackson.databind.DeserializationConfig config,
                                                       com.fasterxml.jackson.databind.JavaType type)

      Deprecated. Since 2.4 use `materializeType(MapperConfig, JavaType)` instead