|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cert.cc.util.PropertiesManager
public final class PropertiesManager
PropertiesManager is a simple wrapper around a Properties
specified by a .properties file
location.
A separate PropertiesManager instance should be used for each properties file. By re-creating PropertiesManager each invocation allows the file to be changed without the need to restart JIRA. Once PropertiesManager has been instantiated, it will hold onto the properties.
© 2010 Carnegie Mellon University
Field Summary | |
---|---|
static File |
PARENT_COMMON_DIRECTORY
|
Constructor Summary | |
---|---|
PropertiesManager(File resourcePath)
Constructor |
|
PropertiesManager(String resourcePath)
Constructor |
Method Summary | |
---|---|
String |
getProperty(String key)
Returns the value based on the key. |
String |
getText(ProjectActionSupport action,
String key)
Wrapper method that does what ProjectActionSupport .getText does. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final File PARENT_COMMON_DIRECTORY
Constructor Detail |
---|
public PropertiesManager(File resourcePath)
resourcePath
- Full path to the properties filepublic PropertiesManager(String resourcePath)
resourcePath
- Full path to the properties fileMethod Detail |
---|
public String getText(ProjectActionSupport action, String key)
ProjectActionSupport
.getText does.
This method expands upon this in allowing the retrieval of properties even when
called without ProjectActionSupport
initialized. This is useful in the case when a property
is needed internally and does not have an User
.
action
- ProjectActionSupport
if available. If not leave it as null.key
- String
representing the property name to look up a value for.
String
The value returned from the properties file. If it can not be found
it will return the key. This keeps with the way that the
getText method in ProjectActionSupport
works.public String getProperty(String key)
key
- Property key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |