public class POJOPropertiesCollector extends Object
Modifier and Type | Field and Description |
---|---|
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 LinkedList<POJOPropertyBuilder> |
_creatorProperties |
protected Map<PropertyName,PropertyName> |
_fieldRenameMappings
A set of "field renamings" that have been discovered, indicating
intended renaming of other accesors: key is the implicit original
name and value intended name to use instead.
|
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 String |
_mutatorPrefix
Deprecated.
Since 2.12
|
protected LinkedHashMap<String,POJOPropertyBuilder> |
_properties
Set of logical property information collected so far.
|
protected boolean |
_stdBeanNaming
Deprecated.
Since 2.12
|
protected JavaType |
_type
Type of POJO for which properties are being collected.
|
protected boolean |
_useAnnotations |
protected VisibilityChecker<?> |
_visibilityChecker |
Modifier | Constructor and Description |
---|---|
protected |
POJOPropertiesCollector(MapperConfig<?> config,
boolean forSerialization,
JavaType type,
AnnotatedClass classDef,
AccessorNamingStrategy accessorNaming) |
protected |
POJOPropertiesCollector(MapperConfig<?> config,
boolean forSerialization,
JavaType type,
AnnotatedClass classDef,
String mutatorPrefix)
Deprecated.
Since 2.12
|
Modifier and Type | Method and 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) found
|
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 fields 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(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 boolean |
_replaceCreatorProperty(POJOPropertyBuilder prop,
List<POJOPropertyBuilder> creatorProperties) |
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 |
_updateCreatorProperty(POJOPropertyBuilder prop,
List<POJOPropertyBuilder> creatorProperties)
Deprecated.
|
protected void |
collectAll()
Internal method that will collect actual property information.
|
Class<?> |
findPOJOBuilderClass()
Deprecated.
|
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() |
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() |
AnnotatedMethod |
getJsonValueMethod()
Deprecated.
|
ObjectIdInfo |
getObjectIdInfo()
Accessor to find out whether type specified requires inclusion
of Object Identifier.
|
List<BeanPropertyDefinition> |
getProperties() |
protected Map<String,POJOPropertyBuilder> |
getPropertyMap() |
JavaType |
getType() |
boolean |
isRecordType() |
protected void |
reportProblem(String msg,
Object... args) |
protected final MapperConfig<?> _config
protected final AccessorNamingStrategy _accessorNaming
protected final boolean _forSerialization
protected final JavaType _type
protected final AnnotatedClass _classDef
protected final VisibilityChecker<?> _visibilityChecker
protected final AnnotationIntrospector _annotationIntrospector
protected final boolean _useAnnotations
protected final boolean _isRecordType
protected boolean _collected
protected LinkedHashMap<String,POJOPropertyBuilder> _properties
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.
protected LinkedList<POJOPropertyBuilder> _creatorProperties
protected Map<PropertyName,PropertyName> _fieldRenameMappings
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.
protected LinkedList<AnnotatedMember> _anyGetters
protected LinkedList<AnnotatedMember> _anyGetterField
protected LinkedList<AnnotatedMethod> _anySetters
protected LinkedList<AnnotatedMember> _anySetterField
protected LinkedList<AnnotatedMember> _jsonKeyAccessors
JsonKey
protected LinkedList<AnnotatedMember> _jsonValueAccessors
JsonValue
protected HashSet<String> _ignoredPropertyNames
protected LinkedHashMap<Object,AnnotatedMember> _injectables
@Deprecated protected final boolean _stdBeanNaming
@Deprecated protected String _mutatorPrefix
protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, AccessorNamingStrategy accessorNaming)
@Deprecated protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, String mutatorPrefix)
public MapperConfig<?> getConfig()
public JavaType getType()
public boolean isRecordType()
public AnnotatedClass getClassDef()
public AnnotationIntrospector getAnnotationIntrospector()
public List<BeanPropertyDefinition> getProperties()
public Map<Object,AnnotatedMember> getInjectables()
public AnnotatedMember getJsonKeyAccessor()
public AnnotatedMember getJsonValueAccessor()
@Deprecated public AnnotatedMember getAnyGetter()
getAnyGetterMethod()
and
getAnyGetterField()
.getAnyGetterMethod()
.public AnnotatedMember getAnyGetterField()
public AnnotatedMember getAnyGetterMethod()
public AnnotatedMember getAnySetterField()
public AnnotatedMethod getAnySetterMethod()
public Set<String> getIgnoredPropertyNames()
public ObjectIdInfo getObjectIdInfo()
protected Map<String,POJOPropertyBuilder> getPropertyMap()
@Deprecated public AnnotatedMethod getJsonValueMethod()
@Deprecated public Class<?> findPOJOBuilderClass()
protected void collectAll()
protected void _addFields(Map<String,POJOPropertyBuilder> props)
protected void _addCreators(Map<String,POJOPropertyBuilder> props)
protected void _addCreatorParam(Map<String,POJOPropertyBuilder> props, AnnotatedParameter param)
protected void _addMethods(Map<String,POJOPropertyBuilder> props)
protected void _addGetterMethod(Map<String,POJOPropertyBuilder> props, AnnotatedMethod m, AnnotationIntrospector ai)
protected void _addSetterMethod(Map<String,POJOPropertyBuilder> props, AnnotatedMethod m, AnnotationIntrospector ai)
protected void _addInjectables(Map<String,POJOPropertyBuilder> props)
protected void _doAddInjectable(JacksonInject.Value injectable, AnnotatedMember m)
protected void _removeUnwantedProperties(Map<String,POJOPropertyBuilder> props)
protected void _removeUnwantedAccessor(Map<String,POJOPropertyBuilder> props)
protected void _collectIgnorals(String name)
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 boolean _resolveFieldVsGetter(List<AnnotatedMember> accessors)
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.
protected POJOPropertyBuilder _property(Map<String,POJOPropertyBuilder> props, PropertyName name)
protected POJOPropertyBuilder _property(Map<String,POJOPropertyBuilder> props, String implName)
@Deprecated protected void _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties)
protected boolean _replaceCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties)
Copyright © 2008–2023 FasterXML. All rights reserved.