com.fasterxml.jackson.databind.introspect

## Class POJOPropertiesCollector

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector

    public class POJOPropertiesCollector
    extends Object

Helper class used for aggregating information about all possible properties of a POJO.

### Field Summary

Fields
`protected AccessorNamingStrategy` `_accessorNaming` Handler used for name-mangling of getter, mutator (setter/with) methods
`protected AnnotationIntrospector` `_annotationIntrospector`
`protected LinkedList<AnnotatedMember>` `_anyGetterField`
`protected LinkedList<AnnotatedMember>` `_anyGetters`
`protected LinkedList<AnnotatedMember>` `_anySetterField`
`protected LinkedList<AnnotatedMethod>` `_anySetters`
`protected AnnotatedClass` `_classDef` Low-level introspected class information (methods, fields etc)
`protected boolean` `_collected` State flag we keep to indicate whether actual property information has been collected or not.
`protected MapperConfig<?>` `_config` Configuration settings
`protected List<POJOPropertyBuilder>` `_creatorProperties`
`protected Map<PropertyName,PropertyName>` `_fieldRenameMappings` A set of "field renamings" that have been discovered, indicating intended renaming of other accessors: key is the implicit original name and value intended name to use instead.
`protected com.fasterxml.jackson.annotation.JsonFormat.Value` `_formatOverrides` Lazily accessed information about POJO format overrides
`protected boolean` `_forSerialization` True if introspection is done for serialization (giving precedence for serialization annotations), or not (false, deserialization)
`protected HashSet<String>` `_ignoredPropertyNames` Lazily collected list of properties that can be implicitly ignored during serialization; only updated when collecting information for deserialization purposes
`protected LinkedHashMap<Object,AnnotatedMember>` `_injectables` Lazily collected list of members that were annotated to indicate that they represent mutators for deserializer value injection.
`protected boolean` `_isRecordType`
`protected LinkedList<AnnotatedMember>` `_jsonKeyAccessors` Accessors (field or "getter" method annotated with `JsonKey`
`protected LinkedList<AnnotatedMember>` `_jsonValueAccessors` Accessors (field or "getter" method) annotated with `JsonValue`
`protected PotentialCreators` `_potentialCreators`
`protected LinkedHashMap<String,POJOPropertyBuilder>` `_properties` Set of logical property information collected so far.
`protected JavaType` `_type` Type of POJO for which properties are being collected.
`protected boolean` `_useAnnotations`
`protected VisibilityChecker<?>` `_visibilityChecker`

### Constructor Summary

Constructors
`protected` `POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, AccessorNamingStrategy accessorNaming)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`protected void` `_addCreators(Map<String,POJOPropertyBuilder> props)`
`protected void` `_addFields(Map<String,POJOPropertyBuilder> props)` Method for collecting basic information on all fields found
`protected void` `_addGetterMethod(Map<String,POJOPropertyBuilder> props, AnnotatedMethod m, AnnotationIntrospector ai)`
`protected void` `_addInjectables(Map<String,POJOPropertyBuilder> props)`
`protected void` `_addMethods(Map<String,POJOPropertyBuilder> props)` Method for collecting basic information on all accessor methods found
`protected void` `_addSetterMethod(Map<String,POJOPropertyBuilder> props, AnnotatedMethod m, AnnotationIntrospector ai)`
`protected void` `_collectIgnorals(String name)` Helper method called to add explicitly ignored properties to a list of known ignored properties; this helps in proper reporting of errors.
`protected void` `_doAddInjectable(com.fasterxml.jackson.annotation.JacksonInject.Value injectable, AnnotatedMember m)`
`protected POJOPropertyBuilder` `_property(Map<String,POJOPropertyBuilder> props, PropertyName name)`
`protected POJOPropertyBuilder` `_property(Map<String,POJOPropertyBuilder> props, String implName)`
`protected void` `_removeUnwantedAccessors(Map<String,POJOPropertyBuilder> props)` Method called to further get rid of unwanted individual accessors, based on read/write settings and rules for "pulling in" accessors (or not).
`protected void` `_removeUnwantedProperties(Map<String,POJOPropertyBuilder> props)` Method called to get rid of candidate properties that are marked as ignored.
`protected void` `_renameProperties(Map<String,POJOPropertyBuilder> props)`
`protected void` `_renameUsing(Map<String,POJOPropertyBuilder> propMap, PropertyNamingStrategy naming)`
`protected void` `_renameWithWrappers(Map<String,POJOPropertyBuilder> props)`
`protected boolean` `_replaceCreatorProperty(List<POJOPropertyBuilder> creatorProperties, POJOPropertyBuilder prop)`
`protected boolean` `_resolveFieldVsGetter(List<AnnotatedMember> accessors)` Method that will be given a `List` with 2 or more accessors that may be in conflict: it will need to remove lower-priority accessors to leave just a single highest-priority accessor to use.
`protected void` `_sortProperties(Map<String,POJOPropertyBuilder> props)`
`protected void` `collectAll()` Internal method that will collect actual property information.
`AnnotationIntrospector` `getAnnotationIntrospector()`
`AnnotatedMember` `getAnyGetter()` Deprecated. Since 2.12 use separate `getAnyGetterMethod()` and `getAnyGetterField()`.
`AnnotatedMember` `getAnyGetterField()`
`AnnotatedMember` `getAnyGetterMethod()`
`AnnotatedMember` `getAnySetterField()`
`AnnotatedMethod` `getAnySetterMethod()`
`AnnotatedClass` `getClassDef()`
`MapperConfig<?>` `getConfig()`
`com.fasterxml.jackson.annotation.JsonFormat.Value` `getFormatOverrides()`
`Set<String>` `getIgnoredPropertyNames()` Accessor for set of properties that are explicitly marked to be ignored via per-property markers (but NOT class annotations).
`Map<Object,AnnotatedMember>` `getInjectables()`
`AnnotatedMember` `getJsonKeyAccessor()`
`AnnotatedMember` `getJsonValueAccessor()`
`ObjectIdInfo` `getObjectIdInfo()` Accessor to find out whether type specified requires inclusion of Object Identifier.
`PotentialCreators` `getPotentialCreators()`
`List<BeanPropertyDefinition>` `getProperties()`
`protected Map<String,POJOPropertyBuilder>` `getPropertyMap()`
`JavaType` `getType()`
`boolean` `isRecordType()`
`protected void` `reportProblem(String msg, Object... args)`

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

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

### Field Detail

#### _config

    protected final MapperConfig<?> _config

Configuration settings

#### _accessorNaming

    protected final AccessorNamingStrategy _accessorNaming

Handler used for name-mangling of getter, mutator (setter/with) methods

Since:
  2.12

#### _forSerialization

    protected final boolean _forSerialization

True if introspection is done for serialization (giving precedence for serialization annotations), or not (false, deserialization)

#### _type

    protected final JavaType _type

Type of POJO for which properties are being collected.

#### _classDef

    protected final AnnotatedClass _classDef

Low-level introspected class information (methods, fields etc)

#### _visibilityChecker

    protected final VisibilityChecker<?> _visibilityChecker

#### _annotationIntrospector

    protected final AnnotationIntrospector _annotationIntrospector

#### _useAnnotations

    protected final boolean _useAnnotations

Since:
  2.9

#### _isRecordType

    protected final boolean _isRecordType

Since:
  2.15

#### _collected

    protected boolean _collected

State flag we keep to indicate whether actual property information has been collected or not.

#### _properties

    protected LinkedHashMap<String,POJOPropertyBuilder> _properties

Set of logical property information collected so far.

Since 2.6, this has been constructed (more) lazily, to defer throwing of exceptions for potential conflicts in cases where this may not be an actual problem.

#### _creatorProperties

    protected List<POJOPropertyBuilder> _creatorProperties

#### _potentialCreators

    protected PotentialCreators _potentialCreators

Since:
  2.18

#### _fieldRenameMappings

    protected Map<PropertyName,PropertyName> _fieldRenameMappings

A set of "field renamings" that have been discovered, indicating intended renaming of other accessors: key is the implicit original name and value intended name to use instead.

Note that these renamings are applied earlier than "regular" (explicit) renamings and affect implicit name: their effect may be changed by further renaming based on explicit indicators. The main use case is to effectively relink accessors based on fields discovered, and used to sort of correct otherwise missing linkage between fields and other accessors.

Since:
  2.11

#### _anyGetters

    protected LinkedList<AnnotatedMember> _anyGetters

#### _anyGetterField

    protected LinkedList<AnnotatedMember> _anyGetterField

Since:
  2.12

#### _anySetters

    protected LinkedList<AnnotatedMethod> _anySetters

#### _anySetterField

    protected LinkedList<AnnotatedMember> _anySetterField

#### _jsonKeyAccessors

    protected LinkedList<AnnotatedMember> _jsonKeyAccessors

Accessors (field or "getter" method annotated with `JsonKey`

Since:
  2.12

#### _jsonValueAccessors

    protected LinkedList<AnnotatedMember> _jsonValueAccessors

Accessors (field or "getter" method) annotated with `JsonValue`

#### _ignoredPropertyNames

    protected HashSet<String> _ignoredPropertyNames

Lazily collected list of properties that can be implicitly ignored during serialization; only updated when collecting information for deserialization purposes

#### _injectables

    protected LinkedHashMap<Object,AnnotatedMember> _injectables

Lazily collected list of members that were annotated to indicate that they represent mutators for deserializer value injection.

#### _formatOverrides

    protected com.fasterxml.jackson.annotation.JsonFormat.Value _formatOverrides

Lazily accessed information about POJO format overrides

Since:
  2.17

### Constructor Detail

#### POJOPropertiesCollector

    protected POJOPropertiesCollector(MapperConfig<?> config,
                                      boolean forSerialization,
                                      JavaType type,
                                      AnnotatedClass classDef,
                                      AccessorNamingStrategy accessorNaming)

Since:
  2.12

### Method Detail

#### getConfig

    public MapperConfig<?> getConfig()

#### getType

    public JavaType getType()

#### isRecordType

    public boolean isRecordType()

Since:
  2.15

#### getClassDef

    public AnnotatedClass getClassDef()

#### getAnnotationIntrospector

    public AnnotationIntrospector getAnnotationIntrospector()

#### getProperties

    public List<BeanPropertyDefinition> getProperties()

#### getPotentialCreators

    public PotentialCreators getPotentialCreators()

#### getInjectables

    public Map<Object,AnnotatedMember> getInjectables()

#### getJsonKeyAccessor

    public AnnotatedMember getJsonKeyAccessor()

Since:
  2.12

#### getJsonValueAccessor

    public AnnotatedMember getJsonValueAccessor()

Since:
  2.9

#### getAnyGetter

    @Deprecated
    public AnnotatedMember getAnyGetter()

Deprecated. Since 2.12 use separate `getAnyGetterMethod()` and `getAnyGetterField()`.
Alias for `getAnyGetterMethod()`.

#### getAnyGetterField

    public AnnotatedMember getAnyGetterField()

Since:
  2.12 (before only had "getAnyGetter()")

#### getAnyGetterMethod

    public AnnotatedMember getAnyGetterMethod()

Since:
  2.12 (before only had "getAnyGetter()")

#### getAnySetterField

    public AnnotatedMember getAnySetterField()

#### getAnySetterMethod

    public AnnotatedMethod getAnySetterMethod()

#### getIgnoredPropertyNames

    public Set<String> getIgnoredPropertyNames()

Accessor for set of properties that are explicitly marked to be ignored via per-property markers (but NOT class annotations).

#### getObjectIdInfo

    public ObjectIdInfo getObjectIdInfo()

Accessor to find out whether type specified requires inclusion of Object Identifier.

#### getPropertyMap

    protected Map<String,POJOPropertyBuilder> getPropertyMap()

#### getFormatOverrides

    public com.fasterxml.jackson.annotation.JsonFormat.Value getFormatOverrides()

Since:
  2.17

#### collectAll

    protected void collectAll()

Internal method that will collect actual property information.

Since:
  2.6

#### _addFields

    protected void _addFields(Map<String,POJOPropertyBuilder> props)

Method for collecting basic information on all fields found

#### _addCreators

    protected void _addCreators(Map<String,POJOPropertyBuilder> props)

#### _addMethods

    protected void _addMethods(Map<String,POJOPropertyBuilder> props)

Method for collecting basic information on all accessor methods found

#### _addGetterMethod

    protected void _addGetterMethod(Map<String,POJOPropertyBuilder> props,
                                    AnnotatedMethod m,
                                    AnnotationIntrospector ai)

#### _addSetterMethod

    protected void _addSetterMethod(Map<String,POJOPropertyBuilder> props,
                                    AnnotatedMethod m,
                                    AnnotationIntrospector ai)

#### _addInjectables

    protected void _addInjectables(Map<String,POJOPropertyBuilder> props)

#### _doAddInjectable

    protected void _doAddInjectable(com.fasterxml.jackson.annotation.JacksonInject.Value injectable,
                                    AnnotatedMember m)

#### _removeUnwantedProperties

    protected void _removeUnwantedProperties(Map<String,POJOPropertyBuilder> props)

Method called to get rid of candidate properties that are marked as ignored.

#### _removeUnwantedAccessors

    protected void _removeUnwantedAccessors(Map<String,POJOPropertyBuilder> props)

Method called to further get rid of unwanted individual accessors, based on read/write settings and rules for "pulling in" accessors (or not).

#### _collectIgnorals

    protected void _collectIgnorals(String name)

Helper method called to add explicitly ignored properties to a list of known ignored properties; this helps in proper reporting of errors.

#### _renameProperties

    protected void _renameProperties(Map<String,POJOPropertyBuilder> props)

#### _renameUsing

    protected void _renameUsing(Map<String,POJOPropertyBuilder> propMap,
                                PropertyNamingStrategy naming)

#### _renameWithWrappers

    protected void _renameWithWrappers(Map<String,POJOPropertyBuilder> props)

#### _sortProperties

    protected void _sortProperties(Map<String,POJOPropertyBuilder> props)

#### _resolveFieldVsGetter

    protected boolean _resolveFieldVsGetter(List<AnnotatedMember> accessors)

Method that will be given a `List` with 2 or more accessors that may be in conflict: it will need to remove lower-priority accessors to leave just a single highest-priority accessor to use. If this succeeds method returns `true`, otherwise `false`.

NOTE: method will directly modify given `List` directly, regardless of whether it ultimately succeeds or not.

Returns:
  True if seeming conflict was resolved and there only remains single accessor

#### reportProblem

    protected void reportProblem(String msg,
                                 Object... args)

#### _property

    protected POJOPropertyBuilder _property(Map<String,POJOPropertyBuilder> props,
                                            PropertyName name)

#### _property

    protected POJOPropertyBuilder _property(Map<String,POJOPropertyBuilder> props,
                                            String implName)

#### _replaceCreatorProperty

    protected boolean _replaceCreatorProperty(List<POJOPropertyBuilder> creatorProperties,
                                              POJOPropertyBuilder prop)