Kieker 1.5

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
 boolean getBooleanProperty(String key)
           
 int getIntProperty(String key)
           
 long getLongProperty(String key)
           
 Configuration getPropertiesStartingWith(String prefix)
          Flattens the Properties hierarchies and returns an Configuration object containing only keys starting with the prefix.
 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 '|'.
static String toProperty(String[] values)
          Converts the String[] to a String split by '|'.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, 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, get, 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)

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(String[] values)
Converts the String[] to a String split by '|'.

Parameters:
values -

toProperty

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

Parameters:
values -

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(null), 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>

Kieker 1.5

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