Package org.spincast.plugins.dictionary
Class SpincastDictionaryDefault
java.lang.Object
org.spincast.core.dictionary.DictionaryBase
org.spincast.plugins.dictionary.SpincastDictionaryDefault
- All Implemented Interfaces:
org.spincast.core.dictionary.Dictionary
public class SpincastDictionaryDefault
extends org.spincast.core.dictionary.DictionaryBase
implements org.spincast.core.dictionary.Dictionary
Default implementation of the
Dictionary.
Provides a value for the core Spincast messages required by any application.
You have to override the addMessages() method to
add your own messages.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpincastDictionaryDefault(org.spincast.core.locale.LocaleResolver localeResolver, org.spincast.core.templating.TemplatingEngine templatingEngine, org.spincast.core.config.SpincastConfig spincastConfig, Set<org.spincast.core.dictionary.DictionaryEntries> dictionaryEntries) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidTo override to add messages to the dictionary.Gets a message.Gets a message.Gets a message.final StringGets a message.protected Localeprotected Set<org.spincast.core.dictionary.DictionaryEntries>protected org.spincast.core.config.SpincastConfigprotected org.spincast.core.templating.TemplatingEnginebooleanprotected StringMethods inherited from class org.spincast.core.dictionary.DictionaryBase
getAllKeys, getMessages, key, msgMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.spincast.core.dictionary.Dictionary
getAllKeys
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
SpincastDictionaryDefault
@Inject public SpincastDictionaryDefault(org.spincast.core.locale.LocaleResolver localeResolver, org.spincast.core.templating.TemplatingEngine templatingEngine, org.spincast.core.config.SpincastConfig spincastConfig, @Nullable Set<org.spincast.core.dictionary.DictionaryEntries> dictionaryEntries)
-
-
Method Details
-
getDefaultLocale
-
getTemplatingEngine
protected org.spincast.core.templating.TemplatingEngine getTemplatingEngine() -
getSpincastConfig
protected org.spincast.core.config.SpincastConfig getSpincastConfig() -
getDictionaryEntries
-
hasKey
- Specified by:
hasKeyin interfaceorg.spincast.core.dictionary.Dictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
- Specified by:
getin interfaceorg.spincast.core.dictionary.Dictionary
-
get
-
keyNotFound
-
addCoreAndPluginsMessages
protected void addCoreAndPluginsMessages() -
getAll
- Specified by:
getAllin interfaceorg.spincast.core.dictionary.Dictionary
-
getAll
- Specified by:
getAllin interfaceorg.spincast.core.dictionary.Dictionary
-
getAll
- Specified by:
getAllin interfaceorg.spincast.core.dictionary.Dictionary
-
addMessages
protected void addMessages()To override to add messages to the dictionary.Example :
protected void addMessages() { super.addMessages(); key("my.message.key", msg("en", "The message in english"), msg("fr", "Le message en français")); }
-