public final class NlsAccess extends Object
NlsBundle
and NlsMessage
.Modifier and Type | Field and Description |
---|---|
private static NlsBundleFactory |
bundleFactory |
private static NlsMessageFactory |
factory |
private static org.slf4j.Logger |
LOG |
private static NlsTemplateResolver |
templateResolver |
Modifier | Constructor and Description |
---|---|
private |
NlsAccess()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
static NlsBundleFactory |
getBundleFactory()
This method gets the default
NlsBundleFactory . |
static NlsMessageFactory |
getFactory()
This method gets the
NlsMessageFactory used to create instances of
NlsMessage . |
static NlsTemplateResolver |
getTemplateResolver()
This method gets the default
NlsTemplateResolver . |
static void |
setBundleFactory(NlsBundleFactory bundleFactory)
This method sets (overrides) the default
NlsBundleFactory . |
static void |
setFactory(NlsMessageFactory factory)
This method sets (overrides) the
NlsMessageFactory . |
static void |
setTemplateResolver(NlsTemplateResolver templateResolver)
This method sets (overrides) the default
NlsTemplateResolver . |
private static final org.slf4j.Logger LOG
private static NlsMessageFactory factory
private static NlsTemplateResolver templateResolver
private static NlsBundleFactory bundleFactory
public static NlsMessageFactory getFactory()
NlsMessageFactory
used to create instances of
NlsMessage
.public static void setFactory(NlsMessageFactory factory)
NlsMessageFactory
. This allows to exchange the NlsMessageFactory
and thereby the implementation of NlsMessage
. "default locale"
to choose the destination
language. In a multi-user server application a ThreadLocal
may be used to retrieve the appropriate
locale
. NlsMessage.getLocalizedMessage()
and solve this issue with IoC strategies (using
non-final static fields like here is evil). factory
- the factory-instance to use.public static NlsTemplateResolver getTemplateResolver()
NlsTemplateResolver
.NlsTemplateResolver
.public static void setTemplateResolver(NlsTemplateResolver templateResolver)
NlsTemplateResolver
. WARNING:templateResolver
- is the NlsTemplateResolver
to use by default.public static NlsBundleFactory getBundleFactory()
NlsBundleFactory
.NlsBundleFactory
.public static void setBundleFactory(NlsBundleFactory bundleFactory)
NlsBundleFactory
. bundleFactory
- is the NlsBundleFactory
to use by default.Copyright © 2001–2016 mmm-Team. All rights reserved.