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 the DocumentMerger, then call addMergeItem successive times
with Documents. Finally call performMerge(), 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.
- Version:
- $Id: DocumentMerger.java 1705 2008-09-02 13:14:55Z adriana $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentMerger
public DocumentMerger()
addMergeItem
public void addMergeItem(Object mergeItem)
throws MergeException
- Add an item to be merged.
- Specified by:
addMergeItem
in interface MergeProcessor
- Parameters:
mergeItem
- in the item to merge.
- Throws:
MergeException
- on exceptions- See Also:
MergeProcessor.addMergeItem(java.lang.Object)
performMerge
public Object performMerge()
- Perform the merge.
- Specified by:
performMerge
in interface MergeProcessor
- Returns:
- the merged artifact
- See Also:
MergeProcessor.performMerge()
Copyright © 2004-2012 Codehaus. All Rights Reserved.