public abstract class AccessorNamingStrategy extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AccessorNamingStrategy.Base
Helper class that implements all abstract methods with dummy implementations.
|
static class |
AccessorNamingStrategy.Provider
Interface for provider (factory) for constructing
AccessorNamingStrategy
for given type of deserialization target |
Constructor and Description |
---|
AccessorNamingStrategy() |
Modifier and Type | Method and Description |
---|---|
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)
|
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)
|
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)
|
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.
|
public abstract String findNameForIsGetter(AnnotatedMethod method, String name)
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.
method
- Method to checkname
- Name to check (usually same as AnnotatedMethod.getName()
null
to indicate
that the name does not conform to expected naming conventionpublic abstract String findNameForRegularGetter(AnnotatedMethod method, String name)
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(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.
method
- Method to checkname
- Name to check (usually same as AnnotatedMethod.getName()
null
to indicate
that the name does not conform to expected naming conventionpublic abstract String findNameForMutator(AnnotatedMethod method, String name)
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.
method
- Method to checkname
- Name to check (usually same as AnnotatedMethod.getName()
null
to indicate that the name does not conform to expected naming conventionpublic abstract String modifyFieldName(AnnotatedField field, String name)
Note that visibility checks are applied separately; strategy does not need to be concerned with that aspect.
field
- Field to checkname
- Name to check (usually same as AnnotatedField.getName()
null
to indicate that the name does not conform to expected naming convention
(and will not be considered for property access)Copyright © 2008–2020 FasterXML. All rights reserved.