Liferay, as you know, is full of utility classes to perform various functions; one of these classes is called TextFormatter and is extremely useful in the attribute names management, to conform to the standards imposed by Liferay.
TextFormatter class does not have many methods but what we look now is the method format (String s, int style) which converts the string passed as first parameter using a different algorithm depending on the second parameter.
The applicable styles are 16 and they are defined in the TextFormatter class via some public constants represented by letters, listed below:
TextFormatter.A- Converts 
Web SearchinWEB_SEARCH TextFormatter.B- Converts 
Web Searchinwebsearch TextFormatter.C- Converts 
Web Searchinweb_search TextFormatter.D- Converts 
Web SearchinWebSearch TextFormatter.E- Converts 
Web Searchinweb search TextFormatter.F- Converts 
Web SearchinwebSearch TextFormatter.G- Converts 
formatIdinFormatId TextFormatter.H- Converts 
formatIdinformat id TextFormatter.I- Converts 
FormatIdinformatId TextFormatter.J- Converts 
format-idinFormat Id TextFormatter.K- Converts 
formatIdinformat-id TextFormatter.L- Converts 
FormatIdinformatIdandFOrmatIdinFOrmatId TextFormatter.M- Converts 
format-idinformatId TextFormatter.N- Converts 
format-idinformat_id TextFormatter.O- Converts 
format_idinformat-id TextFormatter.P- Converts 
formatIDinformat-id