Class DefaultAccessorNamingStrategy.RecordNamingStrict
- Enclosing class:
- DefaultAccessorNamingStrategy
DefaultAccessorNamingStrategy.RecordNaming implementation used when
MapperFeature.INFER_RECORD_GETTERS_FROM_COMPONENTS_ONLY is enabled.
Unlike the default DefaultAccessorNamingStrategy.RecordNaming, this strategy does NOT fall back to
standard getter/setter detection for methods that don't match Record component names.
This prevents helper methods like getDisplayName() from being auto-detected
and serialized when they are not actual Record components.
- Since:
- 3.1
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.introspect.DefaultAccessorNamingStrategy
DefaultAccessorNamingStrategy.BaseNameValidator, DefaultAccessorNamingStrategy.FirstCharBasedValidator, DefaultAccessorNamingStrategy.Provider, DefaultAccessorNamingStrategy.RecordNaming, DefaultAccessorNamingStrategy.RecordNamingStrictNested classes/interfaces inherited from class tools.jackson.databind.introspect.AccessorNamingStrategy
AccessorNamingStrategy.Base -
Field Summary
Fields inherited from class tools.jackson.databind.introspect.DefaultAccessorNamingStrategy.RecordNaming
_fieldNamesFields inherited from class tools.jackson.databind.introspect.DefaultAccessorNamingStrategy
_baseNameValidator, _config, _forClass, _getterPrefix, _isGetterPrefix, _isGettersNonBoolean, _mutatorPrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindNameForIsGetter(AnnotatedMethod am, 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)findNameForMutator(AnnotatedMethod am, 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)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 tools.jackson.databind.introspect.DefaultAccessorNamingStrategy
_isCglibGetCallbacks, _isGroovyMetaClassGetter, modifyFieldName, stdManglePropertyName
-
Constructor Details
-
RecordNamingStrict
-
-
Method Details
-
findNameForRegularGetter
Description copied from class:AccessorNamingStrategyMethod 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(tools.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:
findNameForRegularGetterin classDefaultAccessorNamingStrategy.RecordNaming- Parameters:
am- Method to checkname- Name to check (usually same asAnnotatedMethod.getName()- Returns:
- Implied property name for getter method, if match;
nullto indicate that the name does not conform to expected naming convention
-
findNameForIsGetter
Description copied from class:AccessorNamingStrategyMethod 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.
- Overrides:
findNameForIsGetterin classDefaultAccessorNamingStrategy- Parameters:
am- Method to checkname- Name to check (usually same asAnnotatedMethod.getName()- Returns:
- Implied property name for is-getter method, if match;
nullto indicate that the name does not conform to expected naming convention
-
findNameForMutator
Description copied from class:AccessorNamingStrategyMethod 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.
- Overrides:
findNameForMutatorin classDefaultAccessorNamingStrategy- Parameters:
am- Method to checkname- Name to check (usually same asAnnotatedMethod.getName()- Returns:
- Implied property name for mutator method, if match;
nullto indicate that the name does not conform to expected naming convention
-