Interface EntityPropertiesService
-
public interface EntityPropertiesServiceThis provides the entity system with a way to access properties (and then exposes this to others via the developer helper service)- Author:
- Aaron Zeckoski (azeckoski @ gmail.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalegetLocale()StringgetProperty(String prefix, String key)Get a property for an entity if one is available, uses the default LocaleStringgetProperty(String prefix, String key, Locale locale)Get a property for an entity if one is availableStringgetProperty(String prefix, String key, Locale locale, String defaultValue)Get a property for an entity if one is availablevoidloadProperties(String prefix, String baseName, ClassLoader classLoader)Register the properties in thisClassLoaderfor this entity prefixbooleanunloadProperties(String prefix)Unregister the properties stored for this prefix
-
-
-
Method Detail
-
loadProperties
void loadProperties(String prefix, String baseName, ClassLoader classLoader)
Register the properties in thisClassLoaderfor this entity prefix- Parameters:
prefix- an entity prefixbaseName- (optional) the part before the .properties or _en.properties, example: location/dir/myentity.properties, if null then prefix is usedclassLoader- (optional) the ClassLoader to find the properties files in, if null then the default thread ClassLoader is used
-
unloadProperties
boolean unloadProperties(String prefix)
Unregister the properties stored for this prefix- Parameters:
prefix- an entity prefix- Returns:
- true if unregistered, false if none found to unregister
-
getProperty
String getProperty(String prefix, String key)
Get a property for an entity if one is available, uses the default Locale- Parameters:
prefix- an entity prefixkey- the property key- Returns:
- the property value string OR null if none found
-
getProperty
String getProperty(String prefix, String key, Locale locale)
Get a property for an entity if one is available- Parameters:
prefix- an entity prefixkey- the property keylocale- the Locale to get the message for- Returns:
- the property value string OR null if none found
-
getProperty
String getProperty(String prefix, String key, Locale locale, String defaultValue)
Get a property for an entity if one is available- Parameters:
prefix- an entity prefixkey- the property keylocale- the Locale to get the message fordefaultValue- the default value to return if the value is null- Returns:
- the property value string OR defaultValue if none found
-
-