public final class BundleRef extends BundleBase implements IBundle
BundleRefs specify a code location in the webapp's classpath. The code location consists of a class which defines the "start location" to look for the message files and which determines the basic classloader to use to load those files. BundleRef's are cached globally; when you define the same BundleRef multiple times in the code you will always get a reference to the same bundle. This prevents the same bundle from being reloaded multiple times.
| Modifier and Type | Method and Description |
|---|---|
static BundleRef |
create(Class<?> clz,
String name)
Create or find the BundleRef representing this path.
|
static BundleRef |
createWrapper(NlsMessageProvider mp) |
boolean |
exists() |
String |
findMessage(Locale loc,
String code)
Locate the specified key for the specified locale.
|
String |
getBundleKey()
Returns the dotted name of the message bundle as (class package name) '.' (file-name-without-.properties).
|
static void |
internalClear()
Clears the cache.
|
formatMessage, formatMessage, getString, getStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitformatMessage, getString, getStringpublic static final BundleRef DUMMY
public static BundleRef createWrapper(@Nonnull NlsMessageProvider mp)
@Nonnull public static BundleRef create(@Nonnull Class<?> clz, @Nonnull String name)
clz - name - Name of the bundle file (minus the ".properties" extension). Case is important!!!public boolean exists()
public String findMessage(@Nonnull Locale loc, @Nonnull String code)
NlsMessageProviderfindMessage in interface NlsMessageProviderfindMessage in class BundleBasepublic static void internalClear()
Copyright © 2017 etc.to. All rights reserved.