com.atlassian.jira.mock
Class MockApplicationProperties

java.lang.Object
  extended by com.atlassian.jira.mock.MockApplicationProperties
All Implemented Interfaces:
ApplicationProperties

public class MockApplicationProperties
extends Object
implements ApplicationProperties

Simple ApplicationProperties implementation backed by a Map.


Constructor Summary
MockApplicationProperties()
           
MockApplicationProperties(Map<String,Object> initialProperties)
           
 
Method Summary
 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()
           
 String getDefaultString(String name)
          Get the default property (if the property is not set)
 String getEncoding()
          Convenience method to get the content type for an application
 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)
           
 Collection<String> getStringsWithPrefix(String prefix)
           
 String getText(String name)
           
 void refresh()
          Refresh application properties object by refreshing the PropertiesManager
 void setEncoding(String encoding)
           
 void setOption(String key, boolean value)
           
 void setString(String name, String value)
           
 void setText(String name, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockApplicationProperties

public MockApplicationProperties()

MockApplicationProperties

public MockApplicationProperties(Map<String,Object> initialProperties)
Method Detail

getText

public String getText(String name)
Specified by:
getText in interface ApplicationProperties

getDefaultBackedText

public String getDefaultBackedText(String name)
Description copied from interface: ApplicationProperties
Get the property from the application properties, but if not found, try to get from the default properties file.

Specified by:
getDefaultBackedText in interface ApplicationProperties

setText

public void setText(String name,
                    String value)
Specified by:
setText in interface ApplicationProperties

getString

public String getString(String name)
Specified by:
getString in interface ApplicationProperties

getDefaultKeys

public Collection<String> getDefaultKeys()
Description copied from interface: ApplicationProperties
Get all the keys from the default properties

Specified by:
getDefaultKeys in interface ApplicationProperties

getDefaultBackedString

public String getDefaultBackedString(String name)
Description copied from interface: ApplicationProperties
Get the property from the application properties, but if not found, try to get from the default properties file.

Specified by:
getDefaultBackedString in interface ApplicationProperties

getDefaultString

public String getDefaultString(String name)
Description copied from interface: ApplicationProperties
Get the default property (if the property is not set)

Specified by:
getDefaultString in interface ApplicationProperties
Parameters:
name - the name of the property.

setString

public void setString(String name,
                      String value)
Specified by:
setString in interface ApplicationProperties

getOption

public boolean getOption(String key)
Description copied from interface: ApplicationProperties
Get the option from the application properties, but if not found, try to get from the default properties file.

Specified by:
getOption in interface ApplicationProperties

getKeys

public Collection<String> getKeys()
Specified by:
getKeys in interface ApplicationProperties

setOption

public void setOption(String key,
                      boolean value)
Specified by:
setOption in interface ApplicationProperties

getEncoding

public String getEncoding()
Description copied from interface: ApplicationProperties
Convenience method to get the content type for an application

Specified by:
getEncoding in interface ApplicationProperties

getMailEncoding

public String getMailEncoding()
Description copied from interface: ApplicationProperties
Convenience method to get the email encoding

Specified by:
getMailEncoding in interface ApplicationProperties

setEncoding

public void setEncoding(String encoding)

getContentType

public String getContentType()
Specified by:
getContentType in interface ApplicationProperties

refresh

public void refresh()
Description copied from interface: ApplicationProperties
Refresh application properties object by refreshing the PropertiesManager

Specified by:
refresh in interface ApplicationProperties

getDefaultLocale

public Locale getDefaultLocale()
Specified by:
getDefaultLocale in interface ApplicationProperties

getStringsWithPrefix

public Collection<String> getStringsWithPrefix(String prefix)
Specified by:
getStringsWithPrefix in interface ApplicationProperties

asMap

public Map<String,Object> asMap()
Description copied from interface: ApplicationProperties
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()

Specified by:
asMap in interface ApplicationProperties
Returns:
a map of key to actual value object


Copyright © 2002-2014 Atlassian. All Rights Reserved.