com.fasterxml.jackson.databind.introspect

Class DefaultAccessorNamingStrategy

    • Field Detail

      • _stdBeanNaming

        protected final boolean _stdBeanNaming
      • _getterPrefix

        protected final String _getterPrefix
      • _isGetterPrefix

        protected final String _isGetterPrefix
      • _mutatorPrefix

        protected final String _mutatorPrefix
        Prefix used by auto-detected mutators ("setters"): usually "set", but differs for builder objects ("with" by default).
    • Method Detail

      • findNameForIsGetter

        public String findNameForIsGetter(AnnotatedMethod am,
                                          String name)
        Description copied from class: AccessorNamingStrategy
        Method called to find whether given method would be considered an "is-getter" getter method in context of type introspected, and if so, what is the logical property it is associated with (which in turn suggest external name for property)

        Note that signature acceptability has already been checked (no arguments, has return value) but NOT the specific limitation that return type should be of boolean type -- implementation should apply latter check, if so desired (some languages may use different criteria). It is also possible that some implementations allow different return types than boolean types.

        Note that visibility checks are applied separately; strategy does not need to be concerned with that aspect.

        Specified by:
        findNameForIsGetter in class AccessorNamingStrategy
        Parameters:
        am - Method to check
        name - Name to check (usually same as AnnotatedMethod.getName()
        Returns:
        Implied property name for is-getter method, if match; null to indicate that the name does not conform to expected naming convention
      • findNameForMutator

        public String findNameForMutator(AnnotatedMethod am,
                                         String name)
        Description copied from class: AccessorNamingStrategy
        Method called to find whether given method would be considered a "mutator" (usually setter, but for builders "with-method" or similar) in context of type introspected, and if so, what is the logical property it is associated with (which in turn suggest external name for property)

        Note that signature acceptability has already been checked (exactly one parameter) by caller.

        Note that visibility checks are applied separately; strategy does not need to be concerned with that aspect.

        Specified by:
        findNameForMutator in class AccessorNamingStrategy
        Parameters:
        am - Method to check
        name - Name to check (usually same as AnnotatedMethod.getName()
        Returns:
        Implied property name for mutator method, if match; null to indicate that the name does not conform to expected naming convention
      • modifyFieldName

        public String modifyFieldName(AnnotatedField field,
                                      String name)
        Description copied from class: AccessorNamingStrategy
        Method called to find the name of logical property that given field should be associated with, if any.

        Note that visibility checks are applied separately; strategy does not need to be concerned with that aspect.

        Specified by:
        modifyFieldName in class AccessorNamingStrategy
        Parameters:
        field - Field to check
        name - Name to check (usually same as AnnotatedField.getName()
        Returns:
        Implied property name matching given field (often field name as-is) or null to indicate that the name does not conform to expected naming convention (and will not be considered for property access)
      • legacyManglePropertyName

        protected String legacyManglePropertyName(String basename,
                                                  int offset)
        Method called to figure out name of the property, given corresponding suggested name based on a method or field name.
        Parameters:
        basename - Name of accessor/mutator method, not including prefix ("get"/"is"/"set")
      • stdManglePropertyName

        protected String stdManglePropertyName(String basename,
                                               int offset)
      • _isCglibGetCallbacks

        protected boolean _isCglibGetCallbacks(AnnotatedMethod am)
      • _isGroovyMetaClassGetter

        protected boolean _isGroovyMetaClassGetter(AnnotatedMethod am)

Copyright © 2008–2021 FasterXML. All rights reserved.