Kieker 1.6

kieker.common.configuration
Class Configuration

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by kieker.common.configuration.Configuration
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public final class Configuration
extends Properties

A Configuration

Author:
Jan Waller
See Also:
Serialized Form

Constructor Summary
Configuration()
           
Configuration(Properties defaults)
           
 
Method Summary
static String convertToPath(String path)
          Tries to simplify a given filesystem path.
 Object get(Object key)
          Deprecated. 
 boolean getBooleanProperty(String key)
           
 int getIntProperty(String key)
           
 long getLongProperty(String key)
           
 String getPathProperty(String key)
           
 Configuration getPropertiesStartingWith(String prefix)
          Flattens the Properties hierarchies and returns an Configuration object containing only keys starting with the prefix.
 String getProperty(String key)
          Deprecated. 
 String getProperty(String key, String defaultValue)
          Deprecated. 
 String[] getStringArrayProperty(String key)
          Property values have to be split by '|'.
 String[] getStringArrayProperty(String key, String split)
          Property values have to be split by 'split'.
 String getStringProperty(String key)
           
 Object put(Object key, Object value)
          Deprecated. 
 void setDefaultConfiguration(Configuration defaultConfiguration)
          You should know what you do if you use this method! Currently it is used for a (dirty) hack to implement writers.
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

Configuration

public Configuration()

Configuration

public Configuration(Properties defaults)
Method Detail

getStringProperty

public final String getStringProperty(String key)

getBooleanProperty

public final boolean getBooleanProperty(String key)

getIntProperty

public final int getIntProperty(String key)

getLongProperty

public final long getLongProperty(String key)

getPathProperty

public final String getPathProperty(String key)

getStringArrayProperty

public final String[] getStringArrayProperty(String key)
Property values have to be split by '|'.

Parameters:
key -

getStringArrayProperty

public final String[] getStringArrayProperty(String key,
                                             String split)
Property values have to be split by 'split'.

Parameters:
split - a regular expression
key -

toProperty

public static final String toProperty(Object[] values)
Converts the Object[] to a String split by '|'.

Parameters:
values -

convertToPath

public static final String convertToPath(String path)
Tries to simplify a given filesystem path. E.g., test/../x/y/./z/a/../x -> x/y/z/x

Parameters:
path -
Returns:
a simplified path

getPropertiesStartingWith

public final Configuration getPropertiesStartingWith(String prefix)
Flattens the Properties hierarchies and returns an Configuration object containing only keys starting with the prefix.

Any implementation should probably be this: (where Configuration is the concrete class)

 public final Configuration getPropertiesStartingWith(final String prefix) {
        return (Configuration) getPropertiesStartingWith(new Configuration(), prefix);
 }
 

Parameters:
prefix -

setDefaultConfiguration

public final void setDefaultConfiguration(Configuration defaultConfiguration)
                                   throws IllegalAccessException
You should know what you do if you use this method! Currently it is used for a (dirty) hack to implement writers.

Parameters:
defaultConfiguration -
Throws:
IllegalAccessException

put

@Deprecated
public final Object put(Object key,
                                   Object value)
Deprecated. 

This method should never be used directly! Use Properties.setProperty(String, String) instead!

Specified by:
put in interface Map<Object,Object>
Overrides:
put in class Hashtable<Object,Object>

get

@Deprecated
public final Object get(Object key)
Deprecated. 

This method should never be used directly! Use getStringProperty(String) instead!

Specified by:
get in interface Map<Object,Object>
Overrides:
get in class Hashtable<Object,Object>

getProperty

@Deprecated
public final String getProperty(String key)
Deprecated. 

This method should never be used directly! Use getStringProperty(String) instead!

Overrides:
getProperty in class Properties

getProperty

@Deprecated
public final String getProperty(String key,
                                           String defaultValue)
Deprecated. 

This method should never be used directly!

Overrides:
getProperty in class Properties

Kieker 1.6

Copyright 2012 Kieker Project, http://kieker-monitoring.net