org.codehaus.plexus.metadata.merge.support

## Class AbstractMergeableElement

- java.lang.Object
- - org.codehaus.plexus.metadata.merge.support.AbstractMergeableSupport
  - - org.codehaus.plexus.metadata.merge.support.AbstractMergeableElement

All Implemented Interfaces:
  Mergeable

Direct Known Subclasses:
  AbstractMergeableElementList, ComponentElement, ComponentSetElement, ConfigurationElement, PlexusRootElement, RequirementElement

    public abstract class AbstractMergeableElement
    extends AbstractMergeableSupport

Version:
  $Id: AbstractMergeableElement.java 7689 2008-08-23 16:09:20Z jvanzyl $
Author:
  Rahul Thakur

### Field Summary

### Fields inherited from class org.codehaus.plexus.metadata.merge.support.AbstractMergeableSupport

`element`

### Constructor Summary

Constructors
Constructor and Description
`AbstractMergeableElement(org.jdom.Element element)`

### Method Summary

Methods
`protected boolean` `isRecessiveElementInConflict(AbstractMergeableElement re, java.util.List eltNameList)` Detects if there was a conflict, that is the specified element was present in both dominant and recessive element-sets.
`protected boolean` `isRecessiveElementInConflict(AbstractMergeableElement re, java.lang.String eltName)` Deprecated. use `isRecessiveElementInConflict(AbstractMergeableElement,List)` instead.
`void` `merge(Mergeable me)` Merges an element of same type.
`void` `merge(Mergeable me, MergeStrategy strategy)` Simply delegate to
`protected boolean` `mergeableElementComesFromRecessive(AbstractMergeableElement re, java.lang.String eltName)` Determines if the Element to be merged is to be sourced from Recessive Element set.

### Methods inherited from class org.codehaus.plexus.metadata.merge.support.AbstractMergeableSupport

`addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, detach, equals, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDefaultMergeStrategy, getDescendants, getDescendants, getDocument, getElement, getElementNamesForConflictResolution, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getParent, getParentElement, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, hashCode, indexOf, isAncestor, isExpectedElementType, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.codehaus.plexus.metadata.merge.support.Mergeable

`getAllowedTags`

### Constructor Detail

#### AbstractMergeableElement

    public AbstractMergeableElement(org.jdom.Element element)

### Method Detail

#### isRecessiveElementInConflict

    protected boolean isRecessiveElementInConflict(AbstractMergeableElement re,
                                       java.lang.String eltName)

Deprecated. use `isRecessiveElementInConflict(AbstractMergeableElement,List)` instead.
Detects if there was a conflict, that is the specified element was present in both dominant and recessive element-sets.

This delegates to `isRecessiveElementInConflict(AbstractMergeableElement,List)`.

Parameters:
  `re` - Recessive element.
  `eltName` - Element name to test for.
Returns:
  `true` if there was a conflict of element.

#### isRecessiveElementInConflict

    protected boolean isRecessiveElementInConflict(AbstractMergeableElement re,
                                       java.util.List eltNameList)

Detects if there was a conflict, that is the specified element was present in both dominant and recessive element-sets.

Use this to determine conflicts when the Dominant and Recessive element sets are keyed with Composite keys.
For instance: `<component>` is keyed on `<role>` and `<role-hint>`.

Parameters:
  `re` -
  `eltNameList` - List of elements that will be checked for values in both dominant and recessive sets.
Returns:

#### mergeableElementComesFromRecessive

    protected boolean mergeableElementComesFromRecessive(AbstractMergeableElement re,
                                             java.lang.String eltName)

Determines if the Element to be merged is to be sourced from Recessive Element set.

Parameters:
  `re` - Recessive element.
  `eltName` - Element name to test for.
Returns:

#### merge

    public void merge(Mergeable me,
             MergeStrategy strategy)
               throws MergeException

Simply delegate to

Parameters:
  `me` - Recessive `Mergeable` instance.
  `strategy` - `MergeStrategy` to apply for merging.
Throws:
  `MergeException` - if there was an error while merging.
See Also:
  `Mergeable.merge(Mergeable,org.codehaus.plexus.metadata.merge.MergeStrategy)`

#### merge

    public void merge(Mergeable me)
               throws MergeException

Description copied from interface: `Mergeable`
Merges an element of same type.

Specified by:
  `merge` in interface `Mergeable`
Specified by:
  `merge` in class `AbstractMergeableSupport`
Parameters:
  `me` - Another entity that is mergeable.
Throws:
  `MergeException` - if there was an error merging the mergeables.