org.codehaus.jackson.map
Interface MapperConfig<T extends MapperConfig<T>>

All Superinterfaces:
ClassIntrospector.MixInResolver
All Known Implementing Classes:
DeserializationConfig, SerializationConfig

public interface MapperConfig<T extends MapperConfig<T>>
extends ClassIntrospector.MixInResolver

Interface that defines functionality accessible through both serialization and deserialization configuration objects; accessors to mode-independent configuration settings and such.

Since:
1.2

Method Summary
 void addMixInAnnotations(Class<?> target, Class<?> mixinSource)
          Method to use for adding mix-in annotations to use for augmenting specified class or interface.
 void appendAnnotationIntrospector(AnnotationIntrospector ai)
          Method for registering specified AnnotationIntrospector as the lowest priority introspector, chained with existing introspector(s) and called as fallback for cases not otherwise handled.
 T createUnshared(TypeResolverBuilder<?> typer, VisibilityChecker<?> vc, SubtypeResolver subtypeResolver)
          Method to use for constructing an instance that is not shared between multiple operations but only used for a single one.
 Class<?> findMixInClassFor(Class<?> cls)
          Method that will check if there are "mix-in" classes (with mix-in annotations) for given class
 void fromAnnotations(Class<?> cls)
          Method that checks class annotations that the argument Object has, and modifies settings of this configuration object accordingly, similar to how those annotations would affect actual value classes annotated with them, but with global scope.
 AnnotationIntrospector getAnnotationIntrospector()
           
 DateFormat getDateFormat()
          Method for accessing currently configured (textual) date format that will be used for reading or writing date values (in case of writing, only if textual output is configured; not if dates are to be serialized as time stamps).
 TypeResolverBuilder<?> getDefaultTyper(JavaType baseType)
          Method called to locate a type info handler for types that do not have one explicitly declared via annotations (or other configuration).
 VisibilityChecker<?> getDefaultVisibilityChecker()
          Accessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers).
 SubtypeResolver getSubtypeResolver()
          Accessor for object used for finding out all reachable subtypes for supertypes; needed when a logical type name is used instead of class name (or custom scheme).
 void insertAnnotationIntrospector(AnnotationIntrospector introspector)
          Method for registering specified AnnotationIntrospector as the highest priority introspector (will be chained with existing introspector(s) which will be used as fallbacks for cases this introspector does not handle)
<DESC extends BeanDescription>
DESC
introspectClassAnnotations(Class<?> cls)
          Accessor for getting bean description that only contains class annotations: useful if no getter/setter/creator information is needed.
<DESC extends BeanDescription>
DESC
introspectDirectClassAnnotations(Class<?> cls)
          Accessor for getting bean description that only contains immediate class annotations: ones from the class, and its direct mix-in, if any, but not from super types.
 void setAnnotationIntrospector(AnnotationIntrospector introspector)
          Method for replacing existing annotation introspector(s) with specified introspector.
 void setDateFormat(DateFormat df)
          Method that wiTll define specific date format to use for reading/writing Date and Calendar values; instance is used as is, without creating a clone.
 void setIntrospector(ClassIntrospector<? extends BeanDescription> i)
          Method for replacing existing ClassIntrospector with specified replacement.
 void setMixInAnnotations(Map<Class<?>,Class<?>> mixins)
          Method to use for defining mix-in annotations to use for augmenting annotations that processable (serializable / deserializable) classes have.
 void setSubtypeResolver(SubtypeResolver r)
          Method for overriding subtype resolver used.
 

Method Detail

fromAnnotations

void fromAnnotations(Class<?> cls)
Method that checks class annotations that the argument Object has, and modifies settings of this configuration object accordingly, similar to how those annotations would affect actual value classes annotated with them, but with global scope. Note that not all annotations have global significance, and thus only subset of Jackson annotations will have any effect.


createUnshared

T createUnshared(TypeResolverBuilder<?> typer,
                 VisibilityChecker<?> vc,
                 SubtypeResolver subtypeResolver)
Method to use for constructing an instance that is not shared between multiple operations but only used for a single one.


getAnnotationIntrospector

AnnotationIntrospector getAnnotationIntrospector()

setAnnotationIntrospector

void setAnnotationIntrospector(AnnotationIntrospector introspector)
Method for replacing existing annotation introspector(s) with specified introspector.


insertAnnotationIntrospector

void insertAnnotationIntrospector(AnnotationIntrospector introspector)
Method for registering specified AnnotationIntrospector as the highest priority introspector (will be chained with existing introspector(s) which will be used as fallbacks for cases this introspector does not handle)

Parameters:
introspector - Annotation introspector to register.
Since:
1.7

appendAnnotationIntrospector

void appendAnnotationIntrospector(AnnotationIntrospector ai)
Method for registering specified AnnotationIntrospector as the lowest priority introspector, chained with existing introspector(s) and called as fallback for cases not otherwise handled.

Parameters:
ai - Annotation introspector to register.
Since:
1.7

setIntrospector

void setIntrospector(ClassIntrospector<? extends BeanDescription> i)
Method for replacing existing ClassIntrospector with specified replacement.


setMixInAnnotations

void setMixInAnnotations(Map<Class<?>,Class<?>> mixins)
Method to use for defining mix-in annotations to use for augmenting annotations that processable (serializable / deserializable) classes have. Mixing in is done when introspecting class annotations and properties. Map passed contains keys that are target classes (ones to augment with new annotation overrides), and values that are source classes (have annotations to use for augmentation). Annotations from source classes (and their supertypes) will override annotations that target classes (and their super-types) have.

Since:
1.2

addMixInAnnotations

void addMixInAnnotations(Class<?> target,
                         Class<?> mixinSource)
Method to use for adding mix-in annotations to use for augmenting specified class or interface. All annotations from mixinSource are taken to override annotations that target (or its supertypes) has.

Parameters:
target - Class (or interface) whose annotations to effectively override
mixinSource - Class (or interface) whose annotations are to be "added" to target's annotations, overriding as necessary
Since:
1.2

findMixInClassFor

Class<?> findMixInClassFor(Class<?> cls)
Method that will check if there are "mix-in" classes (with mix-in annotations) for given class

Specified by:
findMixInClassFor in interface ClassIntrospector.MixInResolver

getDateFormat

DateFormat getDateFormat()
Method for accessing currently configured (textual) date format that will be used for reading or writing date values (in case of writing, only if textual output is configured; not if dates are to be serialized as time stamps).

Note that typically DateFormat instances are not thread-safe (at least ones provided by JDK): this means that calling code should clone format instance before using it.

This method is usually only called by framework itself, since there are convenience methods available via DeserializationContext and SerializerProvider that take care of cloning and thread-safe reuse.


setDateFormat

void setDateFormat(DateFormat df)
Method that wiTll define specific date format to use for reading/writing Date and Calendar values; instance is used as is, without creating a clone. Format object can be access using getDateFormat().


getDefaultTyper

TypeResolverBuilder<?> getDefaultTyper(JavaType baseType)
Method called to locate a type info handler for types that do not have one explicitly declared via annotations (or other configuration). If such default handler is configured, it is returned; otherwise null is returned.

Since:
1.5

getDefaultVisibilityChecker

VisibilityChecker<?> getDefaultVisibilityChecker()
Accessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers). Can be changed to allow different minimum visibility levels for auto-detection. Note that this is the global handler; individual types (classes) can further override active checker used (using JsonAutoDetect annotation)

Since:
1.5

getSubtypeResolver

SubtypeResolver getSubtypeResolver()
Accessor for object used for finding out all reachable subtypes for supertypes; needed when a logical type name is used instead of class name (or custom scheme).

Since:
1.6

setSubtypeResolver

void setSubtypeResolver(SubtypeResolver r)
Method for overriding subtype resolver used.

Since:
1.6

introspectClassAnnotations

<DESC extends BeanDescription> DESC introspectClassAnnotations(Class<?> cls)
Accessor for getting bean description that only contains class annotations: useful if no getter/setter/creator information is needed.

Since:
1.7

introspectDirectClassAnnotations

<DESC extends BeanDescription> DESC introspectDirectClassAnnotations(Class<?> cls)
Accessor for getting bean description that only contains immediate class annotations: ones from the class, and its direct mix-in, if any, but not from super types.