Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.introspect

public Class SimpleMixInResolver

extends Object
implements MixInResolver, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver
Imports
java.util.HashMap, .Map, com.fasterxml.jackson.databind.type.ClassKey

Simple implementation of ClassIntrospector.MixInResolver that just uses a java.util.Map 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

Field Summary

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

Simple mix-in targets defined locally.

protected final ClassIntrospector.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

Method Summary

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

public SimpleMixInResolver
copy()

Implements com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver.copy.

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 Class<?>
findMixInClassFor(Class<?> cls)

Implements com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver.findMixInClassFor.

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

public boolean

Returns:

True, if this resolver MAY have mix-ins to apply; false if not (it is "empty")
hasMixIns
()

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

public int
public void
setLocalDefinitions(Map<Class<?>, Class<?>> sourceMixins)

public SimpleMixInResolver
withoutLocalDefinitions()

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

public SimpleMixInResolver
withOverrides(ClassIntrospector.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 ClassIntrospector.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

SimpleMixInResolverback to summary
public SimpleMixInResolver(ClassIntrospector.MixInResolver overrides)
SimpleMixInResolverback to summary
protected SimpleMixInResolver(ClassIntrospector.MixInResolver overrides, Map<ClassKey, Class<?>> mixins)

Method Detail

addLocalDefinitionback to summary
public void addLocalDefinition(Class<?> target, Class<?> mixinSource)
copyback to summary
public SimpleMixInResolver copy()

Implements com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver.copy.

Doc from com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver.copy.

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
findMixInClassForback to summary
public Class<?> findMixInClassFor(Class<?> cls)

Implements com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver.findMixInClassFor.

Doc from com.fasterxml.jackson.databind.introspect.ClassIntrospector.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()

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

Returns:boolean

True, if this resolver MAY have mix-ins to apply; false if not (it is "empty")

Since
2.10.1
localSizeback to summary
public int localSize()
setLocalDefinitionsback to summary
public void setLocalDefinitions(Map<Class<?>, Class<?>> sourceMixins)
withoutLocalDefinitionsback to summary
public SimpleMixInResolver withoutLocalDefinitions()

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

withOverridesback to summary
public SimpleMixInResolver withOverrides(ClassIntrospector.MixInResolver overrides)

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