Programmatically pluralize type name in Java/Spring

Viewed 44

I have a fairly simple issue, but I couldn't find a solution googling it. I'm writing a library with Java/Spring and I need to be able to convert the names of types in the usual Java Bean ways: uncapitalized and (sometimes) plural.

Example: for a class called NorseDeity I must be able to get the String "norseDeity" and "norseDeities".

Is there any Spring or Apache Commons method to perform such a conversion?

I know Spring itself does it (because it automagically names different properties correctly), but I can't find how to reproduce it.

0 Answers
Related