@API(type=NOT_EXTENDABLE,
src=PUBLIC)
public interface DifferencePerformer
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.Modifier and Type | Method and Description |
---|---|
java.util.List<Difference> |
performDiff(java.io.Reader leftContentReader,
java.io.Reader rightContentReader,
java.io.Reader baseContentReader,
java.lang.String leftSystemId,
java.lang.String rightSystemId,
java.lang.String baseSystemId,
java.lang.String contentType,
DiffOptions diffOptions,
DiffProgressListener diffProgressListener)
Performs the diff operation between the resources represented by the three readers.
|
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.
|
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
\n
.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.Difference
objects.
If the resources are identical or the diff fails the list will be empty.
DiffOptions.isEnableHierarchicalDiff()
returns true)
then the returned list contains DifferenceParent
elements.DiffException
- If the diff operation fails or it is stopped before it finishes.java.util.List<Difference> performDiff(java.io.Reader leftContentReader, java.io.Reader rightContentReader, java.io.Reader baseContentReader, java.lang.String leftSystemId, java.lang.String rightSystemId, java.lang.String baseSystemId, java.lang.String contentType, DiffOptions diffOptions, DiffProgressListener diffProgressListener) throws java.io.IOException, CannotHandleException, DiffException
leftContentReader
- The first resource content reader. Cannot be null
.rightContentReader
- The second resource content reader.Cannot be null
.baseContentReader
- The content reader of the base resource to which
the other 2 resources are compared against. It can be leftSystemId
- The left resource URL as string. Can be null
if a system ID is not relevant.rightSystemId
- The right resource URL as string. Can be null
if a system ID is not relevant.baseSystemId
- The base resource URL as string. Can be null
when a system ID is not relevant.contentType
- The content type of the resources, constants from DiffContentTypes
.
It is used only when the diff algorithm takes into account the tokens of the language associated with the resources.
Can be null
when the used algorithm is not syntax aware.diffOptions
- The options used by the diff performer to perform the comparison.
Can be null
and that means a default set of options is used.diffProgressListener
- The DiffProgressListener
notified about the progress of the diff.
Can be null
when the diff progress doesn't need to be monitored.Difference
objects.java.io.IOException
- If an I/O exception occurs while handling the resource content readers.CannotHandleException
- When the algorithm cannot handle the documents
(most probably issues regarding the parsing of not well formed documents).DiffException
- If the diff operation fails or it is stopped before it finishes.void stop()
© Copyright Syncro Soft SRL 2002 - 2022. All rights reserved.