OxygenXMLDiff 4.0 API

ro.sync.diff.api
Interface DifferencePerformer


public interface DifferencePerformer

The DifferencePerformer is used to compare two resources of a given content type using a set of options. The result of the diff is a list with the differences between the resources.


Method Summary
 java.util.List<Difference> performDiff(java.io.Reader leftContentReader, java.io.Reader rightContentReader, java.lang.String leftSystemId, java.lang.String rightSystemId, java.lang.String contentType, DiffOptions diffOptions, DiffProgressListener diffProgressListener)
          Performs the diff operation between the resources represented by the two readers.
 void stop()
          Signal to the diff performer that it must stop.
 

Method Detail

performDiff

java.util.List<Difference> performDiff(java.io.Reader leftContentReader,
                                       java.io.Reader rightContentReader,
                                       java.lang.String leftSystemId,
                                       java.lang.String rightSystemId,
                                       java.lang.String contentType,
                                       DiffOptions diffOptions,
                                       DiffProgressListener diffProgressListener)
                                       throws DiffException
Performs the diff operation between the resources represented by the two readers. The resources are compared taking into account the content type and the provided options.
Please note that the content of the readers will be processed before comparison and all end lines will be replaced with \n.

Parameters:
leftContentReader - The first resource content reader. It cannot be null.
rightContentReader - The second resource content reader. It cannot be null.
leftSystemId - The left resource URL as string. It can be null when a system ID is not relevant.
rightSystemId - The right resource URL as string. It can be null when a system ID is not relevant.
contentType - The content type of the two resources, constants from DiffContentTypes. It is used only when the diff algorithm takes into account the tokens of the language associated with the resources. It can be null when the used algorithm is not syntax aware.
diffOptions - The options used by the diff performer to perform the comparison. It can be null meaning a default set of options wil be used.
diffProgressListener - The DiffProgressListener notified about the progress of the diff. It can be null when the diff progress doesn't need to be monitored.
Returns:
The list with the differences. The differences are represented by Difference objects. If the resources are identical or the diff fails the list will be empty.
Throws:
DiffException - If the diff operation fails or it is stopped before it finishes.

stop

void stop()
Signal to the diff performer that it must stop.


OxygenXMLDiff 4.0 API

© Copyright SyncRO Soft SRL 2002 - 2011.