Class POJOPropertiesCollector
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector
Helper class used for aggregating information about all possible
properties of a POJO.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AccessorNamingStrategy
Handler used for name-mangling of getter, mutator (setter/with) methodsprotected final AnnotationIntrospector
protected LinkedList<AnnotatedMember>
protected LinkedList<AnnotatedMember>
protected LinkedList<AnnotatedMember>
protected LinkedList<AnnotatedMethod>
protected final AnnotatedClass
Low-level introspected class information (methods, fields etc)protected boolean
State flag we keep to indicate whether actual property information has been collected or not.protected final MapperConfig<?>
Configuration settingsprotected LinkedList<POJOPropertyBuilder>
protected Map<PropertyName,
PropertyName> 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 final boolean
True 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 LinkedList<AnnotatedMember>
Accessors (field or "getter" method annotated withJsonKey
protected LinkedList<AnnotatedMember>
Accessors (field or "getter" method) annotated withJsonValue
protected String
Deprecated.Since 2.12protected LinkedHashMap<String,
POJOPropertyBuilder> Set of logical property information collected so far.protected final boolean
Deprecated.Since 2.12protected final JavaType
Type of POJO for which properties are being collected.protected final boolean
protected final VisibilityChecker<?>
-
Constructor Summary
ModifierConstructorDescriptionprotected
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
_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
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
Method called to get rid of candidate properties that are marked as ignored.protected void
protected void
_renameUsing
(Map<String, POJOPropertyBuilder> propMap, PropertyNamingStrategy naming) protected void
protected boolean
_replaceCreatorProperty
(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) protected boolean
_resolveFieldVsGetter
(List<AnnotatedMember> accessors) Method that will be given aList
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
Internal method that will collect actual property information.Class<?>
Deprecated.Deprecated.Since 2.12 use separategetAnyGetterMethod()
andgetAnyGetterField()
.MapperConfig<?>
Accessor for set of properties that are explicitly marked to be ignored via per-property markers (but NOT class annotations).Deprecated.Accessor to find out whether type specified requires inclusion of Object Identifier.protected Map<String,
POJOPropertyBuilder> getType()
protected void
reportProblem
(String msg, Object... args)
-
Field Details
-
_config
Configuration settings -
_accessorNaming
Handler used for name-mangling of getter, mutator (setter/with) methods- Since:
- 2.12
-
_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- Since:
- 2.9
-
_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.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
-
_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.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
-
_anyGetterField
- Since:
- 2.12
-
_anySetters
-
_anySetterField
-
_jsonKeyAccessors
Accessors (field or "getter" method annotated withJsonKey
- Since:
- 2.12
-
_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. -
_stdBeanNaming
Deprecated.Since 2.12 -
_mutatorPrefix
Deprecated.Since 2.12
-
-
Constructor Details
-
POJOPropertiesCollector
protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, AccessorNamingStrategy accessorNaming) - Since:
- 2.12
-
POJOPropertiesCollector
@Deprecated protected POJOPropertiesCollector(MapperConfig<?> config, boolean forSerialization, JavaType type, AnnotatedClass classDef, String mutatorPrefix) Deprecated.Since 2.12
-
-
Method Details
-
getConfig
-
getType
-
getClassDef
-
getAnnotationIntrospector
-
getProperties
-
getInjectables
-
getJsonKeyAccessor
- Since:
- 2.12
-
getJsonValueAccessor
- Since:
- 2.9
-
getAnyGetter
Deprecated.Since 2.12 use separategetAnyGetterMethod()
andgetAnyGetterField()
.Alias forgetAnyGetterMethod()
. -
getAnyGetterField
- Since:
- 2.12 (before only had "getAnyGetter()")
-
getAnyGetterMethod
- Since:
- 2.12 (before only had "getAnyGetter()")
-
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
-
getJsonValueMethod
Deprecated. -
findPOJOBuilderClass
Deprecated. -
collectAll
protected void collectAll()Internal method that will collect actual property information.- Since:
- 2.6
-
_addFields
Method for collecting basic information on all fields found -
_addCreators
Method for collecting basic information on constructor(s) found -
_addCreatorParam
- Since:
- 2.4
-
_addMethods
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
-
_doAddInjectable
-
_removeUnwantedProperties
Method called to get rid of candidate properties that are marked as ignored. -
_removeUnwantedAccessor
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 aList
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 returnstrue
, otherwisefalse
.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
-
_property
-
_property
-
_updateCreatorProperty
@Deprecated protected void _updateCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties) Deprecated. -
_replaceCreatorProperty
protected boolean _replaceCreatorProperty(POJOPropertyBuilder prop, List<POJOPropertyBuilder> creatorProperties)
-