Top Description Inners Fields Constructors Methods
tools.jackson.databind

public abstract Class BeanDescription

extends Object
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.introspect.BasicBeanDescription
Imports
java.util.*, com.fasterxml.jackson.annotation.JsonCreator, .JsonFormat, .JsonInclude, tools.jackson.databind.cfg.MapperConfig, tools.jackson.databind.introspect.*, tools.jackson.databind.util.Annotations

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
BeanDescription.EagerSupplier

Simple Supplier implementation that just returns pre-constructed BeanDescription instance.

public abstract static class
BeanDescription.LazySupplier

Partial implementation for lazily-constructed suppliers for BeanDescription instances.

public static interface
BeanDescription.Supplier

Interface for lazily-constructed suppliers for BeanDescription instances; extends plain java.util.function.Supplier with convenience accessors.

protected abstract static class

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 AnnotatedMember
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 abstract List<BeanPropertyDefinition>
findBackReferences()

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

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 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
findMethod(String name, Class<?>[] paramTypes)

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 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 abstract PotentialCreators

Returns:

Container for introspected Creator candidates, if any
getPotentialCreators
()

Method that is replacing earlier Creator introspection access methods.

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 BeanDescription.Supplier
supplier()

Method for constructing a supplier for this bean description instance: sometimes needed when code expects supplier, not description instance.

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

findAnyGetterback to summary
public abstract AnnotatedMember findAnyGetter()
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.

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

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

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.

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

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

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

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.

getPotentialCreatorsback to summary
public abstract PotentialCreators getPotentialCreators()

Method that is replacing earlier Creator introspection access methods.

Returns:PotentialCreators

Container for introspected Creator candidates, if any

Since
2.18
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()
isRecordTypeback to summary
public boolean isRecordType()
supplierback to summary
public abstract BeanDescription.Supplier supplier()

Method for constructing a supplier for this bean description instance: sometimes needed when code expects supplier, not description instance.

tools.jackson.databind back to summary

public Class BeanDescription.EagerSupplier

extends SupplierBase
Class Inheritance

Simple Supplier implementation that just returns pre-constructed BeanDescription instance.

Field Summary

Modifier and TypeField and Description
protected final BeanDescription
Inherited from tools.jackson.databind.BeanDescription.SupplierBase:
_classFormat_config_type

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public BeanDescription
public Annotations
public AnnotatedClass
Inherited from tools.jackson.databind.BeanDescription.SupplierBase:
findExpectedFormatgetBeanClassgetTypeisRecordType

Field Detail

_beanDescback to summary
protected final BeanDescription _beanDesc

Constructor Detail

EagerSupplierback to summary
public EagerSupplier(MapperConfig<?> config, BeanDescription beanDesc)

Method Detail

getback to summary
public BeanDescription get()

Implements tools.jackson.databind.BeanDescription.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Annotations
@Override
getClassAnnotationsback to summary
public Annotations getClassAnnotations()

Implements tools.jackson.databind.BeanDescription.Supplier.getClassAnnotations.

Annotations
@Override
getClassInfoback to summary
public AnnotatedClass getClassInfo()

Implements tools.jackson.databind.BeanDescription.Supplier.getClassInfo.

Annotations
@Override
tools.jackson.databind back to summary

public abstract Class BeanDescription.LazySupplier

extends SupplierBase
Class Inheritance

Partial implementation for lazily-constructed suppliers for BeanDescription instances.

Field Summary

Modifier and TypeField and Description
protected transient BeanDescription
protected transient AnnotatedClass
Inherited from tools.jackson.databind.BeanDescription.SupplierBase:
_classFormat_config_type

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract BeanDescription
protected abstract AnnotatedClass
public BeanDescription
public Annotations
public AnnotatedClass
Inherited from tools.jackson.databind.BeanDescription.SupplierBase:
findExpectedFormatgetBeanClassgetTypeisRecordType

Field Detail

_beanDescback to summary
protected transient BeanDescription _beanDesc
_classDescback to summary
protected transient AnnotatedClass _classDesc

Constructor Detail

LazySupplierback to summary
protected LazySupplier(MapperConfig<?> config, JavaType type)

Method Detail

_constructback to summary
protected abstract BeanDescription _construct(JavaType forType, AnnotatedClass ac)
_introspectback to summary
protected abstract AnnotatedClass _introspect(JavaType forType)
getback to summary
public BeanDescription get()

Implements tools.jackson.databind.BeanDescription.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Annotations
@Override
getClassAnnotationsback to summary
public Annotations getClassAnnotations()

Implements tools.jackson.databind.BeanDescription.Supplier.getClassAnnotations.

Annotations
@Override
getClassInfoback to summary
public AnnotatedClass getClassInfo()

Implements tools.jackson.databind.BeanDescription.Supplier.getClassInfo.

Annotations
@Override
tools.jackson.databind back to summary

public Interface BeanDescription.Supplier

extends Supplier<BeanDescription>
Known Direct Implementers
tools.jackson.databind.BeanDescription.SupplierBase

Interface for lazily-constructed suppliers for BeanDescription instances; extends plain java.util.function.Supplier with convenience accessors.

Method Summary

Modifier and TypeMethod and Description
public JsonFormat.Value
public BeanDescription
get()

Redeclares java.util.function.Supplier.get.

Gets a result.

public Class<?>
public Annotations
public AnnotatedClass
public JavaType
public boolean

Method Detail

findExpectedFormatback to summary
public JsonFormat.Value findExpectedFormat(Class<?> baseType)
getback to summary
public BeanDescription get()

Redeclares java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Annotations
@Override
getBeanClassback to summary
public Class<?> getBeanClass()
getClassAnnotationsback to summary
public Annotations getClassAnnotations()
getClassInfoback to summary
public AnnotatedClass getClassInfo()
getTypeback to summary
public JavaType getType()
isRecordTypeback to summary
public boolean isRecordType()
tools.jackson.databind back to summary

protected abstract Class BeanDescription.SupplierBase

extends Object
implements Supplier
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.BeanDescription.Supplier, java.util.function.Supplier
Known Direct Subclasses
tools.jackson.databind.BeanDescription.LazySupplier, tools.jackson.databind.BeanDescription.EagerSupplier

Field Summary

Modifier and TypeField and Description
protected transient JsonFormat.Value
_classFormat

Format definitions lazily introspected from class annotations

protected final MapperConfig<?>
protected final JavaType

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public JsonFormat.Value
public Class<?>
public JavaType
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_classFormatback to summary
protected transient JsonFormat.Value _classFormat

Format definitions lazily introspected from class annotations

_configback to summary
protected final MapperConfig<?> _config
_typeback to summary
protected final JavaType _type

Constructor Detail

SupplierBaseback to summary
protected SupplierBase(MapperConfig<?> config, JavaType type)

Method Detail

findExpectedFormatback to summary
public JsonFormat.Value findExpectedFormat(Class<?> baseType)

Implements tools.jackson.databind.BeanDescription.Supplier.findExpectedFormat.

Annotations
@Override
getBeanClassback to summary
public Class<?> getBeanClass()

Implements tools.jackson.databind.BeanDescription.Supplier.getBeanClass.

Annotations
@Override
getTypeback to summary
public JavaType getType()

Implements tools.jackson.databind.BeanDescription.Supplier.getType.

Annotations
@Override
isRecordTypeback to summary
public boolean isRecordType()

Implements tools.jackson.databind.BeanDescription.Supplier.isRecordType.

Annotations
@Override