public class ApplicationPropertiesImpl extends Object implements ApplicationProperties
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ENCODING |
Constructor and Description |
---|
ApplicationPropertiesImpl(ApplicationPropertiesStore applicationPropertiesStore) |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
This will return all application and typed values.
|
String |
getContentType() |
String |
getDefaultBackedString(String name)
Get the property from the application properties, but if not found, try to get from the default properties file.
|
String |
getDefaultBackedText(String name)
Get the property from the application properties, but if not found, try to get from the default properties file.
|
Collection<String> |
getDefaultKeys()
Get all the keys from the default properties
|
Locale |
getDefaultLocale()
Returns the default
Locale set up on the JIRA instance. |
String |
getDefaultString(String name)
Get the default property (if the property is not set)
|
String |
getEncoding()
Returns the encoding to be used by JIRA from the application properties.
|
Collection<String> |
getKeys() |
String |
getMailEncoding()
Convenience method to get the email encoding
|
boolean |
getOption(String key)
Get the option from the application properties, but if not found, try to get from the default properties file.
|
String |
getString(String name)
Returns the value of the given key.
|
Collection<String> |
getStringsWithPrefix(String prefix) |
String |
getText(String name) |
void |
onClearCache(ClearCacheEvent event) |
void |
refresh()
Refresh application properties object by refreshing the PropertiesManager
|
void |
setOption(String key,
boolean value)
Sets the boolean application property.
|
void |
setString(String key,
String value)
Sets the string application property.
|
void |
setText(String key,
String value)
Set the text application property.
|
String |
toString() |
public static final String DEFAULT_ENCODING
public ApplicationPropertiesImpl(ApplicationPropertiesStore applicationPropertiesStore)
@EventListener public void onClearCache(ClearCacheEvent event)
public String getText(String name)
getText
in interface ApplicationProperties
@Nullable public String getString(String name)
ApplicationProperties
getString
in interface ApplicationProperties
name
- the key to retrievepublic Collection<String> getDefaultKeys()
ApplicationProperties
getDefaultKeys
in interface ApplicationProperties
public String getDefaultBackedString(String name)
ApplicationProperties
getDefaultBackedString
in interface ApplicationProperties
public String getDefaultBackedText(String name)
ApplicationProperties
getDefaultBackedText
in interface ApplicationProperties
public String getDefaultString(String name)
ApplicationProperties
getDefaultString
in interface ApplicationProperties
name
- the name of the property.public boolean getOption(String key)
ApplicationProperties
getOption
in interface ApplicationProperties
public Collection<String> getKeys()
getKeys
in interface ApplicationProperties
public Map<String,Object> asMap()
ApplicationProperties
Boolean
object will be returned.
If an application property has a null value, then the key will still be in the Map.keySet()
WARNING: This method is somewhat expensive. Do not use it unless you really
are doing something with all of the application properties, such as for the system information page.
If you are just retrieving a single property, then use one of the get
methods instead. For
most properties, ApplicationProperties.getDefaultBackedString(String)
or ApplicationProperties.getOption(String)
will be the best
choice.
asMap
in interface ApplicationProperties
public void setString(String key, String value)
ApplicationProperties
StringApplicationPropertySetEvent
.setString
in interface ApplicationProperties
key
- the key of the application property.value
- the value of the application property.public void setText(String key, String value)
ApplicationProperties
StringApplicationPropertySetEvent
.setText
in interface ApplicationProperties
key
- the key of the application property.value
- the value of the application property.public void setOption(String key, boolean value)
ApplicationProperties
BooleanApplicationPropertySetEvent
.setOption
in interface ApplicationProperties
key
- the key of the application property.value
- the value of the application property.public String getEncoding()
ApplicationProperties
getEncoding
in interface ApplicationProperties
public String getMailEncoding()
ApplicationProperties
getMailEncoding
in interface ApplicationProperties
public String getContentType()
getContentType
in interface ApplicationProperties
public void refresh()
ApplicationProperties
refresh
in interface ApplicationProperties
public Locale getDefaultLocale()
ApplicationProperties
Locale
set up on the JIRA instance.getDefaultLocale
in interface ApplicationProperties
public Collection<String> getStringsWithPrefix(String prefix)
getStringsWithPrefix
in interface ApplicationProperties
Copyright © 2002-2018 Atlassian. All Rights Reserved.