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 Modifier and Type Field Description protected AnnotationIntrospector_annotationIntrospectorprotected LinkedList<AnnotatedMember>_anyGettersprotected LinkedList<AnnotatedMember>_anySetterFieldprotected LinkedList<AnnotatedMethod>_anySettersprotected AnnotatedClass_classDefLow-level introspected class information (methods, fields etc)protected boolean_collectedState flag we keep to indicate whether actual property information has been collected or not.protected MapperConfig<?>_configConfiguration settingsprotected LinkedList<POJOPropertyBuilder>_creatorPropertiesprotected boolean_forSerializationTrue if introspection is done for serialization (giving precedence for serialization annotations), or not (false, deserialization)protected HashSet<String>_ignoredPropertyNamesLazily collected list of properties that can be implicitly ignored during serialization; only updated when collecting information for deserialization purposesprotected LinkedHashMap<Object,AnnotatedMember>_injectablesLazily collected list of members that were annotated to indicate that they represent mutators for deserializer value injection.protected LinkedList<AnnotatedMember>_jsonValueAccessorsMethod(s) marked with 'JsonValue' annotationprotected String_mutatorPrefixPrefix used by auto-detected mutators ("setters"): usually "set", but differs for builder objects ("with" by default).protected LinkedHashMap<String,POJOPropertyBuilder>_propertiesSet of logical property information collected so far.protected boolean_stdBeanNamingprotected JavaType_typeType of POJO for which properties are being collected.protected boolean_useAnnotationsprotected VisibilityChecker<?>_visibilityChecker
-
Constructor Summary
Constructors Modifier Constructor Description protectedPOJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, String mutatorPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void_addCreatorParam(Map<String,POJOPropertyBuilder> props, AnnotatedParameter param)protected void_addCreators(Map<String,POJOPropertyBuilder> props)Method for collecting basic information on constructor(s) foundprotected void_addFields(Map<String,POJOPropertyBuilder> props)Method for collecting basic information on all fields foundprotected 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 fields foundprotected void_addSetterMethod(Map<String,POJOPropertyBuilder> props, AnnotatedMethod m, AnnotationIntrospector ai)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_removeUnwantedAccessor(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 void_sortProperties(Map<String,POJOPropertyBuilder> props)protected void_updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties)protected voidcollectAll()Internal method that will collect actual property information.Class<?>findPOJOBuilderClass()Method for finding Class to use as POJO builder, if any.AnnotationIntrospectorgetAnnotationIntrospector()AnnotatedMembergetAnyGetter()AnnotatedMembergetAnySetterField()AnnotatedMethodgetAnySetterMethod()AnnotatedClassgetClassDef()MapperConfig<?>getConfig()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()AnnotatedMembergetJsonValueAccessor()AnnotatedMethodgetJsonValueMethod()Deprecated.ObjectIdInfogetObjectIdInfo()Accessor to find out whether type specified requires inclusion of Object Identifier.List<BeanPropertyDefinition>getProperties()protected Map<String,POJOPropertyBuilder>getPropertyMap()JavaTypegetType()protected voidreportProblem(String msg, Object... args)
-
-
-
Field Detail
-
_config
protected final MapperConfig<?> _config
Configuration settings
-
_forSerialization
protected final boolean _forSerialization
True if introspection is done for serialization (giving precedence for serialization annotations), or not (false, deserialization)
-
_stdBeanNaming
protected final boolean _stdBeanNaming
- Since:
- 2.5
-
_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
-
_mutatorPrefix
protected final String _mutatorPrefix
Prefix used by auto-detected mutators ("setters"): usually "set", but differs for builder objects ("with" by default).
-
_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 LinkedList<POJOPropertyBuilder> _creatorProperties
-
_anyGetters
protected LinkedList<AnnotatedMember> _anyGetters
-
_anySetters
protected LinkedList<AnnotatedMethod> _anySetters
-
_anySetterField
protected LinkedList<AnnotatedMember> _anySetterField
-
_jsonValueAccessors
protected LinkedList<AnnotatedMember> _jsonValueAccessors
Method(s) marked with 'JsonValue' annotationNOTE: before 2.9, was `AnnotatedMethod`; with 2.9 allows fields too
-
_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.
-
-
Constructor Detail
-
POJOPropertiesCollector
protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, String mutatorPrefix)
-
-
Method Detail
-
getConfig
public MapperConfig<?> getConfig()
-
getType
public JavaType getType()
-
getClassDef
public AnnotatedClass getClassDef()
-
getAnnotationIntrospector
public AnnotationIntrospector getAnnotationIntrospector()
-
getProperties
public List<BeanPropertyDefinition> getProperties()
-
getInjectables
public Map<Object,AnnotatedMember> getInjectables()
-
getJsonValueMethod
@Deprecated public AnnotatedMethod getJsonValueMethod()
Deprecated.
-
getJsonValueAccessor
public AnnotatedMember getJsonValueAccessor()
- Since:
- 2.9
-
getAnyGetter
public AnnotatedMember 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.
-
findPOJOBuilderClass
public Class<?> findPOJOBuilderClass()
Method for finding Class to use as POJO builder, if any.
-
getPropertyMap
protected Map<String,POJOPropertyBuilder> getPropertyMap()
-
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)
Method for collecting basic information on constructor(s) found
-
_addCreatorParam
protected void _addCreatorParam(Map<String,POJOPropertyBuilder> props, AnnotatedParameter param)
- Since:
- 2.4
-
_addMethods
protected void _addMethods(Map<String,POJOPropertyBuilder> props)
Method for collecting basic information on all fields 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.
-
_removeUnwantedAccessor
protected void _removeUnwantedAccessor(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).
-
_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)
-
_property
protected POJOPropertyBuilder _property(Map<String,POJOPropertyBuilder> props, PropertyName name)
-
_property
protected POJOPropertyBuilder _property(Map<String,POJOPropertyBuilder> props, String implName)
-
_updateCreatorProperty
protected void _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties)
-
-