java.lang.Object
tools.jackson.databind.BeanDescription
- Direct Known Subclasses:
BasicBeanDescription
Basic container for information gathered by
ClassIntrospector to
help in constructing serializers and deserializers.
Note that the one implementation type is
BasicBeanDescription,
meaning that it is safe to upcast to that type.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSimpleBeanDescription.Supplierimplementation that just returns pre-constructedBeanDescriptioninstance.static classPartial implementation for lazily-constructed suppliers forBeanDescriptioninstances.static interfaceInterface for lazily-constructed suppliers forBeanDescriptioninstances; extends plainSupplierwith convenience accessors.protected static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AnnotatedMemberabstract AnnotatedMemberMethod used to locate a mutator (settable field, or 2-argument set method) of introspected class that implementsJsonAnySetter.abstract List<BeanPropertyDefinition>Method for locating all back-reference properties (setters, fields) bean hasabstract AnnotatedConstructorMethod that will locate the no-arg constructor for this class, if it has one, and that constructor has not been marked as ignorable.abstract Class<?>[]Method for finding out if the POJO specifies default view(s) to use for properties, considering both per-type annotations and global default settings.abstract Map<Object,AnnotatedMember> Method for locating accessor (readable field, or "getter" method) that hasJsonKeyannotation, if any.abstract AnnotatedMemberMethod for locating accessor (readable field, or "getter" method) that hasJsonValueannotation, if any.abstract AnnotatedMethodfindMethod(String name, Class<?>[] paramTypes) abstract List<BeanPropertyDefinition>abstract JsonInclude.ValuefindPropertyInclusion(JsonInclude.Value defValue) Method for finding annotation-indicated inclusion definition (if any); possibly overriding given default value.Class<?>abstract AnnotationsMethod for accessing collection of annotations the bean class has.abstract AnnotatedClassMethod for accessing low-level information about Class this item describes.abstract List<AnnotatedConstructor>Helper method that will return all non-default constructors (that is, constructors that take one or more arguments) this class has.Method similar togetConstructors()except will also introspectJsonCreator.Modeand filter out ones marked as not applicable and include mode (or lack thereof) for remaining constructors.abstract List<AnnotatedMethod>Helper method that will check all static methods of the bean class that seem like factory methods eligible to be used as Creators.abstract List<AnnotatedAndMetadata<AnnotatedMethod,JsonCreator.Mode>> Method similar togetFactoryMethods()but will returnJsonCreator.Modemetadata along with qualifying factory method candidates.abstract ObjectIdInfoAccessor for getting information about Object Id expected to be used for this POJO type, if any.abstract PotentialCreatorsMethod that is replacing earlier Creator introspection access methods.getType()Method for accessing declared type of bean being introspected, including full generic type information (from declaration)abstract booleanMethod for checking whether class being described has any annotations recognized by registered annotation introspector.abstract ObjectinstantiateBean(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".booleanbooleanabstract BeanDescription.Suppliersupplier()Method for constructing a supplier for this bean description instance: sometimes needed when code expects supplier, not description instance.
-
Field Details
-
_type
Bean type information, including raw class and possible generics information
-
-
Constructor Details
-
BeanDescription
-
-
Method Details
-
supplier
Method for constructing a supplier for this bean description instance: sometimes needed when code expects supplier, not description instance. -
getType
Method for accessing declared type of bean being introspected, including full generic type information (from declaration) -
getBeanClass
-
isRecordType
public boolean isRecordType() -
isNonStaticInnerClass
public boolean isNonStaticInnerClass() -
getClassInfo
Method for accessing low-level information about Class this item describes. -
getObjectIdInfo
Accessor for getting information about Object Id expected to be used for this POJO type, if any. -
hasKnownClassAnnotations
public abstract boolean hasKnownClassAnnotations()Method for checking whether class being described has any annotations recognized by registered annotation introspector. -
getClassAnnotations
Method for accessing collection of annotations the bean class has. -
findProperties
- Returns:
- Ordered Map with logical property name as key, and matching getter method as value.
-
getIgnoredPropertyNames
-
findBackReferences
Method for locating all back-reference properties (setters, fields) bean has -
getConstructors
Helper method that will return all non-default constructors (that is, constructors that take one or more arguments) this class has. -
getConstructorsWithMode
public abstract List<AnnotatedAndMetadata<AnnotatedConstructor,JsonCreator.Mode>> getConstructorsWithMode()Method similar togetConstructors()except will also introspectJsonCreator.Modeand 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
-
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:- Returns type compatible with bean type (same or subtype)
- Is recognized from either explicit annotation (usually
@JsonCreatorOR naming: namesvalueOf()andfromString()are recognized but only for 1-argument factory methods, and in case offromString()argument type must further be eitherStringorCharSequence.
- Returns:
- List of static methods considered as possible Factory methods
-
getFactoryMethodsWithMode
public abstract List<AnnotatedAndMetadata<AnnotatedMethod,JsonCreator.Mode>> getFactoryMethodsWithMode()Method similar togetFactoryMethods()but will returnJsonCreator.Modemetadata along with qualifying factory method candidates.- Since:
- 2.13
-
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. -
getPotentialCreators
Method that is replacing earlier Creator introspection access methods.- Returns:
- Container for introspected Creator candidates, if any
- Since:
- 2.18
-
findJsonKeyAccessor
Method for locating accessor (readable field, or "getter" method) that hasJsonKeyannotation, if any. If multiple ones are found, an error is reported by throwingIllegalArgumentException -
findJsonValueAccessor
Method for locating accessor (readable field, or "getter" method) that hasJsonValueannotation, if any. If multiple ones are found, an error is reported by throwingIllegalArgumentException -
findAnyGetter
-
findAnySetterAccessor
Method used to locate a mutator (settable field, or 2-argument set method) of introspected class that implementsJsonAnySetter. 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. -
findMethod
-
findPropertyInclusion
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`.
-
findInjectables
-
instantiateBean
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- 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.
-
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.
-