Class AbstractTypeMaterializer
java.lang.Object
org.codehaus.jackson.map.AbstractTypeResolver
org.codehaus.jackson.mrbean.AbstractTypeMaterializer
- All Implemented Interfaces:
Versioned
Nifty class for pulling implementations of classes out of thin air.
... friends call him Mister Bean... :-)
- Since:
- 1.6
- Author:
- tatu, sunny
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration that defines togglable features that guide the serialization feature. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.codehaus.jackson.mrbean.AbstractTypeMaterializer.MyClassLoaderWe 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 StringPackage name to use as prefix for generated classes.protected intBit set that contains all enabled featuresprotected static final intBitfield (set of flags) of all Features that are enabled by default.static final StringDefault package to use for generated classes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod for disabling specified feature.voidMethod for enabling specified feature.final booleanMethod for checking whether given feature is enabled or notprotected Class<?> materializeClass(DeserializationConfig config, Class<?> cls) resolveAbstractType(DeserializationConfig config, JavaType type) Method called to try to resolve an abstract type into concrete type (usually for purposes of deserializing), when no concrete implementation was found.voidset(AbstractTypeMaterializer.Feature f, boolean state) Method for enabling or disabling specified feature.voidsetDefaultPackage(String defPkg) version()Method that will return version information stored in and read from jar that contains this class.Methods inherited from class AbstractTypeResolver
findTypeMapping
-
Field Details
-
DEFAULT_FEATURE_FLAGS
protected static final int DEFAULT_FEATURE_FLAGSBitfield (set of flags) of all Features that are enabled by default. -
DEFAULT_PACKAGE_FOR_GENERATED
Default package to use for generated classes.- See Also:
-
_classLoader
protected final org.codehaus.jackson.mrbean.AbstractTypeMaterializer.MyClassLoader _classLoaderWe 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 _featureFlagsBit set that contains all enabled features -
_defaultPackage
Package name to use as prefix for generated classes.
-
-
Constructor Details
-
AbstractTypeMaterializer
public AbstractTypeMaterializer() -
AbstractTypeMaterializer
-
-
Method Details
-
version
-
isEnabled
Method for checking whether given feature is enabled or not -
enable
Method for enabling specified feature. -
disable
Method for disabling specified feature. -
set
Method for enabling or disabling specified feature. -
setDefaultPackage
-
resolveAbstractType
Description copied from class:AbstractTypeResolverMethod called to try to resolve an abstract type into concrete type (usually for purposes of deserializing), when no concrete implementation was found. It will be called after checking all other possibilities, including defaulting.- Overrides:
resolveAbstractTypein classAbstractTypeResolver- Parameters:
config- Configuration in use; should always be of typeDeserializationConfigtype- Type for which materialization maybe needed- Returns:
- Resolved concrete type (which should retain generic type parameters of input type, if any), if resolution succeeds; null if resolver does not know how to resolve type
-
materializeClass
-