Class AbstractEntityPropertiesService
- java.lang.Object
-
- org.sakaiproject.entitybroker.util.core.AbstractEntityPropertiesService
-
- All Implemented Interfaces:
EntityPropertiesService
- Direct Known Subclasses:
EntityPropertiesServiceSimple,EntityPropertiesServiceSpringImpl
public abstract class AbstractEntityPropertiesService extends Object implements EntityPropertiesService
This service allows us to track all the properties files related to describing the capabilities of our entities and the entities themselves, it allows lookup of strings as well
NOTE: For internal use only, has no dependencies- Author:
- Aaron Zeckoski (azeckoski @ gmail.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractEntityPropertiesService.MessageBundle
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,AbstractEntityPropertiesService.MessageBundle>prefixMap
-
Constructor Summary
Constructors Constructor Description AbstractEntityPropertiesService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description LocalegetLocale()StringgetProperty(String prefix, String key)StringgetProperty(String prefix, String key, Locale locale)StringgetProperty(String prefix, String key, Locale locale, String defaultValue)voidloadProperties(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 theAbstractEntityPropertiesService.MessageBundleyou create in this method so that the messages can be looked up later, register usingregisterPrefixMessageBundle(String, MessageBundle)voidregisterPrefixMessageBundle(String prefix, AbstractEntityPropertiesService.MessageBundle messageBundle)Register this message bundle with the internal storagebooleanunloadProperties(String prefix)voidunregisterPrefixMessageBundle(String prefix)Unregister this message bundle
-
-
-
Field Detail
-
prefixMap
protected Map<String,AbstractEntityPropertiesService.MessageBundle> prefixMap
-
-
Method Detail
-
registerPrefixMessageBundle
public void registerPrefixMessageBundle(String prefix, AbstractEntityPropertiesService.MessageBundle messageBundle)
Register this message bundle with the internal storage- Parameters:
prefix- the related entity prefix for this message bundlemessageBundle- the message bundle- Throws:
IllegalArgumentException- is any arguments are null
-
unregisterPrefixMessageBundle
public void unregisterPrefixMessageBundle(String prefix)
Unregister this message bundle- Parameters:
prefix- the related entity prefix for a message bundle- Throws:
IllegalArgumentException- is any arguments are null
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfaceEntityPropertiesService
-
loadProperties
public void loadProperties(String prefix, String baseName, ClassLoader classLoader)
- Specified by:
loadPropertiesin interfaceEntityPropertiesService
-
registerLocaleMessages
public abstract List<String> registerLocaleMessages(String prefix, String baseName, Locale locale, ClassLoader classLoader)
Override this to provide custom message handling, you must register theAbstractEntityPropertiesService.MessageBundleyou create in this method so that the messages can be looked up later, register usingregisterPrefixMessageBundle(String, MessageBundle)- Parameters:
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 used- Returns:
- the list of registered keys for this Locale
-
unloadProperties
public boolean unloadProperties(String prefix)
- Specified by:
unloadPropertiesin interfaceEntityPropertiesService
-
getProperty
public String getProperty(String prefix, String key)
- Specified by:
getPropertyin interfaceEntityPropertiesService
-
getProperty
public String getProperty(String prefix, String key, Locale locale)
- Specified by:
getPropertyin interfaceEntityPropertiesService
-
getProperty
public String getProperty(String prefix, String key, Locale locale, String defaultValue)
- Specified by:
getPropertyin interfaceEntityPropertiesService
-
-