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) longgetResourceBundle(String baseName, Locale locale, ClassLoader loader, boolean reload) voidplugDescriptor(Plugin plugin, FeatureDescriptor descriptor) Registers new descriptor into module.voidsetDefaultEncoding(String defaultEncoding) voidsetParentDirectory(String parentDirectory) voidunplugDescriptor(Plugin plugin, FeatureDescriptor descriptor) Unregisters new descriptor into module.
-
Constructor Details
-
DefaultI18NextService
public DefaultI18NextService()
-
-
Method Details
-
setParentDirectory
- Specified by:
setParentDirectoryin interfaceI18NextService
-
getDefaultEncoding
- Specified by:
getDefaultEncodingin interfaceI18NextService
-
setDefaultEncoding
- Specified by:
setDefaultEncodingin interfaceI18NextService
-
getLastUpdate
public long getLastUpdate()- Specified by:
getLastUpdatein interfaceI18NextService
-
plugDescriptor
Description copied from interface:FeatureModuleRegisters new descriptor into module. Module will use resources represented by descriptor to provide its functionality as long as descriptor is unplugged.- Specified by:
plugDescriptorin interfaceFeatureModule<FeatureDescriptor>- Parameters:
plugin- plugin that is parent of descriptordescriptor- feature descriptor to plug
-
unplugDescriptor
Description copied from interface:FeatureModuleUnregisters new descriptor into module. Module will no longer use resources provided by specified descriptor- Specified by:
unplugDescriptorin 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:
getResourceBundlein interfaceI18NextService- Throws:
IOException
-
getI18NextResource
- Specified by:
getI18NextResourcein interfaceI18NextService- Throws:
IOException
-