public abstract class AbstractEntityPropertiesService extends Object implements EntityPropertiesService
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractEntityPropertiesService.MessageBundle |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,AbstractEntityPropertiesService.MessageBundle> |
prefixMap |
| Constructor and Description |
|---|
AbstractEntityPropertiesService() |
| Modifier and Type | Method and Description |
|---|---|
Locale |
getLocale() |
String |
getProperty(String prefix,
String key) |
String |
getProperty(String prefix,
String key,
Locale locale) |
String |
getProperty(String prefix,
String key,
Locale locale,
String defaultValue) |
void |
loadProperties(String prefix,
String baseName,
ClassLoader classLoader) |
abstract List<String> |
registerLocaleMessages(String prefix,
String baseName,
Locale locale,
ClassLoader classLoader)
Override this to provide custom message handling,
you must register the
AbstractEntityPropertiesService.MessageBundle you create in this method so that the
messages can be looked up later, register using registerPrefixMessageBundle(String, MessageBundle) |
void |
registerPrefixMessageBundle(String prefix,
AbstractEntityPropertiesService.MessageBundle messageBundle)
Register this message bundle with the internal storage
|
boolean |
unloadProperties(String prefix) |
void |
unregisterPrefixMessageBundle(String prefix)
Unregister this message bundle
|
protected Map<String,AbstractEntityPropertiesService.MessageBundle> prefixMap
public void registerPrefixMessageBundle(String prefix, AbstractEntityPropertiesService.MessageBundle messageBundle)
prefix - the related entity prefix for this message bundlemessageBundle - the message bundleIllegalArgumentException - is any arguments are nullpublic void unregisterPrefixMessageBundle(String prefix)
prefix - the related entity prefix for a message bundleIllegalArgumentException - is any arguments are nullpublic Locale getLocale()
getLocale in interface EntityPropertiesServicepublic void loadProperties(String prefix, String baseName, ClassLoader classLoader)
loadProperties in interface EntityPropertiesServicepublic abstract List<String> registerLocaleMessages(String prefix, String baseName, Locale locale, ClassLoader classLoader)
AbstractEntityPropertiesService.MessageBundle you create in this method so that the
messages can be looked up later, register using registerPrefixMessageBundle(String, MessageBundle)prefix - an entity prefixbaseName - (optional) the part before the .properties or _en.properties,
example: location/dir/myentity.properties, if null then prefix is usedlocale - the Locale to register messages forclassLoader - (optional) the ClassLoader to find the properties files in,
if null then the default thread ClassLoader is usedpublic boolean unloadProperties(String prefix)
unloadProperties in interface EntityPropertiesServicepublic String getProperty(String prefix, String key)
getProperty in interface EntityPropertiesServicepublic String getProperty(String prefix, String key, Locale locale)
getProperty in interface EntityPropertiesServicepublic String getProperty(String prefix, String key, Locale locale, String defaultValue)
getProperty in interface EntityPropertiesServiceCopyright © 2007–2019 CARET, University of Cambridge. All rights reserved.