Top Description Inners Fields Constructors Methods
tools.jackson.databind

public abstract Class PropertyNamingStrategies

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
tools.jackson.databind.cfg.MapperConfig, tools.jackson.databind.introspect.AnnotatedField, .AnnotatedMethod, .AnnotatedParameter, tools.jackson.databind.util.NamingStrategyImpls

Container for standard PropertyNamingStrategy implementations and singleton instances.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PropertyNamingStrategies.KebabCaseStrategy

Naming strategy similar to PropertyNamingStrategies.SnakeCaseStrategy, but instead of underscores as separators, uses hyphens.

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 PropertyNamingStrategies.KebabCaseStrategy, but instead of hyphens as separators, uses dots.

public abstract static class
PropertyNamingStrategies.NamingBase

Intermediate base class for simple implementations

public static class
PropertyNamingStrategies.SnakeCaseStrategy

A PropertyNamingStrategy that translates typical camel case Java property names to lower case JSON element names, separated by underscores.

public static class
PropertyNamingStrategies.UpperCamelCaseStrategy

A PropertyNamingStrategy that translates typical camelCase Java property names to PascalCase JSON element names (i.e., with a capital first letter).

public static class
PropertyNamingStrategies.UpperSnakeCaseStrategy

A PropertyNamingStrategy that translates an input to the equivalent upper case snake case.

Field Summary

Modifier and TypeField 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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

KEBAB_CASEback 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 KebabCaseStrategy for details.

Example external property names would be "number-value", "naming-strategy", "the-definite-proof".

LOWER_CAMEL_CASEback 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_CASEback 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 LowerCaseStrategy for details.

Example external property names would be "numbervalue", "namingstrategy", "thedefiniteproof".

LOWER_DOT_CASEback 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 LowerDotCaseStrategy for details.

Example external property names would be "number.value", "naming.strategy", "the.definite.proof".

serialVersionUIDback to summary
private static final long serialVersionUID
SNAKE_CASEback 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 SnakeCaseStrategy for details.

Example external property names would be "number_value", "naming_strategy", "the_definite_proof".

UPPER_CAMEL_CASEback 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 UpperCamelCaseStrategy for details.

Example external property names would be "NumberValue", "NamingStrategy", "TheDefiniteProof".

UPPER_SNAKE_CASEback to summary
public static final PropertyNamingStrategy UPPER_SNAKE_CASE

Naming convention in which the words are in upper-case letters, separated by underscores. See UpperSnakeCaseStrategy for details.

Constructor Detail

PropertyNamingStrategiesback to summary
public PropertyNamingStrategies()
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.KebabCaseStrategy

extends NamingBase
Class Inheritance

Naming strategy similar to PropertyNamingStrategies.SnakeCaseStrategy, but instead of underscores as separators, uses hyphens. Naming convention traditionally used for languages like Lisp.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
Inherited from tools.jackson.databind.PropertyNamingStrategies.NamingBase:
nameForConstructorParameternameForFieldnameForGetterMethodnameForSetterMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.NamingBase.serialVersionUID.

Constructor Detail

KebabCaseStrategyback to summary
public KebabCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Annotations
@Override
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.LowerCamelCaseStrategy

extends NamingBase
Class Inheritance

"No-operation" strategy that is equivalent to not specifying any strategy: will simply return suggested standard bean naming as-is.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
Inherited from tools.jackson.databind.PropertyNamingStrategies.NamingBase:
nameForConstructorParameternameForFieldnameForGetterMethodnameForSetterMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.NamingBase.serialVersionUID.

Constructor Detail

LowerCamelCaseStrategyback to summary
public LowerCamelCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Annotations
@Override
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.LowerCaseStrategy

extends NamingBase
Class Inheritance

Simple strategy where external name simply only uses lower-case characters, and no separators. Conversion from internal name like "someOtherValue" would be into external name if "someothervalue".

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
Inherited from tools.jackson.databind.PropertyNamingStrategies.NamingBase:
nameForConstructorParameternameForFieldnameForGetterMethodnameForSetterMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.NamingBase.serialVersionUID.

Constructor Detail

LowerCaseStrategyback to summary
public LowerCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Annotations
@Override
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.LowerDotCaseStrategy

extends NamingBase
Class Inheritance

Naming strategy similar to PropertyNamingStrategies.KebabCaseStrategy, but instead of hyphens as separators, uses dots. Naming convention widely used as configuration properties name.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
Inherited from tools.jackson.databind.PropertyNamingStrategies.NamingBase:
nameForConstructorParameternameForFieldnameForGetterMethodnameForSetterMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.NamingBase.serialVersionUID.

Constructor Detail

LowerDotCaseStrategyback to summary
public LowerDotCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Annotations
@Override
tools.jackson.databind back to summary

public abstract Class PropertyNamingStrategies.NamingBase

extends PropertyNamingStrategy
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy, tools.jackson.databind.PropertyNamingStrategies.LowerCamelCaseStrategy, tools.jackson.databind.PropertyNamingStrategies.UpperCamelCaseStrategy, tools.jackson.databind.PropertyNamingStrategies.LowerCaseStrategy, tools.jackson.databind.PropertyNamingStrategies.KebabCaseStrategy, tools.jackson.databind.PropertyNamingStrategies.LowerDotCaseStrategy

Intermediate base class for simple implementations

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 String
nameForConstructorParameter(MapperConfig<?> config, AnnotatedParameter ctorParam, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForConstructorParameter.

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

public String
nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForField.

Method called to find external name (name used in JSON) for given logical POJO property, as defined by given field.

public String
nameForGetterMethod(MapperConfig<?> config, AnnotatedMethod method, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForGetterMethod.

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.

public String
nameForSetterMethod(MapperConfig<?> config, AnnotatedMethod method, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForSetterMethod.

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

protected abstract String
translate(String propertyName)

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategy.serialVersionUID.

Constructor Detail

NamingBaseback to summary
public NamingBase()

Method Detail

nameForConstructorParameterback to summary
public String nameForConstructorParameter(MapperConfig<?> config, AnnotatedParameter ctorParam, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForConstructorParameter.

Doc from tools.jackson.databind.PropertyNamingStrategy.nameForConstructorParameter.

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

Annotations
@Override
nameForFieldback to summary
public String nameForField(MapperConfig<?> config, AnnotatedField field, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForField.

Doc from tools.jackson.databind.PropertyNamingStrategy.nameForField.

Method called to find external name (name used in JSON) for given logical POJO property, as defined by given field.

Annotations
@Override
nameForGetterMethodback to summary
public String nameForGetterMethod(MapperConfig<?> config, AnnotatedMethod method, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForGetterMethod.

Doc from tools.jackson.databind.PropertyNamingStrategy.nameForGetterMethod.

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)

Annotations
@Override
nameForSetterMethodback to summary
public String nameForSetterMethod(MapperConfig<?> config, AnnotatedMethod method, String defaultName)

Overrides tools.jackson.databind.PropertyNamingStrategy.nameForSetterMethod.

Doc from tools.jackson.databind.PropertyNamingStrategy.nameForSetterMethod.

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

Annotations
@Override
translateback to summary
protected abstract String translate(String propertyName)
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.SnakeCaseStrategy

extends NamingBase
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.PropertyNamingStrategies.UpperSnakeCaseStrategy

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

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
Inherited from tools.jackson.databind.PropertyNamingStrategies.NamingBase:
nameForConstructorParameternameForFieldnameForGetterMethodnameForSetterMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.NamingBase.serialVersionUID.

Constructor Detail

SnakeCaseStrategyback to summary
public SnakeCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Annotations
@Override
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.UpperCamelCaseStrategy

extends NamingBase
Class Inheritance

A 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. This rules result in the following example translation from Java property names to JSON element names.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

input converted to PascalCase format
translate
(String
formatted as camelCase string
input
)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Converts camelCase to PascalCase For example, "userName" would be converted to "UserName".

Inherited from tools.jackson.databind.PropertyNamingStrategies.NamingBase:
nameForConstructorParameternameForFieldnameForGetterMethodnameForSetterMethod

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.NamingBase.serialVersionUID.

Constructor Detail

UpperCamelCaseStrategyback to summary
public UpperCamelCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Implements abstract tools.jackson.databind.PropertyNamingStrategies.NamingBase.translate.

Converts camelCase to PascalCase For example, "userName" would be converted to "UserName".

Parameters
input:String

formatted as camelCase string

Returns:String

input converted to PascalCase format

Annotations
@Override
tools.jackson.databind back to summary

public Class PropertyNamingStrategies.UpperSnakeCaseStrategy

extends SnakeCaseStrategy
Class Inheritance

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

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy.serialVersionUID.

Constructor Detail

UpperSnakeCaseStrategyback to summary
public UpperSnakeCaseStrategy()

Method Detail

translateback to summary
protected String translate(String input)

Overrides tools.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy.translate.

Annotations
@Override