org.netbeans.modules.xml.xdm.visitor
Class MergeVisitor
java.lang.Object
org.netbeans.modules.xml.xdm.visitor.DefaultVisitor
org.netbeans.modules.xml.xdm.visitor.MergeVisitor
- All Implemented Interfaces:
- XMLNodeVisitor
public class MergeVisitor
- extends DefaultVisitor
This class provides a way to merge two trees. A merge is defined as taking a
tree and muting this tree (firing events) to cause the tree to be the same
as the target tree. This allows the original tree to retain nodes which have
not been changed. A change is defined as having both the same syntax and
semantics. The current tree model preserves spacing where appropriate, so
this requires comparing spacing as well as semantics.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MergeVisitor
public MergeVisitor()
merge
public void merge(XDMModel model,
Document newDoc)
- This method merges the currentModel and the given newDocument. Events
will be fired on currentModel.
- Parameters:
model - the model to merge the changes required to transform
the current document to something equivalent to newDocument.newDoc - to replicate in the current model.
visitNode
protected void visitNode(Node node)
- Overrides:
visitNode in class DefaultVisitor