com.atlassian.jira.util.resourcebundle
Class DebuggingResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by com.atlassian.jira.util.resourcebundle.DebuggingResourceBundle

public class DebuggingResourceBundle
extends ResourceBundle

This ResourceBundle can dynamically read a properties file for keys. This is reasonable efficient in that it only re-reads the keys if the file modification date has changed.

This is intended to be used ONLY in development so that changes the language files can be seen without restarting JIRA

Since:
v4.1

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
 
Field Summary
static org.apache.log4j.Logger log
           
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
DebuggingResourceBundle(File propertiesFile, Locale locale)
           
 
Method Summary
static DebuggingResourceBundle getDebuggingResourceBundle(String baseName, Locale locale)
          See ResourceBundle.getBundle(String, java.util.Locale) for an example of the semantics

* This should be re-implemented using Java 1.6 ResourceBundle.Control objects and hence allow the normal ResourceBundle loading mechanism to be used.

 Enumeration<String> getKeys()
           
protected  Object handleGetObject(String key)
           
 boolean isStale()
           
 String toString()
           
 
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, keySet, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
Constructor Detail

DebuggingResourceBundle

public DebuggingResourceBundle(File propertiesFile,
                               Locale locale)
Method Detail

getDebuggingResourceBundle

public static DebuggingResourceBundle getDebuggingResourceBundle(String baseName,
                                                                 Locale locale)
See ResourceBundle.getBundle(String, java.util.Locale) for an example of the semantics

* This should be re-implemented using Java 1.6 ResourceBundle.Control objects and hence allow the normal ResourceBundle loading mechanism to be used. But we arent on Java 6 yet!

http://java.sun.com/javase/6/docs/api/java/util/ResourceBundle.Control.html

Parameters:
baseName - the base name of the reosurce
locale - the locale to use as a lookup
Returns:
a DebuggingResourceBundle or null

isStale

public boolean isStale()

handleGetObject

protected Object handleGetObject(String key)
Specified by:
handleGetObject in class ResourceBundle

getKeys

public Enumeration<String> getKeys()
Specified by:
getKeys in class ResourceBundle

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2013 Atlassian. All Rights Reserved.