Internal factory for
I18nPool instances. This class provides a single factory method, see
#getInstance(boolean), that creates the actual instances. Support for multiple locale can be missing in which case
this factory creates a simplified, optimized I18N pool instance. In this case locale is not used and all implemented methods
silently ignore
locale
argument, if provided.
I18nPool<Template> pool = I18nPoolFactory.getInstance(false); // I18N pool without multiple locale support
pool.put("index.htm", new Template("index"), Locale.getDefault()); // locale is silently ignored
For I18N pool with multiple locale support returned instance is actually a map of maps. Outer map uses locale language tag
for key while inner map uses object name. For instances with multiple locale support, locale
argument is
mandatory and all implemented methods throw illegal arguments exception if locale
is missing.
I18nPool<Template> pool = I18nPoolFactory.getInstance(true); // I18N pool with multiple locale support
pool.put("index.htm", new Template("index")); // missing locale rise illegal argument exception