com.fasterxml.jackson.databind

## Class DatabindContext

- java.lang.Object
- - com.fasterxml.jackson.databind.DatabindContext

- Direct Known Subclasses:
    DeserializationContext, SerializerProvider

      public abstract class DatabindContext
      extends Object

  Shared base class for `DeserializationContext` and `SerializerProvider`, context objects passed through data-binding process. Designed so that some of implementations can rely on shared aspects like access to secondary contextual objects like type factories or handler instantiators.
  Since:
    2.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatabindContext()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canOverrideAccessModifiers()` Convenience method for accessing serialization view in use (if any); equivalent to:
    `JavaType` | `constructSpecializedType(JavaType baseType, Class<?> subclass)` Convenience method for constructing subtypes, retaining generic type parameter (if any)
    `JavaType` | `constructType(Type type)` Convenience method for constructing `JavaType` for given JDK type (usually `Class`)
    `Converter<Object,Object>` | `converterInstance(Annotated annotated, Object converterDef)` Helper method to use to construct a `Converter`, given a definition that may be either actual converter instance, or Class for instantiating one.
    `abstract Class<?>` | `getActiveView()` Accessor for locating currently active view, if any; returns null if no view has been set.
    `abstract AnnotationIntrospector` | `getAnnotationIntrospector()` Convenience method for accessing serialization view in use (if any); equivalent to:
    `abstract MapperConfig<?>` | `getConfig()` Accessor to currently active configuration (both per-request configs and per-mapper config).
    `abstract TypeFactory` | `getTypeFactory()`
    `boolean` | `isEnabled(MapperFeature feature)` Convenience method for checking whether specified serialization feature is enabled or not.
    `ObjectIdGenerator<?>` | `objectIdGeneratorInstance(Annotated annotated, ObjectIdInfo objectIdInfo)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DatabindContext

          public DatabindContext()

  - ### Method Detail

    - #### getConfig

          public abstract MapperConfig<?> getConfig()

      Accessor to currently active configuration (both per-request configs and per-mapper config).

    - #### getAnnotationIntrospector

          public abstract AnnotationIntrospector getAnnotationIntrospector()

      Convenience method for accessing serialization view in use (if any); equivalent to:

             getConfig().getAnnotationIntrospector();

    - #### isEnabled

          public final boolean isEnabled(MapperFeature feature)

      Convenience method for checking whether specified serialization feature is enabled or not. Shortcut for:

            getConfig().isEnabled(feature);

    - #### canOverrideAccessModifiers

          public final boolean canOverrideAccessModifiers()

      Convenience method for accessing serialization view in use (if any); equivalent to:

             getConfig().canOverrideAccessModifiers();

    - #### getActiveView

          public abstract Class<?> getActiveView()

      Accessor for locating currently active view, if any; returns null if no view has been set.

    - #### constructType

          public JavaType constructType(Type type)

      Convenience method for constructing `JavaType` for given JDK type (usually `Class`)

    - #### constructSpecializedType

          public JavaType constructSpecializedType(JavaType baseType,
                                          Class<?> subclass)

      Convenience method for constructing subtypes, retaining generic type parameter (if any)

    - #### getTypeFactory

          public abstract TypeFactory getTypeFactory()

    - #### objectIdGeneratorInstance

          public ObjectIdGenerator<?> objectIdGeneratorInstance(Annotated annotated,
                                                       ObjectIdInfo objectIdInfo)
                                                         throws JsonMappingException

      Throws:
        `JsonMappingException`

    - #### converterInstance

          public Converter<Object,Object> converterInstance(Annotated annotated,
                                                   Object converterDef)
                                                     throws JsonMappingException

      Helper method to use to construct a `Converter`, given a definition that may be either actual converter instance, or Class for instantiating one.
      Throws:
        `JsonMappingException`
      Since:
        2.2

Copyright © 2012-2013 FasterXML. All Rights Reserved.