Package org.nuiton.i18n.init
Class ClassPathI18nInitializer
- java.lang.Object
-
- org.nuiton.i18n.init.I18nInitializer
-
- org.nuiton.i18n.init.ClassPathI18nInitializer
-
public class ClassPathI18nInitializer extends I18nInitializer
Implementation of aI18nInitializer
using all i18n resources (from artifacts) discovered in classpath. Will scan all classpath. This class requires an URLClassLoader, otherwise an exception will be thrown. Note: No order can be predicted with this implementation on bundles.- Since:
- 1.1
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected URL[]
extraURLs
protected ClassLoader
loader
class loader to use (optional)-
Fields inherited from class org.nuiton.i18n.init.I18nInitializer
encoding, messageFormatter, missingKeyReturnNull
-
-
Constructor Summary
Constructors Constructor Description ClassPathI18nInitializer()
ClassPathI18nInitializer(ClassLoader loader)
ClassPathI18nInitializer(ClassLoader loader, URL[] extraURLs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URL[]
getExtraURLs()
ClassLoader
getLoader()
I18nBundle[]
resolvBundles()
Resolv the bundles.URL[]
resolvURLs()
-
Methods inherited from class org.nuiton.i18n.init.I18nInitializer
getEncoding, getMessageFormatter, isMissingKeyReturnNull, resolvBundles, setEncoding, setMessageFormatter, setMissingKeyReturnNull
-
-
-
-
Field Detail
-
loader
protected ClassLoader loader
class loader to use (optional)
-
extraURLs
protected URL[] extraURLs
-
-
Constructor Detail
-
ClassPathI18nInitializer
public ClassPathI18nInitializer()
-
ClassPathI18nInitializer
public ClassPathI18nInitializer(ClassLoader loader)
-
ClassPathI18nInitializer
public ClassPathI18nInitializer(ClassLoader loader, URL[] extraURLs)
-
-
Method Detail
-
resolvBundles
public I18nBundle[] resolvBundles() throws Exception
Description copied from class:I18nInitializer
Resolv the bundles.- Specified by:
resolvBundles
in classI18nInitializer
- Returns:
- the bundles detected
- Throws:
Exception
- if any pb while getting bundles
-
getExtraURLs
public URL[] getExtraURLs()
-
getLoader
public ClassLoader getLoader()
-
-