Cookies help us deliver our services.

By using our services, you agree to our use of cookies. Learn more

I understand

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 Search in WEB_SEARCH
TextFormatter.B
Converts Web Search in websearch
TextFormatter.C
Converts Web Search in web_search
TextFormatter.D
Converts Web Search in WebSearch
TextFormatter.E
Converts Web Search in web search
TextFormatter.F
Converts Web Search in webSearch
TextFormatter.G
Converts formatId in FormatId
TextFormatter.H
Converts formatId in format id
TextFormatter.I
Converts FormatId in formatId
TextFormatter.J
Converts format-id in Format Id
TextFormatter.K
Converts formatId in format-id
TextFormatter.L
Converts FormatId in formatId and FOrmatId in FOrmatId
TextFormatter.M
Converts format-id in formatId
TextFormatter.N
Converts format-id in format_id
TextFormatter.O
Converts format_id in format-id
TextFormatter.P
Converts formatID in format-id