LibreOffice Module xmerge (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
org.openoffice.xmerge.merger.merge.DocumentMerge Class Reference

This is an implementation of the MergeAlgorithm interface. More...

Inheritance diagram for org.openoffice.xmerge.merger.merge.DocumentMerge:
[legend]
Collaboration diagram for org.openoffice.xmerge.merger.merge.DocumentMerge:
[legend]

Public Member Functions

 DocumentMerge (ConverterCapabilities cc, NodeMergeAlgorithm merge)
 Constructor. More...
 
void applyDifference (Iterator orgSeq, Iterator modSeq, Difference[] differences) throws MergeException
 This method is to merge the difference to an Iterator. More...
 
void applyDifference (Iterator orgSeq, Iterator modSeq, Difference[] differences) throws MergeException
 This method is to merge the difference to an Iterator. More...
 

Protected Member Functions

void removeNode (Node node)
 Removes the specified Node. More...
 

Protected Attributes

ConverterCapabilities cc_
 The capabilities of this converter. More...
 

Private Member Functions

void appendNode (Node oldNode, Node newNode)
 Appends Node after the specified Node. More...
 
void insertNode (Node oldNode, Node newNode)
 Insert Node before the specified Node. More...
 
void replaceElement (Element currElem, Element newElem)
 Replace Element. More...
 

Private Attributes

final NodeMergeAlgorithm subDocumentMerge
 

Detailed Description

This is an implementation of the MergeAlgorithm interface.

This class will merge two Document classes. It utilizes the appropriate class which implements NodeMergeAlgorithm to perform the merge.

Definition at line 40 of file DocumentMerge.java.

Constructor & Destructor Documentation

◆ DocumentMerge()

org.openoffice.xmerge.merger.merge.DocumentMerge.DocumentMerge ( ConverterCapabilities  cc,
NodeMergeAlgorithm  merge 
)
inline

Constructor.

Parameters
ccThe ConverterCapabilities.
mergeThe NodeMergeAlgorithm.

Definition at line 53 of file DocumentMerge.java.

References org.openoffice.xmerge.merger.merge.DocumentMerge.cc_, and org.openoffice.xmerge.merger.merge.DocumentMerge.subDocumentMerge.

Member Function Documentation

◆ appendNode()

void org.openoffice.xmerge.merger.merge.DocumentMerge.appendNode ( Node  oldNode,
Node  newNode 
)
inlineprivate

Appends Node after the specified Node.

Parameters
oldNodeNode to append after.
newNodeNode to append.

Definition at line 188 of file DocumentMerge.java.

References org.openoffice.xmerge.util.XmlUtil.deepClone().

Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference().

◆ applyDifference()

void org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference ( Iterator  orgSeq,
Iterator  modSeq,
Difference[]  differences 
) throws MergeException
inline

This method is to merge the difference to an Iterator.

The original Iterator will be modified after the call.

Parameters
orgSeqThe original sequence which the difference will be applied. It will be modified.
modSeqThe modified sequence where the difference content will be extracted.
differencesThe Difference array.
Exceptions
MergeExceptionIf an error occurs during the merge.

Implements org.openoffice.xmerge.merger.MergeAlgorithm.

Definition at line 58 of file DocumentMerge.java.

References org.openoffice.xmerge.merger.Difference.ADD, org.openoffice.xmerge.merger.merge.DocumentMerge.appendNode(), org.openoffice.xmerge.merger.Difference.CHANGE, org.openoffice.xmerge.merger.Difference.DELETE, org.openoffice.xmerge.merger.merge.DocumentMerge.insertNode(), org.openoffice.xmerge.merger.NodeMergeAlgorithm.merge(), org.openoffice.xmerge.merger.merge.DocumentMerge.removeNode(), org.openoffice.xmerge.merger.merge.DocumentMerge.replaceElement(), and org.openoffice.xmerge.merger.merge.DocumentMerge.subDocumentMerge.

Referenced by org.openoffice.xmerge.converter.xml.xslt.DocumentMergerImpl.merge().

◆ insertNode()

void org.openoffice.xmerge.merger.merge.DocumentMerge.insertNode ( Node  oldNode,
Node  newNode 
)
inlineprivate

Insert Node before the specified Node.

Parameters
oldNodeNode to insert before.
newNodeNode to insert.

Definition at line 200 of file DocumentMerge.java.

References org.openoffice.xmerge.util.XmlUtil.deepClone().

Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference().

◆ removeNode()

void org.openoffice.xmerge.merger.merge.DocumentMerge.removeNode ( Node  node)
inlineprotected

Removes the specified Node.

Parameters
nodeNode to remove.

Reimplemented in org.openoffice.xmerge.merger.merge.SheetMerge.

Definition at line 176 of file DocumentMerge.java.

Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference().

◆ replaceElement()

void org.openoffice.xmerge.merger.merge.DocumentMerge.replaceElement ( Element  currElem,
Element  newElem 
)
inlineprivate

Replace Element.

Parameters
currElemElement to be replaced.
newElemElement to replace.

Definition at line 212 of file DocumentMerge.java.

References org.openoffice.xmerge.util.XmlUtil.deepClone().

Referenced by org.openoffice.xmerge.merger.merge.DocumentMerge.applyDifference().

Member Data Documentation

◆ cc_

ConverterCapabilities org.openoffice.xmerge.merger.merge.DocumentMerge.cc_
protected

◆ subDocumentMerge

final NodeMergeAlgorithm org.openoffice.xmerge.merger.merge.DocumentMerge.subDocumentMerge
private

The documentation for this class was generated from the following file: