Class POJOPropertiesCollector


  • public class POJOPropertiesCollector
    extends java.lang.Object
    Helper class used for aggregating information about all possible properties of a POJO.
    • 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)
      • _useAnnotations

        protected final boolean _useAnnotations
        Since:
        2.9
      • _collected

        protected boolean _collected
        State flag we keep to indicate whether actual property information has been collected or not.
      • _properties

        protected java.util.LinkedHashMap<java.lang.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.

      • _fieldRenameMappings

        protected java.util.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.

        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
      • _anyGetterField

        protected java.util.LinkedList<AnnotatedMember> _anyGetterField
        Since:
        2.12
      • _anySetterField

        protected java.util.LinkedList<AnnotatedMember> _anySetterField
      • _jsonKeyAccessors

        protected java.util.LinkedList<AnnotatedMember> _jsonKeyAccessors
        Accessors (field or "getter" method annotated with JsonKey
        Since:
        2.12
      • _jsonValueAccessors

        protected java.util.LinkedList<AnnotatedMember> _jsonValueAccessors
        Accessors (field or "getter" method) annotated with JsonValue
      • _ignoredPropertyNames

        protected java.util.HashSet<java.lang.String> _ignoredPropertyNames
        Lazily collected list of properties that can be implicitly ignored during serialization; only updated when collecting information for deserialization purposes
      • _injectables

        protected java.util.LinkedHashMap<java.lang.Object,​AnnotatedMember> _injectables
        Lazily collected list of members that were annotated to indicate that they represent mutators for deserializer value injection.
      • _stdBeanNaming

        @Deprecated
        protected final boolean _stdBeanNaming
        Deprecated.
        Since 2.12
      • _mutatorPrefix

        @Deprecated
        protected java.lang.String _mutatorPrefix
        Deprecated.
        Since 2.12
    • Method Detail

      • getInjectables

        public java.util.Map<java.lang.Object,​AnnotatedMember> getInjectables()
      • getJsonKeyAccessor

        public AnnotatedMember getJsonKeyAccessor()
        Since:
        2.12
      • getJsonValueAccessor

        public AnnotatedMember getJsonValueAccessor()
        Since:
        2.9
      • getAnyGetterField

        public AnnotatedMember getAnyGetterField()
        Since:
        2.12 (before only had "getAnyGetter()")
      • getAnyGetterMethod

        public AnnotatedMember getAnyGetterMethod()
        Since:
        2.12 (before only had "getAnyGetter()")
      • getIgnoredPropertyNames

        public java.util.Set<java.lang.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 java.util.Map<java.lang.String,​POJOPropertyBuilder> getPropertyMap()
      • getJsonValueMethod

        @Deprecated
        public AnnotatedMethod getJsonValueMethod()
        Deprecated.
      • findPOJOBuilderClass

        @Deprecated
        public java.lang.Class<?> findPOJOBuilderClass()
        Deprecated.
      • collectAll

        protected void collectAll()
        Internal method that will collect actual property information.
        Since:
        2.6
      • _addFields

        protected void _addFields​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
        Method for collecting basic information on all fields found
      • _addCreators

        protected void _addCreators​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
        Method for collecting basic information on constructor(s) found
      • _addMethods

        protected void _addMethods​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
        Method for collecting basic information on all fields found
      • _addInjectables

        protected void _addInjectables​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
      • _doAddInjectable

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

        protected void _removeUnwantedProperties​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
        Method called to get rid of candidate properties that are marked as ignored.
      • _removeUnwantedAccessor

        protected void _removeUnwantedAccessor​(java.util.Map<java.lang.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​(java.lang.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​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
      • _renameWithWrappers

        protected void _renameWithWrappers​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
      • _sortProperties

        protected void _sortProperties​(java.util.Map<java.lang.String,​POJOPropertyBuilder> props)
      • reportProblem

        protected void reportProblem​(java.lang.String msg,
                                     java.lang.Object... args)