Interface Mergeable
-
- All Known Implementing Classes:
AbstractMergeableElement
,AbstractMergeableElementList
,AbstractMergeableSupport
,ComponentElement
,ComponentsElement
,ComponentSetElement
,ConfigurationElement
,PlexusRootElement
,RequirementElement
,RequirementsElement
public interface Mergeable
Interface that marks an implementing entity as mergeable.Not all the elements/tags are expected to implement this interface.
It should be implemented by elements/tags that need to have a certain control on how elements of the same type are merged with them.- Author:
- Rahul Thakur
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DescriptorTag[]
getAllowedTags()
Returns an array of tags/elements that are allowed under the current element.org.jdom2.Element
getElement()
Returns the wrapped up JDomElement
instance that was used to create this Mergeable.void
merge(Mergeable me)
Merges an element of same type.void
merge(Mergeable me, MergeStrategy strategy)
Applies the passed inMergeStrategy
to merge twoMergeable
instance.
-
-
-
Method Detail
-
merge
void merge(Mergeable me) throws MergeException
Merges an element of same type.- Parameters:
me
- Another entity that is mergeable.- Throws:
MergeException
- if there was an error merging the mergeables.
-
merge
void merge(Mergeable me, MergeStrategy strategy) throws MergeException
Applies the passed inMergeStrategy
to merge twoMergeable
instance.- Parameters:
me
- RecessiveMergeable
instance.strategy
-MergeStrategy
to apply for merging.- Throws:
MergeException
- if there was an error while merging.
-
getElement
org.jdom2.Element getElement()
Returns the wrapped up JDomElement
instance that was used to create this Mergeable.- Returns:
- the wrapped up JDom
Element
instance.
-
getAllowedTags
DescriptorTag[] getAllowedTags()
Returns an array of tags/elements that are allowed under the current element.- Returns:
- the allowedTags
-
-