Package org.nuiton.i18n.init
Class DefaultI18nInitializer
java.lang.Object
org.nuiton.i18n.init.I18nInitializer
org.nuiton.i18n.init.DefaultI18nInitializer
- Direct Known Subclasses:
UserI18nInitializer
Default implementation of a
I18nInitializer using the default i18n
implementation (one unique bundle with a definition properties file).- Since:
- 1.1
- Author:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprotected final Stringthe name of the bundle.static final Stringstatic final Stringprotected URLlocation of the definition file.protected Stringi18n path where to seek for resources (optional).protected ClassLoaderclass loader to use (optional).static final Stringstatic final StringFields inherited from class org.nuiton.i18n.init.I18nInitializer
encoding, messageFormatter, missingKeyReturnNull -
Constructor Summary
ConstructorsConstructorDescriptionDefaultI18nInitializer(String bundleName) DefaultI18nInitializer(String bundleName, ClassLoader loader) DefaultI18nInitializer(String bundleName, ClassLoader loader, String i18nPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected URLgetResourceURL(String resource) Resolv the bundles.resolvDefinition(Properties properties) URL[]resolvURLs(String prefixURL, Properties definition) protected voidsetI18nPath(String i18nPath) protected voidsetLoader(ClassLoader loader) Methods inherited from class org.nuiton.i18n.init.I18nInitializer
getEncoding, getMessageFormatter, isMissingKeyReturnNull, resolvBundles, setEncoding, setMessageFormatter, setMissingKeyReturnNull
-
Field Details
-
UNIQUE_BUNDLE_DEF
- See Also:
-
UNIQUE_BUNDLE_ENTRY
- See Also:
-
BUNDLE_DEF_LOCALES
- See Also:
-
BUNDLE_DEF_VERSION
- See Also:
-
BUNDLE_DEF_ENCODING
- See Also:
-
BUNDLES_FOR_LOCALE
- See Also:
-
bundleName
the name of the bundle. -
loader
class loader to use (optional). -
i18nPath
i18n path where to seek for resources (optional). -
definitionURL
location of the definition file. -
DEFAULT_I18N_PATH
- See Also:
-
-
Constructor Details
-
DefaultI18nInitializer
- Throws:
NullPointerException
-
DefaultI18nInitializer
- Throws:
NullPointerException
-
DefaultI18nInitializer
public DefaultI18nInitializer(String bundleName, ClassLoader loader, String i18nPath) throws NullPointerException - Throws:
NullPointerException
-
-
Method Details
-
getBundleName
-
getLoader
-
getI18nPath
-
setLoader
-
setI18nPath
-
getResourceURL
-
resolvDefinition
- Throws:
Exception
-
getDefinitionURL
- Throws:
NullPointerException
-
resolvURLs
- Throws:
Exception
-
resolvBundles
Description copied from class:I18nInitializerResolv the bundles.- Specified by:
resolvBundlesin classI18nInitializer- Returns:
- the bundles detected
- Throws:
Exception- if any pb while getting bundles
-