Class SpincastDictionaryDefault
- All Implemented Interfaces:
Dictionary
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(LocaleResolver localeResolver, TemplatingEngine templatingEngine, SpincastConfig spincastConfig, Set<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.Gets a message.Gets a message.Gets a message.Gets a message.final StringGets a message.Return all the possible values, for all languages used, by language abreviation.Return all the possible values, for all languages used, by language abreviation.Return all the possible values, for all languages used, by language abreviation.protected Localeprotected Set<DictionaryEntries>protected SpincastConfigprotected TemplatingEnginebooleanContains this key?protected 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(LocaleResolver localeResolver, TemplatingEngine templatingEngine, SpincastConfig spincastConfig, @Nullable Set<DictionaryEntries> dictionaryEntries)
-
-
Method Details
-
getDefaultLocale
-
getTemplatingEngine
-
getSpincastConfig
-
getDictionaryEntries
-
hasKey
Description copied from interface:DictionaryContains this key?- Specified by:
hasKeyin interfaceDictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceDictionary
-
get
Description copied from interface:DictionaryGets a message.Uses the specified Locale.
The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()andSpincastConfig.getDictionaryEntryNotFoundBehavior().- Specified by:
getin interfaceDictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceDictionaryforceTemplatingEngine- iftrue, theTemplatingEnginewill be used even there are no parameters. This may be useful to trigger some templating function that don't need parameters. We don't use the templting engine will default since it is costy.The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()andSpincastConfig.getDictionaryEntryNotFoundBehavior().
-
get
Description copied from interface:DictionaryGets a message.Uses the specified Locale.
- Specified by:
getin interfaceDictionaryforceEvaluation- iftrue, theTemplatingEnginewill be used even there are no parameters. This may be useful to trigger some templating function that don't need parameters. We don't use the templting engine will default since it is costy.The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()andSpincastConfig.getDictionaryEntryNotFoundBehavior().
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceDictionary
-
get
Description copied from interface:DictionaryGets a message.Uses the specified Locale.
The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()andSpincastConfig.getDictionaryEntryNotFoundBehavior().- Specified by:
getin interfaceDictionary
-
get
Gets a message. Will use the proper Locale as provided by theLocaleResolver.- Specified by:
getin interfaceDictionary
-
get
Description copied from interface:DictionaryGets a message.Uses the specified Locale.
The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()andSpincastConfig.getDictionaryEntryNotFoundBehavior().- Specified by:
getin interfaceDictionary
-
get
-
keyNotFound
-
addCoreAndPluginsMessages
protected void addCoreAndPluginsMessages() -
getAll
Description copied from interface:DictionaryReturn all the possible values, for all languages used, by language abreviation.- Specified by:
getAllin interfaceDictionary
-
getAll
Description copied from interface:DictionaryReturn all the possible values, for all languages used, by language abreviation.- Specified by:
getAllin interfaceDictionary
-
getAll
Description copied from interface:DictionaryReturn all the possible values, for all languages used, by language abreviation.- Specified by:
getAllin interfaceDictionary
-
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")); }
-