Class AccessorNamingStrategy.Base

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    AccessorNamingStrategy

    public static class AccessorNamingStrategy.Base
    extends AccessorNamingStrategy
    implements java.io.Serializable
    Helper class that implements all abstract methods with dummy implementations. Behavior is as follows:
    • No getter or is-getter methods are recognized: relevant methods return null
    • No setter methods are recognized: relevant methods return null
    • Names of fields are returned as-is, without modifications (meaning they may be discovered if they are otherwise visible
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Base()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String findNameForIsGetter​(AnnotatedMethod method, java.lang.String name)
      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)
      java.lang.String findNameForMutator​(AnnotatedMethod method, java.lang.String name)
      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)
      java.lang.String findNameForRegularGetter​(AnnotatedMethod method, java.lang.String name)
      Method called to find whether given method would be considered a "regular" 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)
      java.lang.String modifyFieldName​(AnnotatedField field, java.lang.String name)
      Method called to find the name of logical property that given field should be associated with, if any.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Base

        public Base()
    • Method Detail

      • findNameForIsGetter

        public java.lang.String findNameForIsGetter​(AnnotatedMethod method,
                                                    java.lang.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:
        method - 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
      • findNameForRegularGetter

        public java.lang.String findNameForRegularGetter​(AnnotatedMethod method,
                                                         java.lang.String name)
        Description copied from class: AccessorNamingStrategy
        Method called to find whether given method would be considered a "regular" 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, does have a return value) by caller.

        Note that this method MAY be called for potential "is-getter" methods too (before AccessorNamingStrategy.findNameForIsGetter(com.fasterxml.jackson.databind.introspect.AnnotatedMethod, java.lang.String))

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

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

        public java.lang.String findNameForMutator​(AnnotatedMethod method,
                                                   java.lang.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:
        method - 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 java.lang.String modifyFieldName​(AnnotatedField field,
                                                java.lang.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)