org.netbeans.modules.xml.xdm/1 1.19.0 1

org.netbeans.modules.xml.xdm.visitor
Class MergeVisitor

java.lang.Object
  extended by org.netbeans.modules.xml.xdm.visitor.DefaultVisitor
      extended by 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.


Constructor Summary
MergeVisitor()
           
 
Method Summary
 void merge(XDMModel model, Document newDoc)
          This method merges the currentModel and the given newDocument.
protected  void visitNode(Node node)
           
 
Methods inherited from class org.netbeans.modules.xml.xdm.visitor.DefaultVisitor
visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeVisitor

public MergeVisitor()
Method Detail

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

org.netbeans.modules.xml.xdm/1 1.19.0 1

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.