Top Description Inners Constructors Methods
com.fasterxml.jackson.databind.introspect

public abstract Class AccessorNamingStrategy

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.Base, com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy
Imports
com.fasterxml.jackson.databind.BeanDescription, com.fasterxml.jackson.databind.cfg.MapperConfig

API for handlers used to "mangle" names of "getter" and "setter" methods to find implicit property names.
Since
2.12

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AccessorNamingStrategy.Base

Helper class that implements all abstract methods with dummy implementations.

public abstract static class
AccessorNamingStrategy.Provider

Interface for provider (factory) for constructing AccessorNamingStrategy for given type of deserialization target

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

Implied property name for is-getter method, if match; null to indicate that the name does not conform to expected naming convention
findNameForIsGetter
(AnnotatedMethod
Method to check
method
,
String
Name to check (usually same as AnnotatedMethod#getName()
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)

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).

public abstract String

Returns:

Implied property name for mutator method, if match; null to indicate that the name does not conform to expected naming convention
findNameForMutator
(AnnotatedMethod
Method to check
method
,
String
Name to check (usually same as AnnotatedMethod#getName()
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)

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

public abstract String

Returns:

Implied property name for getter method, if match; null to indicate that the name does not conform to expected naming convention
findNameForRegularGetter
(AnnotatedMethod
Method to check
method
,
String
Name to check (usually same as AnnotatedMethod#getName()
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)

Note that signature acceptability has already been checked (no arguments, does have a return value) by caller.

public abstract String

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)
modifyFieldName
(AnnotatedField
Field to check
field
,
String
Name to check (usually same as AnnotatedField#getName()
name
)

Method called to find the name of logical property that given field should be associated with, if any.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AccessorNamingStrategyback to summary
public AccessorNamingStrategy()

Method Detail

findNameForIsGetterback to summary
public abstract String findNameForIsGetter(AnnotatedMethod method, 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)

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.

Parameters
method:AnnotatedMethod

Method to check

name:String

Name to check (usually same as AnnotatedMethod#getName()

Returns:String

Implied property name for is-getter method, if match; null to indicate that the name does not conform to expected naming convention

findNameForMutatorback to summary
public abstract String findNameForMutator(AnnotatedMethod method, 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)

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.

Parameters
method:AnnotatedMethod

Method to check

name:String

Name to check (usually same as AnnotatedMethod#getName()

Returns:String

Implied property name for mutator method, if match; null to indicate that the name does not conform to expected naming convention

findNameForRegularGetterback to summary
public abstract String findNameForRegularGetter(AnnotatedMethod method, 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)

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 findNameForIsGetter)

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

Parameters
method:AnnotatedMethod

Method to check

name:String

Name to check (usually same as AnnotatedMethod#getName()

Returns:String

Implied property name for getter method, if match; null to indicate that the name does not conform to expected naming convention

modifyFieldNameback to summary
public abstract String modifyFieldName(AnnotatedField field, String name)

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.

Parameters
field:AnnotatedField

Field to check

name:String

Name to check (usually same as AnnotatedField#getName()

Returns:String

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)

com.fasterxml.jackson.databind.introspect back to summary

public Class AccessorNamingStrategy.Base

extends AccessorNamingStrategy
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Helper class that implements all abstract methods with dummy implementations. Behavior is as follows:

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
Base()

Method Summary

Modifier and TypeMethod and Description
public String
findNameForIsGetter(AnnotatedMethod
Method to check
method
,
String
Name to check (usually same as AnnotatedMethod#getName()
name
)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForIsGetter.

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).

public String
findNameForMutator(AnnotatedMethod
Method to check
method
,
String
Name to check (usually same as AnnotatedMethod#getName()
name
)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForMutator.

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.

public String
findNameForRegularGetter(AnnotatedMethod
Method to check
method
,
String
Name to check (usually same as AnnotatedMethod#getName()
name
)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForRegularGetter.

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.

public String
modifyFieldName(AnnotatedField
Field to check
field
,
String
Name to check (usually same as AnnotatedField#getName()
name
)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.modifyFieldName.

Method called to find the name of logical property that given field should be associated with, if any.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Baseback to summary
public Base()

Method Detail

findNameForIsGetterback to summary
public String findNameForIsGetter(AnnotatedMethod method, String name)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForIsGetter.

Doc from com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForIsGetter.

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.

Parameters
method:AnnotatedMethod

Method to check

name:String

Name to check (usually same as AnnotatedMethod#getName()

Returns:String

Implied property name for is-getter method, if match; null to indicate that the name does not conform to expected naming convention

Annotations
@Override
findNameForMutatorback to summary
public String findNameForMutator(AnnotatedMethod method, String name)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForMutator.

Doc from com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForMutator.

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.

Parameters
method:AnnotatedMethod

Method to check

name:String

Name to check (usually same as AnnotatedMethod#getName()

Returns:String

Implied property name for mutator method, if match; null to indicate that the name does not conform to expected naming convention

Annotations
@Override
findNameForRegularGetterback to summary
public String findNameForRegularGetter(AnnotatedMethod method, String name)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForRegularGetter.

Doc from com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.findNameForRegularGetter.

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 findNameForIsGetter)

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

Parameters
method:AnnotatedMethod

Method to check

name:String

Name to check (usually same as AnnotatedMethod#getName()

Returns:String

Implied property name for getter method, if match; null to indicate that the name does not conform to expected naming convention

Annotations
@Override
modifyFieldNameback to summary
public String modifyFieldName(AnnotatedField field, String name)

Implements abstract com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.modifyFieldName.

Doc from com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.modifyFieldName.

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.

Parameters
field:AnnotatedField

Field to check

name:String

Name to check (usually same as AnnotatedField#getName()

Returns:String

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)

Annotations
@Override
com.fasterxml.jackson.databind.introspect back to summary

public abstract Class AccessorNamingStrategy.Provider

extends Object
implements Serializable
Class Inheritance
  • java.lang.Object
  • com.fasterxml.jackson.databind.introspect.AccessorNamingStrategy.Provider
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
com.fasterxml.jackson.databind.introspect.DefaultAccessorNamingStrategy.Provider

Interface for provider (factory) for constructing AccessorNamingStrategy for given type of deserialization target

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract AccessorNamingStrategy

Returns:

Naming strategy instance to use
forBuilder
(MapperConfig<?>
Current mapper configuration
config
,
AnnotatedClass
Information about builder type
builderClass
,
BeanDescription
Information about the eventual target (value) type
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.

public abstract AccessorNamingStrategy

Returns:

Naming strategy instance to use
forPOJO
(MapperConfig<?>
Current mapper configuration
config
,
AnnotatedClass
Information about value type
valueClass
)

Factory method for creating strategy instance for a "regular" POJO, called if none of the other factory methods is applicable.

public abstract AccessorNamingStrategy

Returns:

Naming strategy instance to use
forRecord
(MapperConfig<?>
Current mapper configuration
config
,
AnnotatedClass
Information about value type (of type java.lang.Record)
recordClass
)

Factory method for creating strategy instance for special java.lang.Record type (new in JDK 14).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Providerback to summary
public Provider()

Method Detail

forBuilderback to summary
public abstract 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.

Parameters
config:MapperConfig<?>

Current mapper configuration

builderClass:AnnotatedClass

Information about builder type

valueTypeDesc:BeanDescription

Information about the eventual target (value) type

Returns:AccessorNamingStrategy

Naming strategy instance to use

forPOJOback to summary
public abstract AccessorNamingStrategy forPOJO(MapperConfig<?> config, AnnotatedClass valueClass)

Factory method for creating strategy instance for a "regular" POJO, called if none of the other factory methods is applicable.

Parameters
config:MapperConfig<?>

Current mapper configuration

valueClass:AnnotatedClass

Information about value type

Returns:AccessorNamingStrategy

Naming strategy instance to use

forRecordback to summary
public abstract AccessorNamingStrategy forRecord(MapperConfig<?> config, AnnotatedClass recordClass)

Factory method for creating strategy instance for special java.lang.Record type (new in JDK 14).

Parameters
config:MapperConfig<?>

Current mapper configuration

recordClass:AnnotatedClass

Information about value type (of type java.lang.Record)

Returns:AccessorNamingStrategy

Naming strategy instance to use