ch.elca.el4j.util.config
Class GenericConfig

java.lang.Object
  extended by ch.elca.el4j.util.config.GenericConfig
Direct Known Subclasses:
DefaultConfig, HierarchicalGenericConfig

public class GenericConfig
extends Object

The base class for generic configurations. It is a hierarchical structure of configuration entries, where entries can be added, inherited and overridden.

Author:
Stefan Wismer (SWI)
File-location:
GenericConfig
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Field Summary
protected  Map<String,Object> m_map
          The configuration entries that are added or override configurations declared in m_parentConfig.
 
Constructor Summary
GenericConfig()
          The default constructor, which creates an empty configuration.
 
Method Summary
 void add(String key, Object value)
           
 Object get(String key)
           
 Map<String,Object> getMap()
           
 void setMap(Map<String,Object> map)
           
 void setMap(Properties properties)
           
 void setOverrideMap(Map<String,Object> map)
           
 void setOverrideMap(Properties properties)
           
 void setParent(GenericConfig parent)
           
 void setParents(List<GenericConfig> parents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_map

protected Map<String,Object> m_map
The configuration entries that are added or override configurations declared in m_parentConfig.

Constructor Detail

GenericConfig

public GenericConfig()
The default constructor, which creates an empty configuration.

Method Detail

setParent

public void setParent(GenericConfig parent)
Parameters:
parent - the parent GenericConfig which configuration is inherited

setParents

public void setParents(List<GenericConfig> parents)
Parameters:
parents - the parent GenericConfigs which configuration is inherited

getMap

public Map<String,Object> getMap()
Returns:
a copy of all configuration entries declared in this config

setMap

public void setMap(Map<String,Object> map)
Parameters:
map - the configuration entries to set

setMap

public void setMap(Properties properties)
Parameters:
properties - the configuration entries to set

setOverrideMap

public void setOverrideMap(Map<String,Object> map)
Parameters:
map - the configuration entries to add to the current entries

setOverrideMap

public void setOverrideMap(Properties properties)
Parameters:
properties - the configuration entries to add

add

public void add(String key,
                Object value)
Parameters:
key - the key of the configuration entry to add
value - the value of the configuration entry to add

get

public Object get(String key)
Parameters:
key - the key of the configuration entry that should be returned
Returns:
the corresponding value or null if not found


Copyright © 2005-2011 ELCA. All Rights Reserved.