Quick search:


What is a (String)Converter

Object that converts strings to values and back according to its format settings
Also used to convert ASCII strings to HTML and back.

We like to use one common set of representations for all internal numbers, dates, etc. in the domain model, so that we do not have to rewrite any code that handles these types when we need to change the locale. This format should work with MySQL too. We want to convert those to strings only for representation in the user interface according to the settings made to correspond to the users locale, AND BACK when the user submits them in a form. The interface should be simple; implementations should be overridable and extendible.

This is what our StringCoverter does. It does not use the locale that can be set by setLocale; you have to make overrides yourself as applicable to the users localization requirements.

Because we did not find an inverse function for strftime the date, time and timestamp capabilities of StringConverter are currently rather limited. But of course you can override them as you see fit. Nevertheless, if anyone can supply more complete functions ...