java.lang.Object
tools.jackson.databind.introspect.MixInHandler
- All Implemented Interfaces:
Serializable
,Snapshottable<MixInResolver>
,MixInResolver
Basic
MixInResolver
implementation that both allows simple "local"
override definitions (with simple Mix-in class over Target class mapping)
and allows optional custom overrides for lookup.
Implementation is only thread-safe after initialization (that is, when underlying Map is not modified but only read).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionSimple mix-in targets defined locally.protected final MixInResolver
External resolver that gets called before looking at any locally defined mix-in target classes. -
Constructor Summary
ConstructorsModifierConstructorDescriptionMixInHandler
(MixInResolver overrides) protected
MixInHandler
(MixInResolver overrides, Map<ClassKey, Class<?>> mixins) -
Method Summary
Modifier and TypeMethodDescriptionaddLocalDefinition
(Class<?> target, Class<?> mixinSource) addLocalDefinitions
(Map<Class<?>, Class<?>> sourceMixins) clearLocalDefinitions
(Map<Class<?>, Class<?>> sourceMixins) Class<?>
findMixInClassFor
(Class<?> cls) Method that will check if there are "mix-in" classes (with mix-in annotations) for given classboolean
Method that may be called for optimization purposes, to see if calls to mix-in resolver may be avoided.int
snapshot()
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.Mutant factory method that constructs a new instance that has no locally defined mix-in/target mappings.withOverrides
(MixInResolver overrides) Mutant factory for constructor a new resolver instance with given mix-in resolver override.
-
Field Details
-
_overrides
External resolver that gets called before looking at any locally defined mix-in target classes. -
_localMixIns
Simple mix-in targets defined locally.
-
-
Constructor Details
-
MixInHandler
-
MixInHandler
-
-
Method Details
-
withOverrides
Mutant factory for constructor a new resolver instance with given mix-in resolver override. -
withoutLocalDefinitions
Mutant factory method that constructs a new instance that has no locally defined mix-in/target mappings. -
addLocalDefinitions
-
addLocalDefinition
-
clearLocalDefinitions
-
snapshot
Description copied from interface: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:
snapshot
in interfaceMixInResolver
- Specified by:
snapshot
in interfaceSnapshottable<MixInResolver>
-
findMixInClassFor
Description copied from interface:MixInResolver
Method that will check if there are "mix-in" classes (with mix-in annotations) for given class- Specified by:
findMixInClassFor
in interfaceMixInResolver
-
hasMixIns
public boolean hasMixIns()Description copied from interface:MixInResolver
Method that may be called for optimization purposes, to see if calls to mix-in resolver may be avoided. Return value oftrue
means that it is possible that a mix-in class will be found;false
that no mix-in will ever be found. In latter case caller can avoid calls altogether.Note that the reason for "empty" resolvers is to use "null object" for simplifying calling code.
- Specified by:
hasMixIns
in interfaceMixInResolver
- Returns:
- True, if this resolver MAY have mix-ins to apply; false if not (it is "empty")
-
localSize
public int localSize()
-