The following interface is available for calling the XML diff processor from a custom Java
- ro.sync.diff.api.DifferencePerformer - It compares two resources of a
given content type using a set of options. It has the following methods:
- performDiff - Perform a diff operation between the two specified
resources. It returns a list with the differences. The parameters are the following:
- leftContentReader - A value of type java.io.Reader that provides the content of the first resource.
- rightContentReader - A value of type java.io.Reader that provides the content of the second resource.
- leftSystemId - A string value that is the location of the first resource.
- rightSystemId - A string value that is the location of the second resource
- contentType - A constant from the ro.sync.diff.api.DiffContentTypes interface.
- diffOptions - The user options like algorithm strength, ignore whitespaces, ignore comments, merge adjacent differences, etc. It is a value of type ro.sync.diff.api.DiffOptions.
- diffProgressListener - An object that will be notified about the progress of the diff operation. It is a value of type ro.sync.diff.api.DiffProgressListener.
- stop - Signal to the diff performer that it must stop.
An example of this interface can be found in the class
ro.sync.diff.api.sample.DiffXMLFilesSample which is included in the XML Diff SDK.