Package org.codehaus.cargo.module.merge
Class DocumentMerger
- java.lang.Object
-
- org.codehaus.cargo.module.merge.DocumentMerger
-
- All Implemented Interfaces:
MergeProcessor
public class DocumentMerger extends Object implements MergeProcessor
Class that can merge two DOM Documents, relatively simply. This works by just importing all the child nodes from the right-hand document into the left-hand document.
Create theDocumentMerger, then calladdMergeItemsuccessive times withDocuments. Finally callperformMerge(), which will return you the merged DOM Document.
This class may be overridden by subclasses that wish to apply strategies to particular types of XML document.
-
-
Constructor Summary
Constructors Constructor Description DocumentMerger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMergeItem(Object mergeItem)Add an item to be merged.ObjectperformMerge()Perform the merge.
-
-
-
Method Detail
-
addMergeItem
public void addMergeItem(Object mergeItem) throws MergeException
Add an item to be merged.- Specified by:
addMergeItemin interfaceMergeProcessor- Parameters:
mergeItem- in the item to merge.- Throws:
MergeException- on exceptions
-
performMerge
public Object performMerge()
Perform the merge.- Specified by:
performMergein interfaceMergeProcessor- Returns:
- the merged artifact
-
-