org.apache.excalibur.configuration.merged
Class ConfigurationMerger
java.lang.Object
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:
- The child in the layer Configuration has an attribute named
phoenix-configuration:merge and its value is equal to a boolean TRUE
- 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:
- See Also:
ConfigurationSplitter
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfigurationMerger
public ConfigurationMerger()
merge
public static Configuration merge(Configuration layer,
Configuration base)
throws ConfigurationException
-
Merge two configurations.
-
- Parameters:
layer - Configuration to layer over the base
base - Configuration layer will be merged with
- Returns:
- Result of merge
- Throws:
ConfigurationException - if unable to merge
mergeChildren
private static void mergeChildren(Configuration layer,
Configuration base,
DefaultConfiguration merged)
throws ConfigurationException
-
- Throws:
ConfigurationException
getMergePartner
private static Configuration getMergePartner(Configuration toMerge,
Configuration layer,
Configuration base)
throws ConfigurationException
-
- Throws:
ConfigurationException
getValue
private static java.lang.String getValue(Configuration layer,
Configuration base)
-
copyAttributes
private static void copyAttributes(Configuration source,
DefaultConfiguration dest)
throws ConfigurationException
-
- Throws:
ConfigurationException
Please see keelframework.org for information about new Keel releases.