com.atlassian.jira.config.properties
Interface ApplicationProperties

All Known Implementing Classes:
ApplicationPropertiesImpl

public interface ApplicationProperties

This can be used to lookup JIRA application properties. This uses a two stage strategy for finding property values. First the database is checked to see if a value exists. If it doesnt exists, it falls back to the jira-application.properties file for a value. Once a key is placed in the database (via an upgrade task or UI interaction) then it will always be loaded from the database. NOTE : Be very careful with boolean property values. Because of the way OSPropertySets work, its impossible to distinguish between properties that have a false value and properties that have NO value. Therefore it is usually better to have a "String" property set to the value "true" or "false" and then use Boolean.valueOf() in it. This way its possible detects the absence of a property value from it being set to false.


Method Summary
 java.util.Map<java.lang.String,java.lang.Object> asMap()
          This will return all application and typed values.
 boolean exists(java.lang.String key)
          Deprecated. Use getDefaultBackedString() instead and look for null
 java.lang.String getContentType()
           
 java.lang.String getDefaultBackedString(java.lang.String name)
           
 java.lang.String getDefaultBackedText(java.lang.String name)
           
 java.util.Collection<java.lang.String> getDefaultKeys()
           
 java.util.Locale getDefaultLocale()
           
 java.lang.String getDefaultString(java.lang.String name)
           
 java.lang.String getEncoding()
           
 java.util.Collection<java.lang.String> getKeys()
           
 java.lang.String getMailEncoding()
           
 boolean getOption(java.lang.String key)
           
 java.lang.String getString(java.lang.String name)
           
 java.util.Collection<java.lang.String> getStringsWithPrefix(java.lang.String prefix)
           
 java.lang.String getText(java.lang.String name)
           
 void refresh()
           
 void setOption(java.lang.String key, boolean value)
           
 void setString(java.lang.String name, java.lang.String value)
           
 void setText(java.lang.String name, java.lang.String value)
           
 

Method Detail

getText

java.lang.String getText(java.lang.String name)

getDefaultBackedText

java.lang.String getDefaultBackedText(java.lang.String name)

setText

void setText(java.lang.String name,
             java.lang.String value)

getString

java.lang.String getString(java.lang.String name)

getDefaultKeys

java.util.Collection<java.lang.String> getDefaultKeys()

getDefaultBackedString

java.lang.String getDefaultBackedString(java.lang.String name)

getDefaultString

java.lang.String getDefaultString(java.lang.String name)

setString

void setString(java.lang.String name,
               java.lang.String value)

exists

boolean exists(java.lang.String key)
Deprecated. Use getDefaultBackedString() instead and look for null

DOESN'T WORK, a getDefaultBackedString() call may return something, and this will return false, do not use!!!


getOption

boolean getOption(java.lang.String key)

getKeys

java.util.Collection<java.lang.String> getKeys()

setOption

void setOption(java.lang.String key,
               boolean value)

getEncoding

java.lang.String getEncoding()

getMailEncoding

java.lang.String getMailEncoding()

getContentType

java.lang.String getContentType()

refresh

void refresh()

getDefaultLocale

java.util.Locale getDefaultLocale()

getStringsWithPrefix

java.util.Collection<java.lang.String> getStringsWithPrefix(java.lang.String prefix)

asMap

java.util.Map<java.lang.String,java.lang.Object> asMap()
This will return all application and typed values. For example if the property is a boolean then a Boolean object will be returned. If an application property has a null value, then the key will still be in the Map.keySet()

Returns:
a map of key to actual value object


Copyright © 2002-2010 Atlassian. All Rights Reserved.