public abstract class PropertiesFile
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
PropertiesFile(java.lang.String baseName,
java.lang.ClassLoader classLoader,
java.util.Locale defaultLocale)
Constructor.
|
protected |
PropertiesFile(java.lang.String registeredSuite,
java.lang.String baseName,
java.lang.ClassLoader classLoader,
java.util.Locale defaultLocale)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getArrayProperty(java.lang.String key)
Returns the property for the specified key and locale.
|
java.lang.String[] |
getArrayProperty(java.lang.String key,
java.lang.String delim)
Returns the property for the specified key and locale.
|
java.lang.String[] |
getArrayProperty(java.lang.String key,
java.lang.String delim,
java.util.Locale locale)
Returns the property for the specified key and locale.
|
java.lang.String |
getBaseName()
Returns the base name.
|
java.lang.Boolean |
getBooleanProperty(java.lang.String key)
Returns the property for the specified key.
|
boolean |
getBooleanProperty(java.lang.String key,
boolean defaultValue) |
java.lang.Boolean |
getBooleanProperty(java.lang.String key,
java.util.Locale locale)
Returns the property for the specified key and locale.
|
java.lang.ClassLoader |
getClassLoader()
Returns the class loader.
|
java.util.Locale |
getDefaultLocale()
Returns the default locale.
|
java.lang.Integer |
getIntegerProperty(java.lang.String key)
Returns the property for the specified key.
|
java.lang.Integer |
getIntegerProperty(java.lang.String key,
java.util.Locale locale)
Returns the property for the specified key and locale.
|
protected java.lang.String |
getLocaleKey(java.util.Locale locale)
Gets the key for the specified locale.
|
MultilingualText |
getMultilingualText(java.lang.String key)
Returns a
MultilingualText instance for the specified key. |
MultilingualText |
getMultilingualText(java.lang.String key,
java.lang.String defaultValue)
Returns a
MultilingualText instance for the specified key. |
java.lang.String |
getProperty(java.lang.String key)
Returns the property for the specified key.
|
java.lang.String |
getProperty(java.lang.String key,
java.util.Locale locale)
Returns the property for the specified key and locale.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the property for the specified key.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue,
java.util.Locale locale)
Returns the property for the specified key and locale.
|
protected java.lang.String |
getPropertyKey(java.lang.String localeKey,
java.lang.String key)
Gets the locale sensitive property key.
|
protected void |
loadProperties(java.lang.String localeKey)
Loads the properties for a specific locale.
|
protected void |
merge(PropertiesFile other) |
protected PropertiesFile(java.lang.String registeredSuite, java.lang.String baseName, java.lang.ClassLoader classLoader, java.util.Locale defaultLocale)
registeredSuite
- The name of the Registered Suite.baseName
- the base name of the properties file.classLoader
- the class loader to use when loading the properties
file.defaultLocale
- the default locale to use when retrieving
properties.protected PropertiesFile(java.lang.String baseName, java.lang.ClassLoader classLoader, java.util.Locale defaultLocale)
baseName
- the base name of the properties file.classLoader
- the class loader to use when loading the properties
file.defaultLocale
- the default locale to use when retrieving
properties.public java.lang.String getBaseName()
public java.util.Locale getDefaultLocale()
public java.lang.ClassLoader getClassLoader()
public java.lang.String getProperty(java.lang.String key)
key
- the property key.public java.lang.String getProperty(java.lang.String key, java.util.Locale locale)
key
- the property key.locale
- the locale to get the property for.public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- the property key.defaultValue
- the default value that will be returned if the
property doesn't exist.public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue, java.util.Locale locale)
key
- the property key.defaultValue
- the default value that will be returned if the
property doesn't existlocale
- the locale to get the property for.public java.lang.Boolean getBooleanProperty(java.lang.String key)
key
- the property key.public boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
public java.lang.Boolean getBooleanProperty(java.lang.String key, java.util.Locale locale)
key
- the property key.locale
- the locale to get the property for.public java.lang.String[] getArrayProperty(java.lang.String key)
key
- the property key.public java.lang.String[] getArrayProperty(java.lang.String key, java.lang.String delim)
key
- the property key.delim
- the delimeter to use when splitting the property value.public java.lang.String[] getArrayProperty(java.lang.String key, java.lang.String delim, java.util.Locale locale)
key
- the property key.delim
- the delimeter to use when splitting the property value.locale
- the locale to get the property for.public java.lang.Integer getIntegerProperty(java.lang.String key)
key
- the property key.public java.lang.Integer getIntegerProperty(java.lang.String key, java.util.Locale locale)
key
- the property key.locale
- the locale to get the property for.protected void loadProperties(java.lang.String localeKey)
The properties that are loaded are cached internally.
localeKey
- the name of the locale.protected void merge(PropertiesFile other)
protected java.lang.String getLocaleKey(java.util.Locale locale)
locale
- the locale.protected java.lang.String getPropertyKey(java.lang.String localeKey, java.lang.String key)
localeKey
- the key for the current locale.key
- the property key.public MultilingualText getMultilingualText(java.lang.String key, java.lang.String defaultValue)
MultilingualText
instance for the specified key. The
default value will be returned unless as match is found.key
- The property key.defaultValue
- The default value.MultilingualText
instance.public MultilingualText getMultilingualText(java.lang.String key)
MultilingualText
instance for the specified key.key
- The property key.MultilingualText
instance.Copyright © Technia AB. All Rights Reserved.