com.fasterxml.jackson.databind.introspect

## Class BasicBeanDescription

- java.lang.Object
- - com.fasterxml.jackson.databind.BeanDescription
  - - com.fasterxml.jackson.databind.introspect.BasicBeanDescription

-     public class BasicBeanDescription
      extends BeanDescription

  Default `BeanDescription` implementation used by Jackson.

  Although sub-classing is a theoretical possibility there are no known use cases for that, nor is such usage tested or supported. Separation from API is mostly to isolate some implementation details here and keep API simple.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AnnotationIntrospector` | `_annotationIntrospector`
    `protected AnnotatedClass` | `_classInfo` Information collected about the class introspected.
    `protected MapperConfig<?>` | `_config`
    `protected ObjectIdInfo` | `_objectIdInfo` Details of Object Id to include, if any
    `protected POJOPropertiesCollector` | `_propCollector` We will hold a reference to the collector in cases where information is lazily accessed and constructed; properties are only accessed when they are actually needed.
    `protected java.util.List<BeanPropertyDefinition>` | `_properties` Properties collected for the POJO; initialized as needed.

    - ### Fields inherited from class com.fasterxml.jackson.databind.BeanDescription

      `_type`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BasicBeanDescription(MapperConfig<?> config, JavaType type, AnnotatedClass classDef, java.util.List<BeanPropertyDefinition> props)` Alternate constructor used in cases where property information is not needed, only class info.
    `protected` | `BasicBeanDescription(POJOPropertiesCollector coll)`
    `protected` | `BasicBeanDescription(POJOPropertiesCollector coll, JavaType type, AnnotatedClass classDef)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Converter<java.lang.Object,java.lang.Object>` | `_createConverter(java.lang.Object converterDef)`
    `protected PropertyName` | `_findCreatorPropertyName(AnnotatedParameter param)` Deprecated. since 2.8
    `java.util.LinkedHashMap<java.lang.String,AnnotatedField>` | `_findPropertyFields(java.util.Collection<java.lang.String> ignoredProperties, boolean forSerialization)` Deprecated. Since 2.7.2, does not seem to be used?
    `protected java.util.List<BeanPropertyDefinition>` | `_properties()`
    `boolean` | `addProperty(BeanPropertyDefinition def)`
    `TypeBindings` | `bindingsForBeanType()` Deprecated.
    `AnnotatedMember` | `findAnyGetter()` Method used to locate the method of introspected class that implements `JsonAnyGetter`.
    `AnnotatedMethod` | `findAnySetter()` Method used to locate the method of introspected class that implements `JsonAnySetter`.
    `AnnotatedMember` | `findAnySetterField()` Method used to locate the field of the class that implements `JsonAnySetter` If no such method exists null is returned.
    `java.util.Map<java.lang.String,AnnotatedMember>` | `findBackReferenceProperties()` Method for locating all back-reference properties (setters, fields) bean has
    `java.lang.String` | `findClassDescription()` Accessor for possible description for the bean type, used for constructing documentation.
    `AnnotatedConstructor` | `findDefaultConstructor()` Method that will locate the no-arg constructor for this class, if it has one, and that constructor has not been marked as ignorable.
    `Converter<java.lang.Object,java.lang.Object>` | `findDeserializationConverter()` Method for finding `Converter` used for serializing instances of this class.
    `com.fasterxml.jackson.annotation.JsonFormat.Value` | `findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat.Value defValue)` Method for checking what is the expected format for POJO, as defined by defaults and possible annotations.
    `java.lang.reflect.Method` | `findFactoryMethod(java.lang.Class<?>... expArgTypes)` Method that can be called to find if introspected class declares a static "valueOf" factory method that returns an instance of introspected type, given one of acceptable types.
    `java.util.Map<java.lang.Object,AnnotatedMember>` | `findInjectables()`
    `AnnotatedMethod` | `findJsonValueMethod()` Method for locating the getter method that is annotated with `JsonValue` annotation, if any.
    `AnnotatedMethod` | `findMethod(java.lang.String name, java.lang.Class<?>[] paramTypes)`
    `java.lang.Class<?>` | `findPOJOBuilder()` Method for checking if the POJO type has annotations to indicate that a builder is to be used for instantiating instances and handling data binding, instead of standard bean deserializer.
    `JsonPOJOBuilder.Value` | `findPOJOBuilderConfig()` Method for finding configuration for POJO Builder class.
    `java.util.List<BeanPropertyDefinition>` | `findProperties()`
    `BeanPropertyDefinition` | `findProperty(PropertyName name)`
    `com.fasterxml.jackson.annotation.JsonInclude.Value` | `findPropertyInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value defValue)` Method for determining whether null properties should be written out for a Bean of introspected type.
    `Converter<java.lang.Object,java.lang.Object>` | `findSerializationConverter()` Method for finding `Converter` used for serializing instances of this class.
    `java.lang.reflect.Constructor<?>` | `findSingleArgConstructor(java.lang.Class<?>... argTypes)` Method that can be called to locate a single-arg constructor that takes specified exact type (will not accept supertype constructors)
    `static BasicBeanDescription` | `forDeserialization(POJOPropertiesCollector coll)` Factory method to use for constructing an instance to use for building deserializers.
    `static BasicBeanDescription` | `forOtherUse(MapperConfig<?> config, JavaType type, AnnotatedClass ac)` Factory method to use for constructing an instance to use for purposes other than building serializers or deserializers; will only have information on class, not on properties.
    `static BasicBeanDescription` | `forSerialization(POJOPropertiesCollector coll)` Factory method to use for constructing an instance to use for building serializers.
    `Annotations` | `getClassAnnotations()` Method for accessing collection of annotations the bean class has.
    `AnnotatedClass` | `getClassInfo()` Method for accessing low-level information about Class this item describes.
    `java.util.List<AnnotatedConstructor>` | `getConstructors()`
    `java.util.List<AnnotatedMethod>` | `getFactoryMethods()`
    `java.util.Set<java.lang.String>` | `getIgnoredPropertyNames()`
    `ObjectIdInfo` | `getObjectIdInfo()` Accessor for getting information about Object Id expected to be used for this POJO type, if any.
    `boolean` | `hasKnownClassAnnotations()` Method for checking whether class being described has any annotations recognized by registered annotation introspector.
    `boolean` | `hasProperty(PropertyName name)`
    `java.lang.Object` | `instantiateBean(boolean fixAccess)` Method called to create a "default instance" of the bean, currently only needed for obtaining default field values which may be used for suppressing serialization of fields that have "not changed".
    `protected boolean` | `isFactoryMethod(AnnotatedMethod am)`
    `boolean` | `removeProperty(java.lang.String propName)` Method that can be used to prune unwanted properties, during construction of serializers and deserializers.
    `JavaType` | `resolveType(java.lang.reflect.Type jdkType)` Deprecated.

    - ### Methods inherited from class com.fasterxml.jackson.databind.BeanDescription

      `getBeanClass, getType`

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

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

- - ### Field Detail

    - #### _propCollector

          protected final POJOPropertiesCollector _propCollector

      We will hold a reference to the collector in cases where information is lazily accessed and constructed; properties are only accessed when they are actually needed.

    - #### _config

          protected final MapperConfig<?> _config

    - #### _annotationIntrospector

          protected final AnnotationIntrospector _annotationIntrospector

    - #### _classInfo

          protected final AnnotatedClass _classInfo

      Information collected about the class introspected.

    - #### _properties

          protected java.util.List<BeanPropertyDefinition> _properties

      Properties collected for the POJO; initialized as needed.

    - #### _objectIdInfo

          protected ObjectIdInfo _objectIdInfo

      Details of Object Id to include, if any

  - ### Constructor Detail

    - #### BasicBeanDescription

          protected BasicBeanDescription(POJOPropertiesCollector coll,
                              JavaType type,
                              AnnotatedClass classDef)

    - #### BasicBeanDescription

          protected BasicBeanDescription(MapperConfig<?> config,
                              JavaType type,
                              AnnotatedClass classDef,
                              java.util.List<BeanPropertyDefinition> props)

      Alternate constructor used in cases where property information is not needed, only class info.

    - #### BasicBeanDescription

          protected BasicBeanDescription(POJOPropertiesCollector coll)

  - ### Method Detail

    - #### forDeserialization

          public static BasicBeanDescription forDeserialization(POJOPropertiesCollector coll)

      Factory method to use for constructing an instance to use for building deserializers.

    - #### forSerialization

          public static BasicBeanDescription forSerialization(POJOPropertiesCollector coll)

      Factory method to use for constructing an instance to use for building serializers.

    - #### forOtherUse

          public static BasicBeanDescription forOtherUse(MapperConfig<?> config,
                                         JavaType type,
                                         AnnotatedClass ac)

      Factory method to use for constructing an instance to use for purposes other than building serializers or deserializers; will only have information on class, not on properties.

    - #### _properties

          protected java.util.List<BeanPropertyDefinition> _properties()

    - #### removeProperty

          public boolean removeProperty(java.lang.String propName)

      Method that can be used to prune unwanted properties, during construction of serializers and deserializers. Use with utmost care, if at all...
      Since:
        2.1

    - #### addProperty

          public boolean addProperty(BeanPropertyDefinition def)

    - #### hasProperty

          public boolean hasProperty(PropertyName name)

      Since:
        2.6

    - #### findProperty

          public BeanPropertyDefinition findProperty(PropertyName name)

      Since:
        2.6

    - #### getClassInfo

          public AnnotatedClass getClassInfo()

      Description copied from class: `BeanDescription`
      Method for accessing low-level information about Class this item describes.
      Specified by:
        `getClassInfo` in class `BeanDescription`

    - #### getObjectIdInfo

          public ObjectIdInfo getObjectIdInfo()

      Description copied from class: `BeanDescription`
      Accessor for getting information about Object Id expected to be used for this POJO type, if any.
      Specified by:
        `getObjectIdInfo` in class `BeanDescription`

    - #### findProperties

          public java.util.List<BeanPropertyDefinition> findProperties()

      Specified by:
        `findProperties` in class `BeanDescription`
      Returns:
        Ordered Map with logical property name as key, and matching getter method as value.

    - #### findJsonValueMethod

          public AnnotatedMethod findJsonValueMethod()

      Description copied from class: `BeanDescription`
      Method for locating the getter method that is annotated with `JsonValue` annotation, if any. If multiple ones are found, an error is reported by throwing `IllegalArgumentException`
      Specified by:
        `findJsonValueMethod` in class `BeanDescription`

    - #### getIgnoredPropertyNames

          public java.util.Set<java.lang.String> getIgnoredPropertyNames()

      Specified by:
        `getIgnoredPropertyNames` in class `BeanDescription`

    - #### hasKnownClassAnnotations

          public boolean hasKnownClassAnnotations()

      Description copied from class: `BeanDescription`
      Method for checking whether class being described has any annotations recognized by registered annotation introspector.
      Specified by:
        `hasKnownClassAnnotations` in class `BeanDescription`

    - #### getClassAnnotations

          public Annotations getClassAnnotations()

      Description copied from class: `BeanDescription`
      Method for accessing collection of annotations the bean class has.
      Specified by:
        `getClassAnnotations` in class `BeanDescription`

    - #### bindingsForBeanType

          @Deprecated
          public TypeBindings bindingsForBeanType()

      Deprecated.
      Description copied from class: `BeanDescription`
      Accessor for type bindings that may be needed to fully resolve types of member object, such as return and argument types of methods and constructors, and types of fields.
      Specified by:
        `bindingsForBeanType` in class `BeanDescription`

    - #### resolveType

          @Deprecated
          public JavaType resolveType(java.lang.reflect.Type jdkType)

      Deprecated.
      Description copied from class: `BeanDescription`
      Method for resolving given JDK type, using this bean as the generic type resolution context.
      Specified by:
        `resolveType` in class `BeanDescription`

    - #### findDefaultConstructor

          public AnnotatedConstructor findDefaultConstructor()

      Description copied from class: `BeanDescription`
      Method that will locate the no-arg constructor for this class, if it has one, and that constructor has not been marked as ignorable.
      Specified by:
        `findDefaultConstructor` in class `BeanDescription`

    - #### findAnySetter

          public AnnotatedMethod findAnySetter()
                                        throws java.lang.IllegalArgumentException

      Description copied from class: `BeanDescription`
      Method used to locate the method of introspected class that implements `JsonAnySetter`. If no such method exists null is returned. If more than one are found, an exception is thrown. Additional checks are also made to see that method signature is acceptable: needs to take 2 arguments, first one String or Object; second any can be any type.
      Specified by:
        `findAnySetter` in class `BeanDescription`
      Throws:
        `java.lang.IllegalArgumentException`

    - #### findInjectables

          public java.util.Map<java.lang.Object,AnnotatedMember> findInjectables()

      Specified by:
        `findInjectables` in class `BeanDescription`

    - #### getConstructors

          public java.util.List<AnnotatedConstructor> getConstructors()

      Specified by:
        `getConstructors` in class `BeanDescription`

    - #### instantiateBean

          public java.lang.Object instantiateBean(boolean fixAccess)

      Description copied from class: `BeanDescription`
      Method called to create a "default instance" of the bean, currently only needed for obtaining default field values which may be used for suppressing serialization of fields that have "not changed".
      Specified by:
        `instantiateBean` in class `BeanDescription`
      Parameters:
        `fixAccess` - If true, method is allowed to fix access to the default constructor (to be able to call non-public constructor); if false, has to use constructor as is.
      Returns:
        Instance of class represented by this descriptor, if suitable default constructor was found; null otherwise.

    - #### findMethod

          public AnnotatedMethod findMethod(java.lang.String name,
                                   java.lang.Class<?>[] paramTypes)

      Specified by:
        `findMethod` in class `BeanDescription`

    - #### findExpectedFormat

          public com.fasterxml.jackson.annotation.JsonFormat.Value findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat.Value defValue)

      Description copied from class: `BeanDescription`
      Method for checking what is the expected format for POJO, as defined by defaults and possible annotations. Note that this may be further refined by per-property annotations.
      Specified by:
        `findExpectedFormat` in class `BeanDescription`

    - #### findSerializationConverter

          public Converter<java.lang.Object,java.lang.Object> findSerializationConverter()

      Description copied from class: `BeanDescription`
      Method for finding `Converter` used for serializing instances of this class.
      Specified by:
        `findSerializationConverter` in class `BeanDescription`

    - #### findPropertyInclusion

          public com.fasterxml.jackson.annotation.JsonInclude.Value findPropertyInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value defValue)

      Method for determining whether null properties should be written out for a Bean of introspected type. This is based on global feature (lowest priority, passed as argument) and per-class annotation (highest priority).
      Specified by:
        `findPropertyInclusion` in class `BeanDescription`

    - #### findAnyGetter

          public AnnotatedMember findAnyGetter()
                                        throws java.lang.IllegalArgumentException

      Method used to locate the method of introspected class that implements `JsonAnyGetter`. If no such method exists null is returned. If more than one are found, an exception is thrown.
      Specified by:
        `findAnyGetter` in class `BeanDescription`
      Throws:
        `java.lang.IllegalArgumentException`

    - #### findAnySetterField

          public AnnotatedMember findAnySetterField()
                                             throws java.lang.IllegalArgumentException

      Description copied from class: `BeanDescription`
      Method used to locate the field of the class that implements `JsonAnySetter` If no such method exists null is returned. If more than one are found, an exception is thrown.
      Specified by:
        `findAnySetterField` in class `BeanDescription`
      Throws:
        `java.lang.IllegalArgumentException`

    - #### findBackReferenceProperties

          public java.util.Map<java.lang.String,AnnotatedMember> findBackReferenceProperties()

      Description copied from class: `BeanDescription`
      Method for locating all back-reference properties (setters, fields) bean has
      Specified by:
        `findBackReferenceProperties` in class `BeanDescription`

    - #### getFactoryMethods

          public java.util.List<AnnotatedMethod> getFactoryMethods()

      Specified by:
        `getFactoryMethods` in class `BeanDescription`

    - #### findSingleArgConstructor

          public java.lang.reflect.Constructor<?> findSingleArgConstructor(java.lang.Class<?>... argTypes)

      Description copied from class: `BeanDescription`
      Method that can be called to locate a single-arg constructor that takes specified exact type (will not accept supertype constructors)
      Specified by:
        `findSingleArgConstructor` in class `BeanDescription`
      Parameters:
        `argTypes` - Type(s) of the argument that we are looking for

    - #### findFactoryMethod

          public java.lang.reflect.Method findFactoryMethod(java.lang.Class<?>... expArgTypes)

      Description copied from class: `BeanDescription`
      Method that can be called to find if introspected class declares a static "valueOf" factory method that returns an instance of introspected type, given one of acceptable types.
      Specified by:
        `findFactoryMethod` in class `BeanDescription`
      Parameters:
        `expArgTypes` - Types that the matching single argument factory method can take: will also accept super types of these types (ie. arg just has to be assignable from expArgType)

    - #### isFactoryMethod

          protected boolean isFactoryMethod(AnnotatedMethod am)

    - #### _findCreatorPropertyName

          @Deprecated
          protected PropertyName _findCreatorPropertyName(AnnotatedParameter param)

      Deprecated. since 2.8

    - #### findPOJOBuilder

          public java.lang.Class<?> findPOJOBuilder()

      Description copied from class: `BeanDescription`
      Method for checking if the POJO type has annotations to indicate that a builder is to be used for instantiating instances and handling data binding, instead of standard bean deserializer.
      Specified by:
        `findPOJOBuilder` in class `BeanDescription`

    - #### findPOJOBuilderConfig

          public JsonPOJOBuilder.Value findPOJOBuilderConfig()

      Description copied from class: `BeanDescription`
      Method for finding configuration for POJO Builder class.
      Specified by:
        `findPOJOBuilderConfig` in class `BeanDescription`

    - #### findDeserializationConverter

          public Converter<java.lang.Object,java.lang.Object> findDeserializationConverter()

      Description copied from class: `BeanDescription`
      Method for finding `Converter` used for serializing instances of this class.
      Specified by:
        `findDeserializationConverter` in class `BeanDescription`

    - #### findClassDescription

          public java.lang.String findClassDescription()

      Description copied from class: `BeanDescription`
      Accessor for possible description for the bean type, used for constructing documentation.
      Overrides:
        `findClassDescription` in class `BeanDescription`

    - #### _findPropertyFields

          @Deprecated
          public java.util.LinkedHashMap<java.lang.String,AnnotatedField> _findPropertyFields(java.util.Collection<java.lang.String> ignoredProperties,
                                                                                                boolean forSerialization)

      Deprecated. Since 2.7.2, does not seem to be used?
      Parameters:
        `ignoredProperties` - (optional) names of properties to ignore; any fields that would be recognized as one of these properties is ignored.
        `forSerialization` - If true, will collect serializable property fields; if false, deserializable
      Returns:
        Ordered Map with logical property name as key, and matching field as value.

    - #### _createConverter

          public Converter<java.lang.Object,java.lang.Object> _createConverter(java.lang.Object converterDef)