PropertyNamingStrategy implementations
and singleton instances.
Added in Jackson 2.12 to resolve issue databind#2715.
| Modifier and Type | Class and Description |
|---|---|
| public static class | PropertyNamingStrategies.KebabCaseStrategy
Naming strategy similar to |
| public static class | PropertyNamingStrategies.LowerCamelCaseStrategy
"No-operation" strategy that is equivalent to not specifying any strategy: will simply return suggested standard bean naming as-is. |
| public static class | PropertyNamingStrategies.LowerCaseStrategy
Simple strategy where external name simply only uses lower-case characters, and no separators. |
| public static class | PropertyNamingStrategies.LowerDotCaseStrategy
Naming strategy similar to |
| public abstract static class | PropertyNamingStrategies.NamingBase
Intermediate base class for simple implementations |
| public static class | PropertyNamingStrategies.SnakeCaseStrategy
A |
| public static class | PropertyNamingStrategies.UpperCamelCaseStrategy
A |
| public static class | PropertyNamingStrategies.UpperSnakeCaseStrategy
A |
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategy | KEBAB_CASE
Naming convention used in languages like Lisp, where words are in lower-case letters, separated by hyphens. |
| public static final PropertyNamingStrategy | LOWER_CAMEL_CASE
Naming convention used in Java, where words other than first are capitalized and no separator is used between words. |
| public static final PropertyNamingStrategy | LOWER_CASE
Naming convention in which all words of the logical name are in lower case, and no separator is used between words. |
| public static final PropertyNamingStrategy | LOWER_DOT_CASE
Naming convention widely used as configuration properties name, where words are in lower-case letters, separated by dots. |
| private static final long | |
| public static final PropertyNamingStrategy | SNAKE_CASE
Naming convention used in languages like C, where words are in lower-case letters, separated by underscores. |
| public static final PropertyNamingStrategy | UPPER_CAMEL_CASE
Naming convention used in languages like Pascal, where all words are capitalized and no separator is used between words. |
| public static final PropertyNamingStrategy | UPPER_SNAKE_CASE
Naming convention in which the words are in upper-case letters, separated by underscores. |
| Access | Constructor and Description |
|---|---|
| public |
| KEBAB_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy KEBAB_CASE Naming convention used in languages like Lisp, where words are in lower-case
letters, separated by hyphens.
See Example external property names would be "number-value", "naming-strategy", "the-definite-proof". | |
| LOWER_CAMEL_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy LOWER_CAMEL_CASE Naming convention used in Java, where words other than first are capitalized and no separator is used between words. Since this is the native Java naming convention, naming strategy will not do any transformation between names in data (JSON) and POJOS. Example external property names would be "numberValue", "namingStrategy", "theDefiniteProof". | |
| LOWER_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy LOWER_CASE Naming convention in which all words of the logical name are in lower case, and
no separator is used between words.
See Example external property names would be "numbervalue", "namingstrategy", "thedefiniteproof". | |
| LOWER_DOT_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy LOWER_DOT_CASE Naming convention widely used as configuration properties name, where words are in
lower-case letters, separated by dots.
See Example external property names would be "number.value", "naming.strategy", "the.definite.proof". | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SNAKE_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy SNAKE_CASE Naming convention used in languages like C, where words are in lower-case
letters, separated by underscores.
See Example external property names would be "number_value", "naming_strategy", "the_definite_proof". | |
| UPPER_CAMEL_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy UPPER_CAMEL_CASE Naming convention used in languages like Pascal, where all words are capitalized
and no separator is used between words.
See Example external property names would be "NumberValue", "NamingStrategy", "TheDefiniteProof". | |
| UPPER_SNAKE_CASE | back to summary |
|---|---|
| public static final PropertyNamingStrategy UPPER_SNAKE_CASE Naming convention in which the words are in upper-case letters, separated by underscores.
See
| |
| PropertyNamingStrategies | back to summary |
|---|---|
| public PropertyNamingStrategies() | |
PropertyNamingStrategies.SnakeCaseStrategy ,
but instead of underscores
as separators, uses hyphens. Naming convention traditionally used for languages
like Lisp.
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | translate(String input)
Implements abstract com. |
| INSTANCE | back to summary |
|---|---|
public static final PropertyNamingStrategies.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| KebabCaseStrategy | back to summary |
|---|---|
| public KebabCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Implements abstract com.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | translate(String input)
Implements abstract com. |
| INSTANCE | back to summary |
|---|---|
public static final PropertyNamingStrategies.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| LowerCamelCaseStrategy | back to summary |
|---|---|
| public LowerCamelCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Implements abstract com.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | translate(String input)
Implements abstract com. |
| INSTANCE | back to summary |
|---|---|
public static final PropertyNamingStrategies.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| LowerCaseStrategy | back to summary |
|---|---|
| public LowerCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Implements abstract com.
| |
PropertyNamingStrategies.KebabCaseStrategy ,
but instead of hyphens
as separators, uses dots. Naming convention widely used as configuration properties name.
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | translate(String input)
Implements abstract com. |
| INSTANCE | back to summary |
|---|---|
public static final PropertyNamingStrategies.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| LowerDotCaseStrategy | back to summary |
|---|---|
| public LowerDotCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Implements abstract com.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | nameForConstructorParameter(MapperConfig<?>
Configuration in used: either config, AnnotatedParameter SerializationConfig
or DeserializationConfig, depending on whether method is called
during serialization or deserializationConstructor parameter used to pass property. ctorParam, String Default name that would be used for property in absence of custom strategy defaultName)Overrides com. |
| public String | nameForField(MapperConfig<?>
Configuration in used: either config, AnnotatedField SerializationConfig
or DeserializationConfig, depending on whether method is called
during serialization or deserializationField used to access property field, String Default name that would be used for property in absence of custom strategy defaultName)Overrides com. |
| public String | nameForGetterMethod(MapperConfig<?>
Configuration in used: either config, AnnotatedMethod SerializationConfig
or DeserializationConfig, depending on whether method is called
during serialization or deserializationMethod used to access property. method, String Default name that would be used for property in absence of custom strategy defaultName)Overrides com. |
| public String | nameForSetterMethod(MapperConfig<?>
Configuration in used: either config, AnnotatedMethod SerializationConfig
or DeserializationConfig, depending on whether method is called
during serialization or deserializationMethod used to access property. method, String Default name that would be used for property in absence of custom strategy defaultName)Overrides com. |
| public abstract String | |
| protected String | translateLowerCaseWithSeparator(final String input, final char separator)
Helper method to share implementation between snake and dotted case. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| NamingBase | back to summary |
|---|---|
| public NamingBase() | |
| nameForConstructorParameter | back to summary |
|---|---|
| public String nameForConstructorParameter(MapperConfig<?> config, AnnotatedParameter ctorParam, String defaultName) Overrides com. Doc from com. Method called to find external name (name used in JSON) for given logical POJO property, as defined by given constructor parameter; typically called when building a deserializer (but not necessarily only then).
| |
| nameForField | back to summary |
|---|---|
| public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName) Overrides com. Doc from com. Method called to find external name (name used in JSON) for given logical POJO property, as defined by given field.
| |
| nameForGetterMethod | back to summary |
|---|---|
| public String nameForGetterMethod(MapperConfig<?> config, AnnotatedMethod method, String defaultName) Overrides com. Doc from com. 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)
| |
| nameForSetterMethod | back to summary |
|---|---|
| public String nameForSetterMethod(MapperConfig<?> config, AnnotatedMethod method, String defaultName) Overrides com. Doc from com. 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).
| |
| translate | back to summary |
|---|---|
| public abstract String translate(String propertyName) | |
| translateLowerCaseWithSeparator | back to summary |
|---|---|
| protected String translateLowerCaseWithSeparator(final String input, final char separator) Helper method to share implementation between snake and dotted case. | |
PropertyNamingStrategy that translates typical camel case Java
property names to lower case JSON element names, separated by
underscores. This implementation is somewhat lenient, in that it
provides some additional translations beyond strictly translating from
camel case only. In particular, the following translations are applied
by this PropertyNamingStrategy.
These rules result in the following additional example translations from Java property names to JSON element names.
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | translate(String input)
Implements abstract com. |
| INSTANCE | back to summary |
|---|---|
public static final PropertyNamingStrategies.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| SnakeCaseStrategy | back to summary |
|---|---|
| public SnakeCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Implements abstract com.
| |
PropertyNamingStrategy that translates typical camelCase Java
property names to PascalCase JSON element names (i.e., with a capital
first letter). In particular, the following translations are applied by
this PropertyNamingStrategy.
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: input converted to PascalCase formatformatted as camelCase string input)Implements abstract com. |
| INSTANCE | back to summary |
|---|---|
public static final PropertyNamingStrategies.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| UpperCamelCaseStrategy | back to summary |
|---|---|
| public UpperCamelCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Implements abstract com. Converts camelCase to PascalCase For example, "userName" would be converted to "UserName". | |
PropertyNamingStrategy that translates an input to the equivalent upper case snake
case. The class extends PropertyNamingStrategies.SnakeCaseStrategy to retain the
snake case conversion functionality offered by the strategy.
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertyNamingStrategies. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| INSTANCE | back to summary |
|---|---|
| public static final PropertyNamingStrategies. Hides com.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| UpperSnakeCaseStrategy | back to summary |
|---|---|
| public UpperSnakeCaseStrategy() | |
| translate | back to summary |
|---|---|
| public String translate(String input) Overrides com.
| |