A strategy that transforms serial names from camel case to snake case — lowercase characters with words separated by underscores. The descriptor parameter is not used.
Words' bounds are defined by uppercase characters. If there is a single uppercase char, it is transformed into lowercase one with underscore in front:
two_words. No underscore is added if it was a beginning of the name:
my_property. Also, no underscore is added if it was already there:
Since acronym rules are quite complex, it is recommended to lowercase all acronyms in source code. If there is an uppercase acronym — a sequence of uppercase chars — they are considered as a whole word from the start to second-to-last character of the sequence:
my_http_auth. Non-letter characters allow the word to continue:
Note on cases
Whether a character is in upper case is determined by the result of Char.isUpperCase function. Lowercase transformation is performed by Char.lowercaseChar, not by Char.lowercase, and therefore does not support one-to-many and many-to-one character mappings. See the documentation of these functions for details.