|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.configuration.PlexusConfigurationMerger
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:
phoenix-configuration:merge
and its value is equal to a boolean
TRUE
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()
Constructor Summary | |
PlexusConfigurationMerger()
|
Method Summary | |
private static void |
copyAttributes(PlexusConfiguration source,
DefaultPlexusConfiguration dest)
|
private static PlexusConfiguration |
getMergePartner(PlexusConfiguration toMerge,
PlexusConfiguration layer,
PlexusConfiguration base)
|
private static java.lang.String |
getValue(PlexusConfiguration layer,
PlexusConfiguration base)
|
static PlexusConfiguration[] |
match(PlexusConfiguration config,
java.lang.String element,
java.lang.String attribute)
Return all occurance of a configuration child containing the supplied attribute name. |
static PlexusConfiguration[] |
match(PlexusConfiguration config,
java.lang.String element,
java.lang.String attribute,
java.lang.String value)
Return occurance of a configuration child containing the supplied attribute name and value. |
static PlexusConfiguration |
merge(PlexusConfiguration layer,
PlexusConfiguration base)
Merge two configurations. |
private static void |
mergeChildren(PlexusConfiguration layer,
PlexusConfiguration base,
DefaultPlexusConfiguration merged)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlexusConfigurationMerger()
Method Detail |
public static PlexusConfiguration merge(PlexusConfiguration layer, PlexusConfiguration base) throws PlexusConfigurationException
layer
- Configuration to layer over the basebase
- Configuration layer will be merged with
PlexusConfigurationException
- if unable to mergeprivate static void mergeChildren(PlexusConfiguration layer, PlexusConfiguration base, DefaultPlexusConfiguration merged) throws PlexusConfigurationException
PlexusConfigurationException
private static PlexusConfiguration getMergePartner(PlexusConfiguration toMerge, PlexusConfiguration layer, PlexusConfiguration base)
private static java.lang.String getValue(PlexusConfiguration layer, PlexusConfiguration base)
private static void copyAttributes(PlexusConfiguration source, DefaultPlexusConfiguration dest) throws PlexusConfigurationException
PlexusConfigurationException
public static PlexusConfiguration[] match(PlexusConfiguration config, java.lang.String element, java.lang.String attribute)
config
- the configurationelement
- the name of child elements to select from the configurationattribute
- the attribute name to filter (null will match any attribute name)
public static PlexusConfiguration[] match(PlexusConfiguration config, java.lang.String element, java.lang.String attribute, java.lang.String value)
config
- the configurationelement
- the name of child elements to select from the configurationattribute
- the attribute name to filter (null will match any attribute name )value
- the attribute value to match (null will match any attribute value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |