|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mss.ea.conf.Configuration
Supports the configuration of the whole eaLib package. The configuration is a tree-like structure similiar to the Windows registry. There are two internal trees: the system and the user tree. It is only possible to generate keys in the user tree, the system tree contains read-only values. Keys in the user tree mask those in the system tree. The format of the keys is 'my.key.foo'.
Field Summary | |
protected static java.util.TreeMap |
systemMap
Tree map containing the system tree. |
protected static java.util.TreeMap |
userMap
Tree map containing the user map. |
Constructor Summary | |
Configuration()
|
Method Summary | |
static boolean |
getBoolean(java.lang.String key)
Gets a boolean object. |
static double |
getDouble(java.lang.String key)
Gets a double. |
static float |
getFloat(java.lang.String key)
Gets a float. |
protected static java.lang.String |
getIndent(int level)
Gets the number of tabs for indentation. |
static int |
getInteger(java.lang.String key)
Gets an integer. |
static long |
getLong(java.lang.String key)
Gets a long. |
protected static java.lang.Object |
getObject(java.lang.String fullPath)
Gets an Object by its key. |
protected static java.lang.Object |
getObject(java.lang.String[] fullPath)
Gets an Object by its key. |
protected static java.lang.Object |
getObject(java.lang.String[] fullPath,
java.util.TreeMap map)
Gets an Object by its key from the given treemap. |
protected static java.lang.Object |
getObject(java.lang.String nodePath,
java.lang.String key)
Gets an Object by its key. |
static java.lang.String |
getString(java.lang.String key)
Gets a string. |
static java.util.Iterator |
iterateEntries(java.lang.String key)
Iterates over all entries under the given key. |
protected static void |
printMap(java.util.TreeMap map,
int level)
Prints the given tree map to System.out. |
static void |
printSystemMap()
Prints the system tree to System.out. |
static void |
printUserMap()
Prints the user tree to System.out. |
protected static void |
processElement(net.n3.nanoxml.XMLElement element,
java.util.TreeMap parentMap)
Processes an XML element. |
protected static void |
removeKey(java.lang.String key,
java.util.TreeMap map)
Removes a key from the given treemap. |
protected static void |
removeSystemKey(java.lang.String key)
Removes a key from the system tree. |
static void |
removeUserKey(java.lang.String key)
Removes a key from the user tree. |
protected static void |
setKey(java.lang.String key,
java.lang.String value,
java.util.TreeMap map)
Stores a key-value pair in the given treemap. |
protected static void |
setSystemKey(java.lang.String key,
java.lang.String value)
Stores a key-value-pair in the sytem tree. |
static void |
setUserKey(java.lang.String key,
java.lang.String value)
Stores a key-value-pair in the user tree. |
protected static java.lang.String[] |
tokenizeKey(java.lang.String path)
Tokenizes a key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.util.TreeMap systemMap
protected static java.util.TreeMap userMap
Constructor Detail |
public Configuration()
Method Detail |
protected static void processElement(net.n3.nanoxml.XMLElement element, java.util.TreeMap parentMap)
element
- XML elementparentMap
- parent tree map of the elementprotected static java.lang.String[] tokenizeKey(java.lang.String path)
path
- path to a keyprotected static java.lang.Object getObject(java.lang.String fullPath)
fullPath
- key path to the objectprotected static java.lang.Object getObject(java.lang.String nodePath, java.lang.String key)
nodePath
- key path to the tree map of the objectkey
- key of the objectprotected static java.lang.Object getObject(java.lang.String[] fullPath)
fullPath
- key path stored in a string arrayprotected static java.lang.Object getObject(java.lang.String[] fullPath, java.util.TreeMap map)
fullPath
- key path to the objectmap
- treemap to look up for the objectpublic static boolean getBoolean(java.lang.String key)
key
- key path to the objectpublic static double getDouble(java.lang.String key)
key
- key path to the objectpublic static float getFloat(java.lang.String key)
key
- key path to the objectpublic static int getInteger(java.lang.String key)
key
- key path to the objectpublic static long getLong(java.lang.String key)
key
- key path to the objectpublic static java.lang.String getString(java.lang.String key)
key
- key path to the objectpublic static java.util.Iterator iterateEntries(java.lang.String key)
key
- key path to the objectprotected static void setKey(java.lang.String key, java.lang.String value, java.util.TreeMap map)
key
- keyvalue
- valuemap
- treemap for key-value-pair storageprotected static void setSystemKey(java.lang.String key, java.lang.String value)
key
- keyvalue
- valuepublic static void setUserKey(java.lang.String key, java.lang.String value)
key
- keyvalue
- valueprotected static void removeKey(java.lang.String key, java.util.TreeMap map)
key
- key to removemap
- treemap to remove key fromprotected static void removeSystemKey(java.lang.String key)
key
- key to removepublic static void removeUserKey(java.lang.String key)
key
- key to removepublic static void printSystemMap()
public static void printUserMap()
protected static void printMap(java.util.TreeMap map, int level)
map
- treemap to printlevel
- level of indentationprotected static java.lang.String getIndent(int level)
level
- level of indentation
|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |