Class AbstractEntityPropertiesService

  • All Implemented Interfaces:
    org.sakaiproject.entitybroker.providers.EntityPropertiesService
    Direct Known Subclasses:
    EntityPropertiesServiceSimple, EntityPropertiesServiceSpringImpl

    public abstract class AbstractEntityPropertiesService
    extends Object
    implements org.sakaiproject.entitybroker.providers.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)
    • Constructor Detail

      • AbstractEntityPropertiesService

        public AbstractEntityPropertiesService()
    • Method Detail

      • 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:
        getLocale in interface org.sakaiproject.entitybroker.providers.EntityPropertiesService
      • loadProperties

        public void loadProperties​(String prefix,
                                   String baseName,
                                   ClassLoader classLoader)
        Specified by:
        loadProperties in interface org.sakaiproject.entitybroker.providers.EntityPropertiesService
      • registerLocaleMessages

        public 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)
        Parameters:
        prefix - an entity prefix
        baseName - (optional) the part before the .properties or _en.properties, example: location/dir/myentity.properties, if null then prefix is used
        locale - the Locale to register messages for
        classLoader - (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:
        unloadProperties in interface org.sakaiproject.entitybroker.providers.EntityPropertiesService
      • getProperty

        public String getProperty​(String prefix,
                                  String key)
        Specified by:
        getProperty in interface org.sakaiproject.entitybroker.providers.EntityPropertiesService
      • getProperty

        public String getProperty​(String prefix,
                                  String key,
                                  Locale locale)
        Specified by:
        getProperty in interface org.sakaiproject.entitybroker.providers.EntityPropertiesService
      • getProperty

        public String getProperty​(String prefix,
                                  String key,
                                  Locale locale,
                                  String defaultValue)
        Specified by:
        getProperty in interface org.sakaiproject.entitybroker.providers.EntityPropertiesService