Interface PropertyNamingStrategy



  • public interface PropertyNamingStrategy

    Allows to define custom property naming strategy. Specifies predefined property naming strategies. Does not override JsonbProperty value.

    This strategy can be set via JsonbConfig.

    Since:
    JSON Binding 1.0
    See Also:
    JsonbConfig
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CASE_INSENSITIVE
      Using this strategy, the serialization will be same as identity.
      static java.lang.String IDENTITY
      Using this strategy, the property name is unchanged.
      static java.lang.String LOWER_CASE_WITH_DASHES
      Using this strategy, the property name is transformed to lower case with dashes.
      static java.lang.String LOWER_CASE_WITH_UNDERSCORES
      Using this strategy, the property name is transformed to lower case with underscores.
      static java.lang.String UPPER_CAMEL_CASE
      Using this strategy, the first character will be capitalized.
      static java.lang.String UPPER_CAMEL_CASE_WITH_SPACES
      Using this strategy, the first character will be capitalized and the words will be separated by spaces.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String translateName​(java.lang.String propertyName)
      Translates the property name into its JSON field name representation.
    • Field Detail

      • IDENTITY

        static final java.lang.String IDENTITY
        Using this strategy, the property name is unchanged.
        See Also:
        Constant Field Values
      • LOWER_CASE_WITH_DASHES

        static final java.lang.String LOWER_CASE_WITH_DASHES
        Using this strategy, the property name is transformed to lower case with dashes. The dashes are on the positions of different case boundaries in the original field name (camel case).
        See Also:
        Constant Field Values
      • LOWER_CASE_WITH_UNDERSCORES

        static final java.lang.String LOWER_CASE_WITH_UNDERSCORES
        Using this strategy, the property name is transformed to lower case with underscores. The underscores are on the positions of different case boundaries in the original field name (camel case).
        See Also:
        Constant Field Values
      • UPPER_CAMEL_CASE

        static final java.lang.String UPPER_CAMEL_CASE
        Using this strategy, the first character will be capitalized.
        See Also:
        Constant Field Values
      • UPPER_CAMEL_CASE_WITH_SPACES

        static final java.lang.String UPPER_CAMEL_CASE_WITH_SPACES
        Using this strategy, the first character will be capitalized and the words will be separated by spaces.
        See Also:
        Constant Field Values
      • CASE_INSENSITIVE

        static final java.lang.String CASE_INSENSITIVE
        Using this strategy, the serialization will be same as identity. Deserialization will be case insensitive. E.g. property in JSON with name PropertyNAME, will be mapped to field propertyName.
        See Also:
        Constant Field Values
    • Method Detail

      • translateName

        java.lang.String translateName​(java.lang.String propertyName)
        Translates the property name into its JSON field name representation.
        Parameters:
        propertyName - Name of the property to translate.
        Returns:
        Translated JSON field name.