public class UtilProperties extends Object
| Modifier and Type | Field and Description |
|---|---|
static UtilCache<String,ResourceBundle> |
bundleLocaleCache
An instance of the generic cache for storing the ResourceBundle
corresponding to each properties file keyed by a String for the resource location and the locale
|
static UtilCache<Object,FlexibleProperties> |
resourceCache
An instance of the generic cache for storing the FlexibleProperties
corresponding to each properties file keyed by a String for the resource location.
|
static UtilCache<URL,FlexibleProperties> |
urlCache
An instance of the generic cache for storing the FlexibleProperties
corresponding to each properties file keyed by a URL object
|
| Constructor and Description |
|---|
UtilProperties() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getMessage(String resource,
String name,
List<?> arguments,
Locale locale)
Returns the value of the specified property name from the specified resource/properties file corresponding
to the given locale and replacing argument place holders with the given arguments using the MessageFormat class
|
static String |
getMessage(String resource,
String name,
Locale locale)
Returns the value of the specified property name from the specified resource/properties file corresponding to the given locale.
|
static String |
getMessage(String resource,
String name,
Object[] arguments,
Locale locale)
Returns the value of the specified property name from the specified resource/properties file corresponding
to the given locale and replacing argument place holders with the given arguments using the MessageFormat class
|
static Properties |
getProperties(String resource)
Returns the specified resource/properties file
|
static Properties |
getProperties(String resource,
Locale locale)
Returns the specified resource/properties file
NOTE: This is NOT fully implemented yet to fulfill all of the requirements
for i18n messages.
|
static Properties |
getProperties(URL url)
Returns the specified resource/properties file
|
static double |
getPropertyNumber(String resource,
String name) |
static double |
getPropertyNumber(URL url,
String name) |
static String |
getPropertyValue(String resource,
String name)
Returns the value of the specified property name from the specified resource/properties file
|
static String |
getPropertyValue(String resource,
String name,
String defaultValue)
Returns the value of the specified property name from the specified resource/properties file.
|
static String |
getPropertyValue(URL url,
String name)
Returns the value of the specified property name from the specified resource/properties file
|
static String |
getPropertyValue(URL url,
String name,
String defaultValue)
Returns the value of the specified property name from the specified resource/properties file.
|
static ResourceBundle |
getResourceBundle(String resource,
Locale locale)
Returns the specified resource/properties file as a ResourceBundle
|
static String |
getSplitPropertyValue(URL url,
String name)
Returns the value of a split property name from the specified resource/properties file
Rather than specifying the property name the value of a name.X property is specified which
will correspond to a value.X property whose value will be returned.
|
static boolean |
propertyValueEquals(String resource,
String name,
String compareString)
Compares the specified property to the compareString, returns true if they are the same, false otherwise
|
static boolean |
propertyValueEquals(URL url,
String name,
String compareString)
Compares the specified property to the compareString, returns true if they are the same, false otherwise
|
static boolean |
propertyValueEqualsIgnoreCase(String resource,
String name,
String compareString)
Compares Ignoring Case the specified property to the compareString, returns true if they are the same, false otherwise
|
static boolean |
propertyValueEqualsIgnoreCase(URL url,
String name,
String compareString)
Compares Ignoring Case the specified property to the compareString, returns true if they are the same, false otherwise
|
public static UtilCache<Object,FlexibleProperties> resourceCache
public static UtilCache<URL,FlexibleProperties> urlCache
public static UtilCache<String,ResourceBundle> bundleLocaleCache
public static boolean propertyValueEquals(String resource, String name, String compareString)
resource - The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent'name - The name of the property in the properties filecompareString - The String to compare the property value topublic static boolean propertyValueEqualsIgnoreCase(String resource, String name, String compareString)
resource - The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent'name - The name of the property in the properties filecompareString - The String to compare the property value topublic static String getPropertyValue(String resource, String name, String defaultValue)
resource - The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent'name - The name of the property in the properties filedefaultValue - The value to return if the property is not foundpublic static String getPropertyValue(String resource, String name)
resource - The name of the resource - can be a file, class, or URLname - The name of the property in the properties filepublic static Properties getProperties(String resource)
resource - The name of the resource - can be a file, class, or URLpublic static Properties getProperties(URL url)
resource - The name of the resource - can be a file, class, or URLpublic static boolean propertyValueEquals(URL url, String name, String compareString)
url - URL object specifying the location of the resourcename - The name of the property in the properties filecompareString - The String to compare the property value topublic static boolean propertyValueEqualsIgnoreCase(URL url, String name, String compareString)
url - URL object specifying the location of the resourcename - The name of the property in the properties filecompareString - The String to compare the property value topublic static String getPropertyValue(URL url, String name, String defaultValue)
url - URL object specifying the location of the resourcename - The name of the property in the properties filedefaultValue - The value to return if the property is not foundpublic static String getPropertyValue(URL url, String name)
url - URL object specifying the location of the resourcename - The name of the property in the properties filepublic static String getSplitPropertyValue(URL url, String name)
url - URL object specifying the location of the resourcename - The name of the split property in the properties filepublic static String getMessage(String resource, String name, Locale locale)
resource - The name of the resource - can be a file, class, or URLname - The name of the property in the properties filelocale - The locale that the given resource will correspond topublic static String getMessage(String resource, String name, Object[] arguments, Locale locale)
resource - The name of the resource - can be a file, class, or URLname - The name of the property in the properties filelocale - The locale that the given resource will correspond toarguments - An array of Objects to insert into the message argument place holderspublic static String getMessage(String resource, String name, List<?> arguments, Locale locale)
resource - The name of the resource - can be a file, class, or URLname - The name of the property in the properties filelocale - The locale that the given resource will correspond toarguments - A list of Objects to insert into the message argument place holderspublic static ResourceBundle getResourceBundle(String resource, Locale locale)
resource - The name of the resource - can be a file, class, or URLlocale - The locale that the given resource will correspond topublic static Properties getProperties(String resource, Locale locale)
resource - The name of the resource - can be a file, class, or URLlocale - The locale that the given resource will correspond toCopyright © 2015 Atlassian. All rights reserved.