Module tools.jackson.databind
Class POJOPropertiesCollector
java.lang.Object
tools.jackson.databind.introspect.POJOPropertiesCollector
Helper class used for aggregating information about all possible
properties of a POJO.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AccessorNamingStrategyHandler used for name-mangling of getter, mutator (setter/with) methodsprotected final AnnotationIntrospectorprotected LinkedList<AnnotatedMember>protected LinkedList<AnnotatedMember>protected LinkedList<AnnotatedMember>protected LinkedList<AnnotatedMethod>protected final AnnotatedClassLow-level introspected class information (methods, fields etc)protected booleanState flag we keep to indicate whether actual property information has been collected or not.protected final MapperConfig<?>Configuration settingsprotected List<POJOPropertyBuilder>protected Map<PropertyName,PropertyName> 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 JsonFormat.ValueLazily accessed information about POJO format overridesprotected final booleanTrue if introspection is done for serialization (giving precedence for serialization annotations), or not (false, deserialization)Lazily collected list of properties that can be implicitly ignored during serialization; only updated when collecting information for deserialization purposesprotected LinkedHashMap<Object,AnnotatedMember> Lazily collected list of members that were annotated to indicate that they represent mutators for deserializer value injection.protected final booleanprotected LinkedList<AnnotatedMember>Accessors (field or "getter" method annotated withJsonKeyprotected LinkedList<AnnotatedMember>Accessors (field or "getter" method) annotated withJsonValueprotected PotentialCreatorsprotected LinkedHashMap<String,POJOPropertyBuilder> Set of logical property information collected so far.protected final JavaTypeType of POJO for which properties are being collected.protected final booleanprotected final VisibilityChecker -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPOJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, AccessorNamingStrategy accessorNaming) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_addCreators(Map<String, POJOPropertyBuilder> props) protected void_addFields(Map<String, POJOPropertyBuilder> props) Method for collecting basic information on all fields foundprotected void_addGetterMethod(Map<String, POJOPropertyBuilder> props, AnnotatedMethod m) protected void_addInjectables(Map<String, POJOPropertyBuilder> props) protected void_addMethods(Map<String, POJOPropertyBuilder> props) Method for collecting basic information on all accessor methods foundprotected void_addSetterMethod(Map<String, POJOPropertyBuilder> props, AnnotatedMethod m) 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(JacksonInject.Value injectable, AnnotatedMember m) protected voidprotected POJOPropertyBuilder_property(Map<String, POJOPropertyBuilder> props, String implName) protected POJOPropertyBuilder_property(Map<String, POJOPropertyBuilder> props, PropertyName name) protected voidMethod called to further get rid of unwanted individual accessors, based on read/write settings and rules for "pulling in" accessors (or not).protected voidMethod called to get rid of candidate properties that are marked as ignored.protected voidprotected void_renameUsing(Map<String, POJOPropertyBuilder> propMap, PropertyNamingStrategy naming) protected voidprotected boolean_replaceCreatorProperty(List<POJOPropertyBuilder> creatorProperties, POJOPropertyBuilder prop) protected boolean_resolveFieldVsGetter(List<AnnotatedMember> accessors) Method that will be given aListwith 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 voidInternal method that will collect actual property information.MapperConfig<?>Accessor for set of properties that are explicitly marked to be ignored via per-property markers (but NOT class annotations).Accessor to find out whether type specified requires inclusion of Object Identifier.protected Map<String,POJOPropertyBuilder> getType()booleanprotected voidreportProblem(String msg, Object... args)
-
Field Details
-
_config
Configuration settings -
_accessorNaming
Handler used for name-mangling of getter, mutator (setter/with) methods -
_forSerialization
protected final boolean _forSerializationTrue if introspection is done for serialization (giving precedence for serialization annotations), or not (false, deserialization) -
_type
Type of POJO for which properties are being collected. -
_classDef
Low-level introspected class information (methods, fields etc) -
_visibilityChecker
-
_annotationIntrospector
-
_useAnnotations
protected final boolean _useAnnotations -
_isRecordType
protected final boolean _isRecordType -
_collected
protected boolean _collectedState flag we keep to indicate whether actual property information has been collected or not. -
_properties
Set of logical property information collected so far. -
_creatorProperties
-
_potentialCreators
- Since:
- 2.18
-
_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.
-
_anyGetters
-
_anyGetterField
-
_anySetters
-
_anySetterField
-
_jsonKeyAccessors
Accessors (field or "getter" method annotated withJsonKey -
_jsonValueAccessors
Accessors (field or "getter" method) annotated withJsonValue -
_ignoredPropertyNames
Lazily collected list of properties that can be implicitly ignored during serialization; only updated when collecting information for deserialization purposes -
_injectables
Lazily collected list of members that were annotated to indicate that they represent mutators for deserializer value injection. -
_formatOverrides
Lazily accessed information about POJO format overrides
-
-
Constructor Details
-
POJOPropertiesCollector
protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, AccessorNamingStrategy accessorNaming)
-
-
Method Details
-
getConfig
-
getType
-
isRecordType
public boolean isRecordType() -
getClassDef
-
getAnnotationIntrospector
-
getProperties
-
getPotentialCreators
-
getInjectables
-
getJsonKeyAccessor
-
getJsonValueAccessor
-
getAnyGetterField
-
getAnyGetterMethod
-
getAnySetterField
-
getAnySetterMethod
-
getIgnoredPropertyNames
Accessor for set of properties that are explicitly marked to be ignored via per-property markers (but NOT class annotations). -
getObjectIdInfo
Accessor to find out whether type specified requires inclusion of Object Identifier. -
getPropertyMap
-
getFormatOverrides
- Since:
- 2.17
-
collectAll
protected void collectAll()Internal method that will collect actual property information. -
_addFields
Method for collecting basic information on all fields found -
_addCreators
-
_addMethods
Method for collecting basic information on all accessor methods found -
_addGetterMethod
-
_addSetterMethod
-
_addInjectables
-
_doAddInjectable
-
_fixLeadingFieldNameCase
-
_removeUnwantedProperties
Method called to get rid of candidate properties that are marked as ignored. -
_removeUnwantedAccessors
Method called to further get rid of unwanted individual accessors, based on read/write settings and rules for "pulling in" accessors (or not). -
_collectIgnorals
Helper method called to add explicitly ignored properties to a list of known ignored properties; this helps in proper reporting of errors. -
_renameProperties
-
_renameUsing
-
_renameWithWrappers
-
_sortProperties
-
_resolveFieldVsGetter
Method that will be given aListwith 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 returnstrue, otherwisefalse.NOTE: method will directly modify given
Listdirectly, regardless of whether it ultimately succeeds or not.- Returns:
- True if seeming conflict was resolved and there only remains single accessor
-
reportProblem
-
_property
-
_property
-
_replaceCreatorProperty
protected boolean _replaceCreatorProperty(List<POJOPropertyBuilder> creatorProperties, POJOPropertyBuilder prop)
-