Class SimpleMixInResolver
- java.lang.Object
-
- com.fasterxml.jackson.databind.introspect.SimpleMixInResolver
-
- All Implemented Interfaces:
ClassIntrospector.MixInResolver
,Serializable
public class SimpleMixInResolver extends Object implements ClassIntrospector.MixInResolver, Serializable
Simple implementation ofClassIntrospector.MixInResolver
that just uses aMap
for containing mapping from target to mix-in classes.Implementation is only thread-safe after initialization (that is, when underlying Map is not modified but only read).
- Since:
- 2.6
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<ClassKey,Class<?>>
_localMixIns
Simple mix-in targets defined locally.protected ClassIntrospector.MixInResolver
_overrides
External resolver that gets called before looking at any locally defined mix-in target classes.
-
Constructor Summary
Constructors Modifier Constructor Description SimpleMixInResolver(ClassIntrospector.MixInResolver overrides)
protected
SimpleMixInResolver(ClassIntrospector.MixInResolver overrides, Map<ClassKey,Class<?>> mixins)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocalDefinition(Class<?> target, Class<?> mixinSource)
SimpleMixInResolver
copy()
Method called to create a new, non-shared copy, to be used by differentObjectMapper
instance, and one that should not be connected to this instance, if resolver has mutable state.Class<?>
findMixInClassFor(Class<?> cls)
Method that will check if there are "mix-in" classes (with mix-in annotations) for given classint
localSize()
void
setLocalDefinitions(Map<Class<?>,Class<?>> sourceMixins)
SimpleMixInResolver
withoutLocalDefinitions()
Mutant factory method that constructs a new instance that has no locally defined mix-in/target mappings.SimpleMixInResolver
withOverrides(ClassIntrospector.MixInResolver overrides)
Mutant factory for constructor a new resolver instance with given mix-in resolver override.
-
-
-
Field Detail
-
_overrides
protected final ClassIntrospector.MixInResolver _overrides
External resolver that gets called before looking at any locally defined mix-in target classes.
-
-
Constructor Detail
-
SimpleMixInResolver
public SimpleMixInResolver(ClassIntrospector.MixInResolver overrides)
-
SimpleMixInResolver
protected SimpleMixInResolver(ClassIntrospector.MixInResolver overrides, Map<ClassKey,Class<?>> mixins)
-
-
Method Detail
-
withOverrides
public SimpleMixInResolver withOverrides(ClassIntrospector.MixInResolver overrides)
Mutant factory for constructor a new resolver instance with given mix-in resolver override.
-
withoutLocalDefinitions
public SimpleMixInResolver withoutLocalDefinitions()
Mutant factory method that constructs a new instance that has no locally defined mix-in/target mappings.
-
copy
public SimpleMixInResolver copy()
Description copied from interface:ClassIntrospector.MixInResolver
Method called to create a new, non-shared copy, to be used by differentObjectMapper
instance, and one that should not be connected to this instance, if resolver has mutable state. If resolver is immutable may simply return `this`.- Specified by:
copy
in interfaceClassIntrospector.MixInResolver
-
findMixInClassFor
public Class<?> findMixInClassFor(Class<?> cls)
Description copied from interface:ClassIntrospector.MixInResolver
Method that will check if there are "mix-in" classes (with mix-in annotations) for given class- Specified by:
findMixInClassFor
in interfaceClassIntrospector.MixInResolver
-
localSize
public int localSize()
-
-