org.apache.excalibur.configuration.merged
Class ConfigurationMerger

java.lang.Object
  extended by org.apache.excalibur.configuration.merged.ConfigurationMerger

public class ConfigurationMerger
extends java.lang.Object

The ConfigurationMerger will take a Configuration object and layer it over another. It will use special attributes on the layer's children to control how children of the layer and base are combined. In order for a child of the layer to be merged with a child of the base, the following must hold true:

  1. The child in the layer Configuration has an attribute named phoenix-configuration:merge and its value is equal to a boolean TRUE
  2. There must be a single child in both the layer and base with the same getName() OR there exists an attribute named phoenix-configuration:key-attribute that names an attribute that exists on both the layer and base that can be used to match multiple children of the same getName()

Author:
Peter Royal
See Also:
ConfigurationSplitter

Constructor Summary
ConfigurationMerger()
           
 
Method Summary
static org.apache.avalon.framework.configuration.Configuration merge(org.apache.avalon.framework.configuration.Configuration layer, org.apache.avalon.framework.configuration.Configuration base)
          Merge two configurations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationMerger

public ConfigurationMerger()
Method Detail

merge

public static org.apache.avalon.framework.configuration.Configuration merge(org.apache.avalon.framework.configuration.Configuration layer,
                                                                            org.apache.avalon.framework.configuration.Configuration base)
                                                                     throws org.apache.avalon.framework.configuration.ConfigurationException
Merge two configurations.

Parameters:
layer - Configuration to layer over the base
base - Configuration layer will be merged with
Returns:
Result of merge
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if unable to merge


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.