org.codehaus.plexus.cdc.merge.support

Interface Mergeable

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.

Version: $Id: Mergeable.java 3522 2006-07-12 15:06:21Z brett $

Author: Rahul Thakur

Method Summary
DescriptorTag[]getAllowedTags()
Returns an array of tags/elements that are allowed under the current element.
ElementgetElement()
Returns the wrapped up JDom Element instance that was used to create this Mergeable.
voidmerge(Mergeable me)
Merges an element of same type.
voidmerge(Mergeable me, MergeStrategy strategy)
Applies the passed in MergeStrategy to merge two Mergeable instance.

Method Detail

getAllowedTags

public DescriptorTag[] getAllowedTags()
Returns an array of tags/elements that are allowed under the current element.

Returns: the allowedTags

getElement

public Element getElement()
Returns the wrapped up JDom Element instance that was used to create this Mergeable.

Returns: the wrapped up JDom Element instance.

merge

public void merge(Mergeable me)
Merges an element of same type.

Parameters: me Another entity that is mergeable.

Throws: MergeException if there was an error merging the mergeables.

merge

public void merge(Mergeable me, MergeStrategy strategy)
Applies the passed in MergeStrategy to merge two Mergeable instance.

Parameters: me Recessive Mergeable instance. strategy MergeStrategy to apply for merging.

Throws: MergeException if there was an error while merging.

Copyright © 2001-2010 Codehaus. All Rights Reserved.