Class DefaultI18NextService
java.lang.Object
eu.rarogsoftware.rarog.platform.core.i18n.DefaultI18NextService
- All Implemented Interfaces:
FeatureModule<FeatureDescriptor>
,I18NextService
public class DefaultI18NextService
extends Object
implements FeatureModule<FeatureDescriptor>, I18NextService
Implementation of I18NextService that supports
I18NextTransformerDescriptor
and I18NextResourceDescriptor
.
This implementation loads resources, merges them and then apply transformers on result of merging. Because of that
this implementation supports only json formats.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetI18NextResource
(Locale locale, String namespace) long
getResourceBundle
(String baseName, Locale locale, ClassLoader loader, boolean reload) void
plugDescriptor
(Plugin plugin, FeatureDescriptor descriptor) Registers new descriptor into module.void
setDefaultEncoding
(String defaultEncoding) void
setParentDirectory
(String parentDirectory) void
unplugDescriptor
(Plugin plugin, FeatureDescriptor descriptor) Unregisters new descriptor into module.
-
Constructor Details
-
DefaultI18NextService
public DefaultI18NextService()
-
-
Method Details
-
setParentDirectory
- Specified by:
setParentDirectory
in interfaceI18NextService
-
getDefaultEncoding
- Specified by:
getDefaultEncoding
in interfaceI18NextService
-
setDefaultEncoding
- Specified by:
setDefaultEncoding
in interfaceI18NextService
-
getLastUpdate
public long getLastUpdate()- Specified by:
getLastUpdate
in interfaceI18NextService
-
plugDescriptor
Description copied from interface:FeatureModule
Registers new descriptor into module. Module will use resources represented by descriptor to provide its functionality as long as descriptor is unplugged.- Specified by:
plugDescriptor
in interfaceFeatureModule<FeatureDescriptor>
- Parameters:
plugin
- plugin that is parent of descriptordescriptor
- feature descriptor to plug
-
unplugDescriptor
Description copied from interface:FeatureModule
Unregisters new descriptor into module. Module will no longer use resources provided by specified descriptor- Specified by:
unplugDescriptor
in interfaceFeatureModule<FeatureDescriptor>
- Parameters:
plugin
- plugin that is parent of descriptordescriptor
- feature descriptor to unplug
-
getResourceBundle
public I18NextNamespacedResourceBundle getResourceBundle(String baseName, Locale locale, ClassLoader loader, boolean reload) throws IOException - Specified by:
getResourceBundle
in interfaceI18NextService
- Throws:
IOException
-
getI18NextResource
- Specified by:
getI18NextResource
in interfaceI18NextService
- Throws:
IOException
-