|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.github.fge.msgsimple.provider.StaticMessageSourceProvider
@Immutable public final class StaticMessageSourceProvider
Static message source provider
The simplest form of such a provider is one which only has a default message source. You can define specific message sources for specific locales too.
Convenience static factory methods exist for building a message source
provider from a single message source; for more elaborage scenarios, you need
to use a StaticMessageSourceProvider.Builder
(using the newBuilder()
method).
StaticMessageSourceProvider.Builder
Nested Class Summary | |
---|---|
static class |
StaticMessageSourceProvider.Builder
Builder for a StaticMessageSourceProvider |
Method Summary | |
---|---|
MessageSource |
getMessageSource(Locale locale)
Provide a message source for a given locale |
static StaticMessageSourceProvider.Builder |
newBuilder()
Create a new static source builder |
static MessageSourceProvider |
withSingleSource(Locale locale,
MessageSource source)
Convenience method to create a provider with a single source for a specific locale |
static MessageSourceProvider |
withSingleSource(MessageSource source)
Convenience method to create a provider with a single source |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static StaticMessageSourceProvider.Builder newBuilder()
public static MessageSourceProvider withSingleSource(MessageSource source)
This source will be used for all locales.
source
- the message source
StaticMessageSourceProvider.Builder.setDefaultSource(MessageSource)
public static MessageSourceProvider withSingleSource(Locale locale, MessageSource source)
locale
- the localesource
- the message source
StaticMessageSourceProvider.Builder.addSource(Locale, MessageSource)
public MessageSource getMessageSource(Locale locale)
MessageSourceProvider
getMessageSource
in interface MessageSourceProvider
locale
- the locale
null
if none is found
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |