Package tech.mgl.utils.json
Class DbFieldStrategy
java.lang.Object
com.fasterxml.jackson.databind.PropertyNamingStrategy
tech.mgl.utils.json.DbFieldStrategy
- All Implemented Interfaces:
Serializable
public class DbFieldStrategy
extends com.fasterxml.jackson.databind.PropertyNamingStrategy
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.PropertyNamingStrategy
com.fasterxml.jackson.databind.PropertyNamingStrategy.KebabCaseStrategy, com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseStrategy, com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy, com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerDotCaseStrategy, com.fasterxml.jackson.databind.PropertyNamingStrategy.PascalCaseStrategy, com.fasterxml.jackson.databind.PropertyNamingStrategy.PropertyNamingStrategyBase, com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy, com.fasterxml.jackson.databind.PropertyNamingStrategy.UpperCamelCaseStrategy -
Field Summary
Fields inherited from class com.fasterxml.jackson.databind.PropertyNamingStrategy
CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES, KEBAB_CASE, LOWER_CAMEL_CASE, LOWER_CASE, LOWER_DOT_CASE, PASCAL_CASE_TO_CAMEL_CASE, SNAKE_CASE, UPPER_CAMEL_CASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnameForField(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.introspect.AnnotatedField field, String defaultName) Method called to find external name (name used in JSON) for given logical POJO property, as defined by given field.nameForGetterMethod(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.introspect.AnnotatedMethod method, String defaultName) Method called to find external name (name used in JSON) for given logical POJO property, as defined by given getter method; typically called when building a serializer.nameForSetterMethod(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.introspect.AnnotatedMethod method, String defaultName) Method called to find external name (name used in JSON) for given logical POJO property, as defined by given setter method; typically called when building a deserializer (but not necessarily only then).Methods inherited from class com.fasterxml.jackson.databind.PropertyNamingStrategy
nameForConstructorParameter
-
Constructor Details
-
DbFieldStrategy
public DbFieldStrategy()
-
-
Method Details
-
nameForField
public String nameForField(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.introspect.AnnotatedField field, String defaultName) Method called to find external name (name used in JSON) for given logical POJO property, as defined by given field.- Overrides:
nameForFieldin classcom.fasterxml.jackson.databind.PropertyNamingStrategy- Parameters:
config- Configuration in used: eitherSerializationConfigorDeserializationConfig, depending on whether method is called during serialization or deserializationfield- Field used to access propertydefaultName- Default name that would be used for property in absence of custom strategy- Returns:
- Logical name to use for property that the field represents
-
nameForGetterMethod
public String nameForGetterMethod(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.introspect.AnnotatedMethod method, String defaultName) Method called to find external name (name used in JSON) for given logical POJO property, as defined by given getter method; typically called when building a serializer. (but not always -- when using "getter-as-setter", may be called during deserialization)- Overrides:
nameForGetterMethodin classcom.fasterxml.jackson.databind.PropertyNamingStrategy- Parameters:
config- Configuration in used: eitherSerializationConfigorDeserializationConfig, depending on whether method is called during serialization or deserializationmethod- Method used to access property.defaultName- Default name that would be used for property in absence of custom strategy- Returns:
- Logical name to use for property that the method represents
-
nameForSetterMethod
public String nameForSetterMethod(com.fasterxml.jackson.databind.cfg.MapperConfig<?> config, com.fasterxml.jackson.databind.introspect.AnnotatedMethod method, String defaultName) Method called to find external name (name used in JSON) for given logical POJO property, as defined by given setter method; typically called when building a deserializer (but not necessarily only then).- Overrides:
nameForSetterMethodin classcom.fasterxml.jackson.databind.PropertyNamingStrategy- Parameters:
config- Configuration in used: eitherSerializationConfigorDeserializationConfig, depending on whether method is called during serialization or deserializationmethod- Method used to access property.defaultName- Default name that would be used for property in absence of custom strategy- Returns:
- Logical name to use for property that the method represents
-