A Map based Configuration.
This implementation of the {@code Configuration} interface isinitialized with a {@code java.util.Map}. The methods of the {@code Configuration} interface are implemented on top of the content ofthis map. The following storage scheme is used:
Property keys are directly mapped to map keys, i.e. the {@code getProperty()} method directly performs a {@code get()} onthe map. Analogously, {@code setProperty()} or{@code addProperty()} operations write new data into the map. If a valueis added to an existing property, a {@code java.util.List} is created,which stores the values of this property.
An important use case of this class is to treat a map as a {@code Configuration} allowing access to its data through the richerinterface. This can be a bit problematic in some cases because the map may contain values that need not adhere to the default storage scheme used by typical configuration implementations, e.g. regarding lists. In such cases care must be taken when manipulating the data through the {@code Configuration} interface, e.g. by calling{@code addProperty()}; results may be different than expected.
The handling of list delimiters is a bit different for this configuration implementation: When a property of type String is queried, it is passed to the current {@link ListDelimiterHandler} which may generate multiple values.Note that per default a list delimiter handler is set which does not do any list splitting, so this feature is disabled. It can be enabled by setting a properly configured {@code ListDelimiterHandler} implementation, e.g. a{@link DefaultListDelimiterHandler} object.
Notice that list splitting is only performed for single string values. If a property has multiple values, the single values are not split even if they contain the list delimiter character.
As the underlying {@code Map} is directly used as store of the propertyvalues, the thread-safety of this {@code Configuration} implementationdepends on the map passed to the constructor.
Notes about type safety: For properties with multiple values this implementation creates lists of type {@code Object} and stores them. If a property is assignedanother value, the value is added to the list. This can cause problems if the map passed to the constructor already contains lists of other types. This should be avoided, otherwise it cannot be guaranteed that the application might throw {@code ClassCastException} exceptions later.
@author Emmanuel Bourg
@version $Id: MapConfiguration.java 1624601 2014-09-12 18:04:36Z oheger $
@since 1.1