|
Kieker 1.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary<K,V> java.util.Hashtable<Object,Object> java.util.Properties kieker.common.configuration.Configuration
public final class Configuration
This class represents a configuration object within the Kieker project. Technically it is a property list with some additional methods and possibilities.
Some of the methods are marked as deprecated. This is not because they will be removed, but rather because they should not be used anymore (at least not directly
- they are still used in a valid way within this class). Normally we would remove them, but they are inherited from the class Properties
and can neither
be removed nor get a lower visibility modificator.
Constructor Summary | |
---|---|
Configuration()
Creates a new (empty) configuration. |
|
Configuration(Properties defaults)
Creates a new instance of this class using the given parameters. |
Method Summary | |
---|---|
static String |
convertToPath(String pathname)
Based upon Guava 14.0.1 (Chris Nokleberg, Colin Decker). |
Configuration |
flatten()
Flattens the Properties hierarchies and returns a new Configuration object. |
Configuration |
flatten(Configuration defaultConfiguration)
Flattens the Properties hierarchies and returns a new Configuration object. |
void |
flattenInPlace()
Flattens the Properties hierarchies with this Configuration. |
Object |
get(Object key)
Deprecated. This method will not be removed (as this is for technical reasons not possible), but should only be used within this class. Don't call this method directly. |
boolean |
getBooleanProperty(String key)
Reads the given property from the configuration and interprets it as a boolean. |
double |
getDoubleProperty(String key)
Reads the given property from the configuration and interprets it as a double. |
int |
getIntProperty(String key)
Reads the given property from the configuration and interprets it as an integer. |
long |
getLongProperty(String key)
Reads the given property from the configuration and interprets it as a long. |
String |
getPathProperty(String key)
Reads the given property from the configuration and interprets it as a path. |
Configuration |
getPropertiesStartingWith(String prefix)
Flattens the Properties hierarchies and returns a Configuration object containing only keys starting with the prefix. |
String |
getProperty(String key)
Deprecated. This method will not be removed (as this is for technical reasons not possible), but should only be used within this class. Don't call this method directly. |
String |
getProperty(String key,
String defaultValue)
Deprecated. This method will not be removed (as this is for technical reasons not possible), but should only be used within this class. Don't call this method directly. |
String[] |
getStringArrayProperty(String key)
Interprets the property (defined by the given key) as an array of values and transforms it into a real array. |
String[] |
getStringArrayProperty(String key,
String split)
Interprets the property (defined by the given key) as an array of values and transforms it into a real array. |
String |
getStringProperty(String key)
Reads the given property from the configuration and interprets it as a string. |
Object |
put(Object key,
Object value)
Deprecated. This method will not be removed (as this is for technical reasons not possible), but should only be used within this class. Don't call this method directly. |
void |
setDefaultConfiguration(Configuration defaultConfiguration)
You should know what you do if you use this method! Currently it is used for a (dirty) hack to add default configurations to Writers or AnalysisPlugins. |
void |
setStringArrayProperty(String key,
String[] value)
Sets a property to the given string array. |
static String |
toProperty(Object[] values)
Converts the Object[] to a String split by '|'. |
Methods inherited from class java.util.Properties |
---|
list, list, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, putAll, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Configuration()
public Configuration(Properties defaults)
defaults
- The property object which delivers the default values for the new configuration.Method Detail |
---|
public final String getStringProperty(String key)
key
- The key of the property.
public final boolean getBooleanProperty(String key)
key
- The key of the property.
public final int getIntProperty(String key)
key
- The key of the property.
public final long getLongProperty(String key)
key
- The key of the property.
public final double getDoubleProperty(String key)
key
- The key of the property.
public final String getPathProperty(String key)
key
- The key of the property.
public final String[] getStringArrayProperty(String key)
key
- The key of the property.
public final void setStringArrayProperty(String key, String[] value)
key
- The key of the property to changevalue
- The array to setpublic final String[] getStringArrayProperty(String key, String split)
split
- a regular expressionkey
- The key of the property.
toProperty(Object[])
public static final String toProperty(Object[] values)
values
- The values which will be transformed into a string.
getStringArrayProperty(String)
,
getStringArrayProperty(String, String)
public static final String convertToPath(String pathname)
pathname
- The path to be simplified.
public final Configuration getPropertiesStartingWith(String prefix)
prefix
- The prefix to be used during the flattening.
public final Configuration flatten(Configuration defaultConfiguration)
defaultConfiguration
- The configuration which will be used as a base.
public final Configuration flatten()
public final void flattenInPlace()
public final void setDefaultConfiguration(Configuration defaultConfiguration)
defaultConfiguration
- The default configuration for this configuration object.@Deprecated public final Object put(Object key, Object value)
Properties.setProperty(String, String)
instead!
put
in interface Map<Object,Object>
put
in class Hashtable<Object,Object>
key
- The key which will be used to store the given value.value
- The value to store.
@Deprecated public final Object get(Object key)
getStringProperty(String)
instead!
get
in interface Map<Object,Object>
get
in class Hashtable<Object,Object>
key
- The key for the value in question.
@Deprecated public final String getProperty(String key)
getStringProperty(String)
instead!
getProperty
in class Properties
key
- The key for the property in question.
@Deprecated public final String getProperty(String key, String defaultValue)
getProperty
in class Properties
key
- The key for the property in question.defaultValue
- The default value to be returned.
|
Kieker 1.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |