|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pelzer.util.PropertyManager
public class PropertyManager
This class is used to condense and maintain the myriad .property files used by the system. It provides a layer of abstraction which allows us to migrate from *many* files, down to one, or even to pull our properties from a database, with little or no code modifications on dependent classes.
| Nested Class Summary | |
|---|---|
static class |
PropertyManager.ManagedProperties
This class emulates a java.util.Properties object, but doesn't quite support all its methods. |
static class |
PropertyManager.PropertyProcessor
Performs preprocessing on the PropertyManager.properties file, performing #include processing, obfuscation, etc. |
| Method Summary | |
|---|---|
static List<Map.Entry<String,String>> |
getAllProperties(String environment)
|
static String |
getBuildNumber()
|
static String |
getEnvironment()
|
static String |
getHostname()
|
static String |
getLocalizedProperty(String key)
|
static String |
getLocalizedProperty(String namespace,
String key)
|
static String |
getLocalizedProperty(String namespace,
String key,
String defaultValue)
Allows retrieval of localized properties set up for SPECIFIC hosts. |
static PropertyManager.ManagedProperties |
getProperties(String namespace)
|
static String |
getProperty(String key)
|
static String |
getProperty(String namespace,
String key)
|
static String |
getProperty(String namespace,
String key,
String defaultValue)
|
static boolean |
isDEV()
|
static boolean |
isPROD()
|
static boolean |
isTEST()
|
static void |
override(String key,
String value)
Sets a property manually: You'd generally only call this method from a unit-test, to make sure a certain property was set correctly... |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getBuildNumber()
public static String getHostname()
public static PropertyManager.ManagedProperties getProperties(String namespace)
public static String getProperty(String key)
public static String getProperty(String namespace,
String key)
public static String getProperty(String namespace,
String key,
String defaultValue)
public static String getLocalizedProperty(String key)
public static String getLocalizedProperty(String namespace,
String key)
public static String getLocalizedProperty(String namespace,
String key,
String defaultValue)
public static String getEnvironment()
public static boolean isDEV()
public static boolean isTEST()
public static boolean isPROD()
public static List<Map.Entry<String,String>> getAllProperties(String environment)
public static void override(String key,
String value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||