Top Description Fields Constructors Methods
tools.jackson.databind.introspect

public Class MixInHandler

extends Object
implements MixInResolver, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, tools.jackson.databind.introspect.MixInResolver, tools.jackson.core.util.Snapshottable
Imports
java.util.HashMap, .Map, tools.jackson.core.util.Snapshottable, tools.jackson.databind.type.ClassKey

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).

Field Summary

Modifier and TypeField and Description
protected Map<ClassKey, Class<?>>
_localMixIns

Simple mix-in targets defined locally.

protected final MixInResolver
_overrides

External resolver that gets called before looking at any locally defined mix-in target classes.

private static final long

Constructor Summary

AccessConstructor and Description
public
protected
MixInHandler(MixInResolver overrides, Map<ClassKey, Class<?>> mixins)

Method Summary

Modifier and TypeMethod and Description
public MixInHandler
addLocalDefinition(Class<?> target, Class<?> mixinSource)

public MixInHandler
addLocalDefinitions(Map<Class<?>, Class<?>> sourceMixins)

public MixInHandler
clearLocalDefinitions(Map<Class<?>, Class<?>> sourceMixins)

public Class<?>
findMixInClassFor(Class<?> cls)

Implements tools.jackson.databind.introspect.MixInResolver.findMixInClassFor.

Method that will check if there are "mix-in" classes (with mix-in annotations) for given class

public boolean
hasMixIns()

Implements tools.jackson.databind.introspect.MixInResolver.hasMixIns.

Method that may be called for optimization purposes, to see if calls to mix-in resolver may be avoided.

public int
public MixInHandler
snapshot()

Implements tools.jackson.databind.introspect.MixInResolver.snapshot.

Method called to create a new, non-shared copy, to be used by different ObjectMapper instance, and one that should not be connected to this instance, if resolver has mutable state.

public MixInHandler
withoutLocalDefinitions()

Mutant factory method that constructs a new instance that has no locally defined mix-in/target mappings.

public MixInHandler
withOverrides(MixInResolver overrides)

Mutant factory for constructor a new resolver instance with given mix-in resolver override.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_localMixInsback to summary
protected Map<ClassKey, Class<?>> _localMixIns

Simple mix-in targets defined locally.

_overridesback to summary
protected final MixInResolver _overrides

External resolver that gets called before looking at any locally defined mix-in target classes.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

MixInHandlerback to summary
public MixInHandler(MixInResolver overrides)
MixInHandlerback to summary
protected MixInHandler(MixInResolver overrides, Map<ClassKey, Class<?>> mixins)

Method Detail

addLocalDefinitionback to summary
public MixInHandler addLocalDefinition(Class<?> target, Class<?> mixinSource)
addLocalDefinitionsback to summary
public MixInHandler addLocalDefinitions(Map<Class<?>, Class<?>> sourceMixins)
clearLocalDefinitionsback to summary
public MixInHandler clearLocalDefinitions(Map<Class<?>, Class<?>> sourceMixins)
findMixInClassForback to summary
public Class<?> findMixInClassFor(Class<?> cls)

Implements tools.jackson.databind.introspect.MixInResolver.findMixInClassFor.

Doc from tools.jackson.databind.introspect.MixInResolver.findMixInClassFor.

Method that will check if there are "mix-in" classes (with mix-in annotations) for given class

Annotations
@Override
hasMixInsback to summary
public boolean hasMixIns()

Implements tools.jackson.databind.introspect.MixInResolver.hasMixIns.

Doc from tools.jackson.databind.introspect.MixInResolver.hasMixIns.

Method that may be called for optimization purposes, to see if calls to mix-in resolver may be avoided. Return value of true 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.

Annotations
@Override
localSizeback to summary
public int localSize()
snapshotback to summary
public MixInHandler snapshot()

Implements tools.jackson.databind.introspect.MixInResolver.snapshot.

Doc from tools.jackson.databind.introspect.MixInResolver.snapshot.

Method called to create a new, non-shared copy, to be used by different ObjectMapper instance, and one that should not be connected to this instance, if resolver has mutable state. If resolver is immutable may simply return `this`.

Annotations
@Override
withoutLocalDefinitionsback to summary
public MixInHandler withoutLocalDefinitions()

Mutant factory method that constructs a new instance that has no locally defined mix-in/target mappings.

withOverridesback to summary
public MixInHandler withOverrides(MixInResolver overrides)

Mutant factory for constructor a new resolver instance with given mix-in resolver override.