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

public abstract Class BeanDescription

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.databind.introspect.BasicBeanDescription
Imports
java.lang.reflect.Constructor, .Method, java.util.*, com.fasterxml.jackson.annotation.JsonCreator, .JsonFormat, .JsonInclude, com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder, com.fasterxml.jackson.databind.introspect.*, com.fasterxml.jackson.databind.type.TypeBindings, com.fasterxml.jackson.databind.util.Annotations, .Converter

Basic container for information gathered by ClassIntrospector to help in constructing serializers and deserializers. Note that the main implementation type is com.fasterxml.jackson.databind.introspect.BasicBeanDescription, meaning that it is safe to upcast to this type.

Field Summary

Modifier and TypeField and Description
protected final JavaType
_type

Bean type information, including raw class and possible generics information

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract TypeBindings
bindingsForBeanType()

Deprecated Since 2.7, should not need to access bindings directly
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.
public abstract AnnotatedMember
public AnnotatedMethod
findAnySetter()

Deprecated Since 2.9: use findAnySetterAccessor instead
public abstract AnnotatedMember
findAnySetterAccessor()

Method used to locate a mutator (settable field, or 2-argument set method) of introspected class that implements com.fasterxml.jackson.annotation.JsonAnySetter.

public AnnotatedMember
findAnySetterField()

Deprecated Since 2.9: use findAnySetterAccessor instead
public abstract Map<String, AnnotatedMember>
findBackReferenceProperties()

Deprecated Since 2.9 use findBackReferences() instead
Method for locating all back-reference properties (setters, fields) bean has
public abstract List<BeanPropertyDefinition>
findBackReferences()

Method for locating all back-reference properties (setters, fields) bean has

public String
findClassDescription()

Accessor for possible description for the bean type, used for constructing documentation.

public abstract 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.

public abstract Class<?>[]
findDefaultViews()

Method for finding out if the POJO specifies default view(s) to use for properties, considering both per-type annotations and global default settings.

public abstract Converter<Object, Object>
findDeserializationConverter()

Method for finding Converter used for serializing instances of this class.

public abstract JsonFormat.Value
findExpectedFormat(JsonFormat.Value defValue)

Method for checking what is the expected format for POJO, as defined by defaults and possible annotations.

public abstract Method
findFactoryMethod(Class<?>... expArgTypes)

Deprecated Since 2.13: instead use getFactoryMethods(), filter.
public abstract Map<Object, AnnotatedMember>
public AnnotatedMember
findJsonKeyAccessor()

Method for locating accessor (readable field, or "getter" method) that has com.fasterxml.jackson.annotation.JsonKey annotation, if any.

public abstract AnnotatedMember
findJsonValueAccessor()

Method for locating accessor (readable field, or "getter" method) that has com.fasterxml.jackson.annotation.JsonValue annotation, if any.

public abstract AnnotatedMethod
findJsonValueMethod()

Deprecated
public abstract AnnotatedMethod
findMethod(String name, Class<?>[] paramTypes)

public abstract 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.

public abstract JsonPOJOBuilder.Value
findPOJOBuilderConfig()

Method for finding configuration for POJO Builder class.

public abstract List<BeanPropertyDefinition>

Returns:

Ordered Map with logical property name as key, and matching getter method as value.
findProperties
()

public abstract JsonInclude.Value
findPropertyInclusion(JsonInclude.Value defValue)

Method for finding annotation-indicated inclusion definition (if any); possibly overriding given default value.

public abstract Converter<Object, Object>
findSerializationConverter()

Method for finding Converter used for serializing instances of this class.

public abstract Constructor<?>
findSingleArgConstructor(Class<?>... argTypes)

Deprecated Since 2.13: instead use getConstructors(), filter.
public Class<?>
public abstract Annotations
getClassAnnotations()

Method for accessing collection of annotations the bean class has.

public abstract AnnotatedClass
getClassInfo()

Method for accessing low-level information about Class this item describes.

public abstract List<AnnotatedConstructor>
getConstructors()

Helper method that will return all non-default constructors (that is, constructors that take one or more arguments) this class has.

public abstract List<AnnotatedAndMetadata<AnnotatedConstructor, JsonCreator.Mode>>
getConstructorsWithMode()

Method similar to getConstructors() except will also introspect JsonCreator.Mode and filter out ones marked as not applicable and include mode (or lack thereof) for remaining constructors.

public abstract List<AnnotatedMethod>

Returns:

List of static methods considered as possible Factory methods
getFactoryMethods
()

Helper method that will check all static methods of the bean class that seem like factory methods eligible to be used as Creators.

public abstract List<AnnotatedAndMetadata<AnnotatedMethod, JsonCreator.Mode>>
getFactoryMethodsWithMode()

Method similar to getFactoryMethods() but will return JsonCreator.Mode metadata along with qualifying factory method candidates.

public abstract Set<String>
public abstract ObjectIdInfo
getObjectIdInfo()

Accessor for getting information about Object Id expected to be used for this POJO type, if any.

public JavaType
getType()

Method for accessing declared type of bean being introspected, including full generic type information (from declaration)

public abstract boolean
hasKnownClassAnnotations()

Method for checking whether class being described has any annotations recognized by registered annotation introspector.

public abstract Object

Returns:

Instance of class represented by this descriptor, if suitable default constructor was found; null otherwise.
instantiateBean
(boolean
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.
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".

public boolean
public boolean
public abstract JavaType
resolveType(Type jdkType)

Deprecated Since 2.8, should simply call getType of property accessor directly.
Method for resolving given JDK type, using this bean as the generic type resolution context.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_typeback to summary
protected final JavaType _type

Bean type information, including raw class and possible generics information

Constructor Detail

BeanDescriptionback to summary
protected BeanDescription(JavaType type)

Method Detail

bindingsForBeanTypeback to summary
public abstract TypeBindings bindingsForBeanType()

Deprecated

Since 2.7, should not need to access bindings directly

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.

Annotations
@Deprecated
findAnyGetterback to summary
public abstract AnnotatedMember findAnyGetter()
findAnySetterback to summary
public AnnotatedMethod findAnySetter()

Deprecated

Since 2.9: use findAnySetterAccessor instead

Annotations
@Deprecated
findAnySetterAccessorback to summary
public abstract AnnotatedMember findAnySetterAccessor()

Method used to locate a mutator (settable field, or 2-argument set method) of introspected class that implements com.fasterxml.jackson.annotation.JsonAnySetter. If no such mutator 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.

Since
2.9
findAnySetterFieldback to summary
public AnnotatedMember findAnySetterField()

Deprecated

Since 2.9: use findAnySetterAccessor instead

Annotations
@Deprecated
findBackReferencePropertiesback to summary
public abstract Map<String, AnnotatedMember> findBackReferenceProperties()

Deprecated

Since 2.9 use findBackReferences() instead

Method for locating all back-reference properties (setters, fields) bean has

Annotations
@Deprecated
findBackReferencesback to summary
public abstract List<BeanPropertyDefinition> findBackReferences()

Method for locating all back-reference properties (setters, fields) bean has

Since
2.9
findClassDescriptionback to summary
public String findClassDescription()

Accessor for possible description for the bean type, used for constructing documentation.

Since
2.7
findDefaultConstructorback to summary
public abstract 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.

findDefaultViewsback to summary
public abstract Class<?>[] findDefaultViews()

Method for finding out if the POJO specifies default view(s) to use for properties, considering both per-type annotations and global default settings.

Since
2.9
findDeserializationConverterback to summary
public abstract Converter<Object, Object> findDeserializationConverter()

Method for finding Converter used for serializing instances of this class.

Since
2.2
findExpectedFormatback to summary
public abstract JsonFormat.Value findExpectedFormat(JsonFormat.Value defValue)

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.

Since
2.1
findFactoryMethodback to summary
public abstract Method findFactoryMethod(Class<?>... expArgTypes)

Deprecated

Since 2.13: instead use getFactoryMethods(), filter.

Annotations
@Deprecated
findInjectablesback to summary
public abstract Map<Object, AnnotatedMember> findInjectables()
findJsonKeyAccessorback to summary
public AnnotatedMember findJsonKeyAccessor()

Method for locating accessor (readable field, or "getter" method) that has com.fasterxml.jackson.annotation.JsonKey annotation, if any. If multiple ones are found, an error is reported by throwing IllegalArgumentException

Since
2.12
findJsonValueAccessorback to summary
public abstract AnnotatedMember findJsonValueAccessor()

Method for locating accessor (readable field, or "getter" method) that has com.fasterxml.jackson.annotation.JsonValue annotation, if any. If multiple ones are found, an error is reported by throwing IllegalArgumentException

Since
2.9
findJsonValueMethodback to summary
public abstract AnnotatedMethod findJsonValueMethod()

Deprecated

Annotations
@Deprecated
findMethodback to summary
public abstract AnnotatedMethod findMethod(String name, Class<?>[] paramTypes)
findPOJOBuilderback to summary
public abstract 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.

findPOJOBuilderConfigback to summary
public abstract JsonPOJOBuilder.Value findPOJOBuilderConfig()

Method for finding configuration for POJO Builder class.

findPropertiesback to summary
public abstract List<BeanPropertyDefinition> findProperties()
Returns:List<BeanPropertyDefinition>

Ordered Map with logical property name as key, and matching getter method as value.

findPropertyInclusionback to summary
public abstract JsonInclude.Value findPropertyInclusion(JsonInclude.Value defValue)

Method for finding annotation-indicated inclusion definition (if any); possibly overriding given default value.

Note

does NOT use global inclusion default settings as the base, unless passed as `defValue`.

Since
2.7
findSerializationConverterback to summary
public abstract Converter<Object, Object> findSerializationConverter()

Method for finding Converter used for serializing instances of this class.

Since
2.2
findSingleArgConstructorback to summary
public abstract Constructor<?> findSingleArgConstructor(Class<?>... argTypes)

Deprecated

Since 2.13: instead use getConstructors(), filter.

Annotations
@Deprecated
getBeanClassback to summary
public Class<?> getBeanClass()
getClassAnnotationsback to summary
public abstract Annotations getClassAnnotations()

Method for accessing collection of annotations the bean class has.

getClassInfoback to summary
public abstract AnnotatedClass getClassInfo()

Method for accessing low-level information about Class this item describes.

getConstructorsback to summary
public abstract List<AnnotatedConstructor> getConstructors()

Helper method that will return all non-default constructors (that is, constructors that take one or more arguments) this class has.

getConstructorsWithModeback to summary
public abstract List<AnnotatedAndMetadata<AnnotatedConstructor, JsonCreator.Mode>> getConstructorsWithMode()

Method similar to getConstructors() except will also introspect JsonCreator.Mode and filter out ones marked as not applicable and include mode (or lack thereof) for remaining constructors.

Note that no other filtering (regarding visibility or other annotations) is performed

Since
2.13
getFactoryMethodsback to summary
public abstract List<AnnotatedMethod> getFactoryMethods()

Helper method that will check all static methods of the bean class that seem like factory methods eligible to be used as Creators. This requires that the static method:

  1. Returns type compatible with bean type (same or subtype)
  2. Is recognized from either explicit annotation (usually @JsonCreator OR naming: names valueOf() and fromString() are recognized but only for 1-argument factory methods, and in case of fromString() argument type must further be either String or CharSequence.
Note that caller typically applies further checks for things like visibility.
Returns:List<AnnotatedMethod>

List of static methods considered as possible Factory methods

getFactoryMethodsWithModeback to summary
public abstract List<AnnotatedAndMetadata<AnnotatedMethod, JsonCreator.Mode>> getFactoryMethodsWithMode()

Method similar to getFactoryMethods() but will return JsonCreator.Mode metadata along with qualifying factory method candidates.

Since
2.13
getIgnoredPropertyNamesback to summary
public abstract Set<String> getIgnoredPropertyNames()
getObjectIdInfoback to summary
public abstract ObjectIdInfo getObjectIdInfo()

Accessor for getting information about Object Id expected to be used for this POJO type, if any.

getTypeback to summary
public JavaType getType()

Method for accessing declared type of bean being introspected, including full generic type information (from declaration)

hasKnownClassAnnotationsback to summary
public abstract boolean hasKnownClassAnnotations()

Method for checking whether class being described has any annotations recognized by registered annotation introspector.

instantiateBeanback to summary
public abstract 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".

Parameters
fixAccess:boolean

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:Object

Instance of class represented by this descriptor, if suitable default constructor was found; null otherwise.

isNonStaticInnerClassback to summary
public boolean isNonStaticInnerClass()
Since
2.9
isRecordTypeback to summary
public boolean isRecordType()
Since
2.15
resolveTypeback to summary
public abstract JavaType resolveType(Type jdkType)

Deprecated

Since 2.8, should simply call getType of property accessor directly.

Method for resolving given JDK type, using this bean as the generic type resolution context.

Annotations
@Deprecated