com.fasterxml.jackson.databind.introspect

## Class DefaultAccessorNamingStrategy.RecordNaming

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy
  - - com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy
    - - com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy.RecordNaming

- Enclosing class:
    DefaultAccessorNamingStrategy

      public static class DefaultAccessorNamingStrategy.RecordNaming
      extends DefaultAccessorNamingStrategy

  Implementation used for supporting "non-prefix" naming convention of Java 14 `java.lang.Record` types, and in particular find default accessors for declared record fields.

  Current / initial implementation will also recognize additional "normal" getters ("get"-prefix) and is-getters ("is"-prefix and boolean return value) by name.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy

      `DefaultAccessorNamingStrategy.BaseNameValidator, DefaultAccessorNamingStrategy.FirstCharBasedValidator, DefaultAccessorNamingStrategy.Provider, DefaultAccessorNamingStrategy.RecordNaming`

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy

      `AccessorNamingStrategy.Base`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Set<String>` | `_fieldNames` Names of actual Record fields from definition; auto-detected.

    - ### Fields inherited from class com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy

      `_baseNameValidator, _config, _forClass, _getterPrefix, _isGetterPrefix, _mutatorPrefix, _stdBeanNaming`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RecordNaming(MapperConfig<?> config, AnnotatedClass forClass)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `findNameForRegularGetter(AnnotatedMethod am, 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)

    - ### Methods inherited from class com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy

      `_isCglibGetCallbacks, _isGroovyMetaClassGetter, findNameForIsGetter, findNameForMutator, legacyManglePropertyName, modifyFieldName, stdManglePropertyName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _fieldNames

          protected final Set<String> _fieldNames

      Names of actual Record fields from definition; auto-detected.

  - ### Constructor Detail

    - #### RecordNaming

          public RecordNaming(MapperConfig<?> config,
                              AnnotatedClass forClass)

  - ### Method Detail

    - #### findNameForRegularGetter

          public String findNameForRegularGetter(AnnotatedMethod am,
                                                 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.

      Overrides:
        `findNameForRegularGetter` in class `DefaultAccessorNamingStrategy`
      Parameters:
        `am` - 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

Copyright © 2008–2020 FasterXML. All rights reserved.