com.fasterxml.jackson.databind.introspect

## Class DefaultAccessorNamingStrategy.Provider

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

All Implemented Interfaces:
  Serializable

Enclosing class:
  DefaultAccessorNamingStrategy

    public static class DefaultAccessorNamingStrategy.Provider
    extends AccessorNamingStrategy.Provider
    implements Serializable

Provider for `DefaultAccessorNamingStrategy`.

Default instance will use following default prefixes:

- Setter for regular POJOs: "set"
- Builder-mutator: "with"
- Regular getter: "get"
- Is-getter (for Boolean values): "is"

and no additional restrictions on base names accepted (configurable for limits using `DefaultAccessorNamingStrategy.BaseNameValidator`), allowing names like "get_value()" and "getvalue()".

See Also:
  Serialized Form

### Field Summary

Fields
`protected DefaultAccessorNamingStrategy.BaseNameValidator` `_baseNameValidator`
`protected String` `_getterPrefix`
`protected String` `_isGetterPrefix`
`protected String` `_setterPrefix`
`protected String` `_withPrefix`

### Constructor Summary

Constructors
`` `Provider()`
`protected` `Provider(DefaultAccessorNamingStrategy.Provider p, DefaultAccessorNamingStrategy.BaseNameValidator vld)`
`protected` `Provider(DefaultAccessorNamingStrategy.Provider p, String setterPrefix, String withPrefix, String getterPrefix, String isGetterPrefix)`
`protected` `Provider(String setterPrefix, String withPrefix, String getterPrefix, String isGetterPrefix, DefaultAccessorNamingStrategy.BaseNameValidator vld)`

### Method Summary

All Methods Instance Methods Concrete Methods
`AccessorNamingStrategy` `forBuilder(MapperConfig<?> config, AnnotatedClass builderClass, BeanDescription valueTypeDesc)` Factory method for creating strategy instance for POJOs that are deserialized using Builder type: in this case eventual target (value) type is different from type of "builder" object that is used by databinding to accumulate state.
`AccessorNamingStrategy` `forPOJO(MapperConfig<?> config, AnnotatedClass targetClass)` Factory method for creating strategy instance for a "regular" POJO, called if none of the other factory methods is applicable.
`AccessorNamingStrategy` `forRecord(MapperConfig<?> config, AnnotatedClass recordClass)` Factory method for creating strategy instance for special `java.lang.Record` type (new in JDK 14).
`DefaultAccessorNamingStrategy.Provider` `withBaseNameValidator(DefaultAccessorNamingStrategy.BaseNameValidator vld)` Mutant factory for specifying validator that is used to further verify that base name derived from accessor name is acceptable: this can be used to add further restrictions such as limit that the first character of the base name is an upper-case letter.
`DefaultAccessorNamingStrategy.Provider` `withBuilderPrefix(String prefix)` Mutant factory for changing the prefix used for Builders (from default `JsonPOJOBuilder.DEFAULT_WITH_PREFIX`)
`DefaultAccessorNamingStrategy.Provider` `withFirstCharAcceptance(boolean allowLowerCaseFirstChar, boolean allowNonLetterFirstChar)` Mutant factory for changing the rules regarding which characters are allowed as the first character of property base name, after checking and removing prefix.
`DefaultAccessorNamingStrategy.Provider` `withGetterPrefix(String prefix)` Mutant factory for changing the prefix used for "getter" methods
`DefaultAccessorNamingStrategy.Provider` `withIsGetterPrefix(String prefix)` Mutant factory for changing the prefix used for "is-getter" methods (getters that return boolean/Boolean value).
`DefaultAccessorNamingStrategy.Provider` `withSetterPrefix(String prefix)` Mutant factory for changing the prefix used for "setter" methods

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

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

### Field Detail

#### _setterPrefix

    protected final String _setterPrefix

#### _withPrefix

    protected final String _withPrefix

#### _getterPrefix

    protected final String _getterPrefix

#### _isGetterPrefix

    protected final String _isGetterPrefix

#### _baseNameValidator

    protected final DefaultAccessorNamingStrategy.BaseNameValidator _baseNameValidator

### Constructor Detail

#### Provider

    public Provider()

#### Provider

    protected Provider(DefaultAccessorNamingStrategy.Provider p,
                       String setterPrefix,
                       String withPrefix,
                       String getterPrefix,
                       String isGetterPrefix)

#### Provider

    protected Provider(DefaultAccessorNamingStrategy.Provider p,
                       DefaultAccessorNamingStrategy.BaseNameValidator vld)

#### Provider

    protected Provider(String setterPrefix,
                       String withPrefix,
                       String getterPrefix,
                       String isGetterPrefix,
                       DefaultAccessorNamingStrategy.BaseNameValidator vld)

### Method Detail

#### withSetterPrefix

    public DefaultAccessorNamingStrategy.Provider withSetterPrefix(String prefix)

Mutant factory for changing the prefix used for "setter" methods

Parameters:
  `prefix` - Prefix to use; or empty String `""` to not use any prefix (meaning signature-compatible method name is used as the property basename (and subject to name mangling)), or `null` to prevent name-based detection.
Returns:
  Provider instance with specified setter-prefix

#### withBuilderPrefix

    public DefaultAccessorNamingStrategy.Provider withBuilderPrefix(String prefix)

Mutant factory for changing the prefix used for Builders (from default `JsonPOJOBuilder.DEFAULT_WITH_PREFIX`)

Parameters:
  `prefix` - Prefix to use; or empty String `""` to not use any prefix (meaning signature-compatible method name is used as the property basename (and subject to name mangling)), or `null` to prevent name-based detection.
Returns:
  Provider instance with specified with-prefix

#### withGetterPrefix

    public DefaultAccessorNamingStrategy.Provider withGetterPrefix(String prefix)

Mutant factory for changing the prefix used for "getter" methods

Parameters:
  `prefix` - Prefix to use; or empty String `""` to not use any prefix (meaning signature-compatible method name is used as the property basename (and subject to name mangling)), or `null` to prevent name-based detection.
Returns:
  Provider instance with specified getter-prefix

#### withIsGetterPrefix

    public DefaultAccessorNamingStrategy.Provider withIsGetterPrefix(String prefix)

Mutant factory for changing the prefix used for "is-getter" methods (getters that return boolean/Boolean value).

Parameters:
  `prefix` - Prefix to use; or empty String `""` to not use any prefix (meaning signature-compatible method name is used as the property basename (and subject to name mangling)). or `null` to prevent name-based detection.
Returns:
  Provider instance with specified is-getter-prefix

#### withFirstCharAcceptance

    public DefaultAccessorNamingStrategy.Provider withFirstCharAcceptance(boolean allowLowerCaseFirstChar,
                                                                          boolean allowNonLetterFirstChar)

Mutant factory for changing the rules regarding which characters are allowed as the first character of property base name, after checking and removing prefix.

For example, consider "getter" method candidate (no arguments, has return type) named `getValue()` is considered, with "getter-prefix" defined as `get`, then base name is `Value` and the first character to consider is `V`. Upper-case letters are always accepted so this is fine. But with similar settings, method `get_value()` would only be recognized as getter if `allowNonLetterFirstChar` is set to `true`: otherwise it will not be considered a getter-method. Similarly "is-getter" candidate method with name `island()` would only be considered if `allowLowerCaseFirstChar` is set to `true`.

Parameters:
  `allowLowerCaseFirstChar` - Whether base names that start with lower-case letter (like `"a"` or `"b"`) are accepted as valid or not: consider difference between "setter-methods" `setValue()` and `setvalue()`.
  `allowNonLetterFirstChar` - Whether base names that start with non-letter character (like `"_"` or number `1`) are accepted as valid or not: consider difference between "setter-methods" `setValue()` and `set_value()`.
Returns:
  Provider instance with specified validity rules

#### withBaseNameValidator

    public DefaultAccessorNamingStrategy.Provider withBaseNameValidator(DefaultAccessorNamingStrategy.BaseNameValidator vld)

Mutant factory for specifying validator that is used to further verify that base name derived from accessor name is acceptable: this can be used to add further restrictions such as limit that the first character of the base name is an upper-case letter.

Parameters:
  `vld` - Validator to use, if any; `null` to indicate no additional rules
Returns:
  Provider instance with specified base name validator to use, if any

#### forPOJO

    public AccessorNamingStrategy forPOJO(MapperConfig<?> config,
                                          AnnotatedClass targetClass)

Description copied from class: `AccessorNamingStrategy.Provider`
Factory method for creating strategy instance for a "regular" POJO, called if none of the other factory methods is applicable.

Specified by:
  `forPOJO` in class `AccessorNamingStrategy.Provider`
Parameters:
  `config` - Current mapper configuration
  `targetClass` - Information about value type
Returns:
  Naming strategy instance to use

#### forBuilder

    public AccessorNamingStrategy forBuilder(MapperConfig<?> config,
                                             AnnotatedClass builderClass,
                                             BeanDescription valueTypeDesc)

Description copied from class: `AccessorNamingStrategy.Provider`
Factory method for creating strategy instance for POJOs that are deserialized using Builder type: in this case eventual target (value) type is different from type of "builder" object that is used by databinding to accumulate state.

Specified by:
  `forBuilder` in class `AccessorNamingStrategy.Provider`
Parameters:
  `config` - Current mapper configuration
  `builderClass` - Information about builder type
  `valueTypeDesc` - Information about the eventual target (value) type
Returns:
  Naming strategy instance to use

#### forRecord

    public AccessorNamingStrategy forRecord(MapperConfig<?> config,
                                            AnnotatedClass recordClass)

Description copied from class: `AccessorNamingStrategy.Provider`
Factory method for creating strategy instance for special `java.lang.Record` type (new in JDK 14).

Specified by:
  `forRecord` in class `AccessorNamingStrategy.Provider`
Parameters:
  `config` - Current mapper configuration
  `recordClass` - Information about value type (of type `java.lang.Record`)
Returns:
  Naming strategy instance to use