public.javadoc.org.spincast.plugins.dictionary.SpincastDictionaryDefault.html Maven / Gradle / Ivy
Show all versions of spincast-website Show documentation
SpincastDictionaryDefault (org.spincast:spincast-framework 2.1.1 API)
Package org.spincast.plugins.dictionary
Class SpincastDictionaryDefault
java.lang.Object
org.spincast.core.dictionary.DictionaryBase
org.spincast.plugins.dictionary.SpincastDictionaryDefault
- All Implemented Interfaces:
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
-
Constructor Summary
Constructor
Description
SpincastDictionaryDefault(LocaleResolver localeResolver,
TemplatingEngine templatingEngine,
SpincastConfig spincastConfig,
Set<DictionaryEntries> dictionaryEntries)
-
Method Summary
Modifier and Type
Method
Description
protected void
protected void
To 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 String
Gets 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 Locale
protected Set<DictionaryEntries>
protected SpincastConfig
protected TemplatingEngine
boolean
Contains this key?
protected String
Methods inherited from class org.spincast.core.dictionary.DictionaryBase
getAllKeys, getMessages, key, msg
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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: Dictionary
Contains this key?
- Specified by:
hasKey
in interface Dictionary
-
get
Gets a message.
Will use the proper Locale as provided by the
LocaleResolver
.
- Specified by:
get
in interface Dictionary
-
get
Description copied from interface: Dictionary
Gets a message.
Uses the specified Locale.
The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()
and
SpincastConfig.getDictionaryEntryNotFoundBehavior()
.
- Specified by:
get
in interface Dictionary
-
get
Gets a message.
Will use the proper Locale as provided by the
LocaleResolver
.
- Specified by:
get
in interface Dictionary
forceTemplatingEngine
- if true
,
the TemplatingEngine
will 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()
and
SpincastConfig.getDictionaryEntryNotFoundBehavior()
.
-
get
Description copied from interface: Dictionary
Gets a message.
Uses the specified Locale.
- Specified by:
get
in interface Dictionary
forceEvaluation
- if true
,
the TemplatingEngine
will 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()
and
SpincastConfig.getDictionaryEntryNotFoundBehavior()
.
-
get
Gets a message.
Will use the proper Locale as provided by the
LocaleResolver
.
- Specified by:
get
in interface Dictionary
-
get
Description copied from interface: Dictionary
Gets a message.
Uses the specified Locale.
The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()
and
SpincastConfig.getDictionaryEntryNotFoundBehavior()
.
- Specified by:
get
in interface Dictionary
-
get
Gets a message.
Will use the proper Locale as provided by the
LocaleResolver
.
- Specified by:
get
in interface Dictionary
-
get
Description copied from interface: Dictionary
Gets a message.
Uses the specified Locale.
The behavior if the key is not found can be configured using
SpincastConfig#getDictionaryEntryNotFoundFallbackTo()
and
SpincastConfig.getDictionaryEntryNotFoundBehavior()
.
- Specified by:
get
in interface Dictionary
-
get
-
keyNotFound
-
addCoreAndPluginsMessages
protected void addCoreAndPluginsMessages()
-
getAll
Description copied from interface: Dictionary
Return all the possible values, for all languages used,
by language abreviation.
- Specified by:
getAll
in interface Dictionary
-
getAll
Description copied from interface: Dictionary
Return all the possible values, for all languages used,
by language abreviation.
- Specified by:
getAll
in interface Dictionary
-
getAll
Description copied from interface: Dictionary
Return all the possible values, for all languages used,
by language abreviation.
- Specified by:
getAll
in interface 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"));
}