public class Comparer extends Object implements com.aspose.ms.System.IDisposable, Closeable
Represents main class that controls the documents comparison process.
Constructor and Description |
---|
Comparer(ComparerSettings settings)
Instantiates a new Comparer.
|
Comparer(InputStream document)
Initializes new instance of
Comparer class with source document stream. |
Comparer(InputStream document,
ComparerSettings settings)
Initializes new instance of
Comparer class with source document stream and ComparerSettings . |
Comparer(InputStream document,
LoadOptions loadOptions)
Initializes new instance of
Comparer with source document stream and LoadOptions . |
Comparer(InputStream document,
LoadOptions loadOptions,
ComparerSettings settings)
|
Comparer(Path filePath)
Initializes new instance of
Comparer class with source file path. |
Comparer(Path filePath,
ComparerSettings settings)
Initializes new instance of
Comparer class with source file path and ComparerSettings . |
Comparer(Path filePath,
LoadOptions loadOptions)
Initializes new instance of
Comparer with source file path and LoadOptions . |
Comparer(Path filePath,
LoadOptions loadOptions,
ComparerSettings settings)
|
Comparer(String filePath)
Initializes new instance of
Comparer class with source file path. |
Comparer(String filePath,
ComparerSettings settings)
Initializes new instance of
Comparer class with source file path and ComparerSettings . |
Comparer(String filePath,
LoadOptions loadOptions)
Initializes new instance of
Comparer with source file path and LoadOptions . |
Comparer(String filePath,
LoadOptions loadOptions,
ComparerSettings settings)
|
Modifier and Type | Method and Description |
---|---|
void |
add(InputStream... documents)
Adds document stream to comparison.
|
void |
add(InputStream document)
Adds document stream to comparison.
|
void |
add(InputStream document,
LoadOptions loadOptions)
Adds document stream to comparison with loading options specified.
|
void |
add(Path... filePaths)
Adds file to comparison.
|
void |
add(Path filePath)
Adds file to comparison.
|
void |
add(Path filePath,
LoadOptions loadOptions)
Adds file to comparison with loading options specified.
|
void |
add(String... filePaths)
Adds file to comparison.
|
void |
add(String filePath)
Adds file to comparison.
|
void |
add(String filePath,
LoadOptions loadOptions)
Adds file to comparison with loading options specified.
|
void |
applyChanges(OutputStream document,
ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
|
void |
applyChanges(OutputStream document,
SaveOptions saveOptions,
ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
|
void |
applyChanges(Path filePath,
ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
|
void |
applyChanges(Path filePath,
SaveOptions saveOptions,
ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
|
void |
applyChanges(String filePath,
ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
|
void |
applyChanges(String filePath,
SaveOptions saveOptions,
ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
|
void |
close() |
Path |
compare()
Compares documents without saving result with default options
|
Path |
compare(CompareOptions compareOptions)
Compares documents without saving result.
|
Path |
compare(OutputStream outputStream)
Compares documents and saves result to file stream
|
Path |
compare(OutputStream document,
CompareOptions compareOptions)
Compares documents and saves result to file stream
|
Path |
compare(OutputStream document,
SaveOptions saveOptions)
Compares documents and save result to file stream
|
Path |
compare(OutputStream outputStream,
SaveOptions saveOptions,
CompareOptions compareOptions)
Compares documents and saves result to a stream.
|
Path |
compare(Path filePath)
Compares documents and saves result to file path
|
Path |
compare(Path filePath,
CompareOptions compareOptions)
Compares documents and saves result to file path
|
Path |
compare(Path filePath,
SaveOptions saveOptions)
Compares documents and save result to file path
|
Path |
compare(Path filePath,
SaveOptions saveOptions,
CompareOptions compareOptions)
Compares documents and saves result to file path
|
Path |
compare(SaveOptions saveOptions,
CompareOptions compareOptions)
Compares documents without saving result.
|
Path |
compare(String filePath)
Compares documents and saves result to file path
|
Path |
compare(String filePath,
CompareOptions compareOptions)
Compares documents and saves result to file path
|
Path |
compare(String filePath,
SaveOptions saveOptions)
Compares documents and save result to file path
|
Path |
compare(String filePath,
SaveOptions saveOptions,
CompareOptions compareOptions)
Compares documents and saves result to file path
|
void |
dispose()
Releases resources.
|
ChangeInfo[] |
getChanges()
Gets list of changes between source and target file(s).
|
ChangeInfo[] |
getChanges(GetChangeOptions getChangeOptions)
Gets list of changes between source and target file(s).
|
String |
getResultString()
Get result string after comparison (For Text Comparison only).
|
Document |
getSource()
Source file that is being compared.
|
List<Document> |
getTargets()
List of target files to compare with source file.
|
public Comparer(ComparerSettings settings)
settings
- the settingspublic Comparer(InputStream document)
Initializes new instance of Comparer
class with source document stream.
document
- Source document streampublic Comparer(InputStream document, ComparerSettings settings)
Initializes new instance of Comparer
class with source document stream and ComparerSettings
.
document
- Source document streamsettings
- Settings for comparisonpublic Comparer(InputStream document, LoadOptions loadOptions)
Initializes new instance of Comparer
with source document stream and LoadOptions
.
document
- Source document streamloadOptions
- Load optionspublic Comparer(InputStream document, LoadOptions loadOptions, ComparerSettings settings)
Initializes new instance of Comparer
class with document stream, LoadOptions
and ComparerSettings
.
document
- Source document streamloadOptions
- Load optionssettings
- Settings for comparisonpublic Comparer(Path filePath)
Initializes new instance of Comparer
class with source file path.
filePath
- File pathpublic Comparer(Path filePath, ComparerSettings settings)
Initializes new instance of Comparer
class with source file path and ComparerSettings
.
filePath
- File patssettings
- Settings for comparisonpublic Comparer(Path filePath, LoadOptions loadOptions)
Initializes new instance of Comparer
with source file path and LoadOptions
.
filePath
- File pathloadOptions
- Load optionspublic Comparer(Path filePath, LoadOptions loadOptions, ComparerSettings settings)
Initializes new instance of Comparer
class with source file path, LoadOptions
and ComparerSettings
.
filePath
- File pathloadOptions
- Load optionssettings
- Settings for comparisonpublic Comparer(String filePath)
Initializes new instance of Comparer
class with source file path.
filePath
- File pathpublic Comparer(String filePath, ComparerSettings settings)
Initializes new instance of Comparer
class with source file path and ComparerSettings
.
filePath
- File patssettings
- Settings for comparisonpublic Comparer(String filePath, LoadOptions loadOptions)
Initializes new instance of Comparer
with source file path and LoadOptions
.
filePath
- File pathloadOptions
- Load optionspublic Comparer(String filePath, LoadOptions loadOptions, ComparerSettings settings)
Initializes new instance of Comparer
class with source file path, LoadOptions
and ComparerSettings
.
filePath
- File pathloadOptions
- Load optionssettings
- Settings for comparisonpublic final void add(InputStream... documents)
Adds document stream to comparison.
documents
- Compared documents streamspublic final void add(InputStream document)
Adds document stream to comparison.
document
- Compared document streampublic final void add(InputStream document, LoadOptions loadOptions)
Adds document stream to comparison with loading options specified.
document
- Compared document streamloadOptions
- Load optionspublic final void add(Path... filePaths)
Adds file to comparison.
filePaths
- Compared files pathspublic final void add(Path filePath)
Adds file to comparison.
filePath
- Compared file pathpublic final void add(Path filePath, LoadOptions loadOptions)
Adds file to comparison with loading options specified.
filePath
- Compared file pathloadOptions
- Load optionspublic final void add(String... filePaths)
Adds file to comparison.
filePaths
- Compared files pathspublic final void add(String filePath)
Adds file to comparison.
filePath
- Compared file pathpublic final void add(String filePath, LoadOptions loadOptions)
Adds file to comparison with loading options specified.
filePath
- Compared file pathloadOptions
- Load optionspublic final void applyChanges(OutputStream document, ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
document
- Result documentapplyChangeOptions
- Apply change optionspublic final void applyChanges(OutputStream document, SaveOptions saveOptions, ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
document
- Result documentsaveOptions
- Save optionsapplyChangeOptions
- Apply change optionspublic final void applyChanges(Path filePath, ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
filePath
- Result file pathapplyChangeOptions
- Apply change optionspublic final void applyChanges(Path filePath, SaveOptions saveOptions, ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
filePath
- Result file pathsaveOptions
- Save optionsapplyChangeOptions
- Apply change optionspublic final void applyChanges(String filePath, ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
filePath
- Result file pathapplyChangeOptions
- Apply change optionspublic final void applyChanges(String filePath, SaveOptions saveOptions, ApplyChangeOptions applyChangeOptions)
Accepts or rejects changes and applies them to resultant document.
filePath
- Result file pathsaveOptions
- Save optionsapplyChangeOptions
- Apply change optionspublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public final Path compare()
Compares documents without saving result with default options
public final Path compare(CompareOptions compareOptions)
Compares documents without saving result.
compareOptions
- Compare optionspublic final Path compare(OutputStream outputStream)
Compares documents and saves result to file stream
Note: In case return value is null, use data that was written into outputStream
outputStream
- Result document streamoutputStream
must be used. In some situations result file's extension can be changedpublic final Path compare(OutputStream document, CompareOptions compareOptions)
Compares documents and saves result to file stream
Note: In case return value is null, use data that was written into outputStream
document
- Result document streamcompareOptions
- Compare optionsoutputStream
must be used. In some situations result file's extension can be changedpublic final Path compare(OutputStream document, SaveOptions saveOptions)
Compares documents and save result to file stream
Note: In case return value is null, use data that was written into outputStream
document
- Result document streamsaveOptions
- Save optionsoutputStream
must be used. In some situations result file's extension can be changedpublic final Path compare(OutputStream outputStream, SaveOptions saveOptions, CompareOptions compareOptions)
Compares documents and saves result to a stream.
Note: In case return value is null, use data that was written into outputStream
outputStream
- Result document streamsaveOptions
- Save optionscompareOptions
- Compare optionsoutputStream
must be used. In some situations result file's extension can be changedpublic final Path compare(Path filePath)
Compares documents and saves result to file path
filePath
- Result document pathpublic final Path compare(Path filePath, CompareOptions compareOptions)
Compares documents and saves result to file path
filePath
- Result document file pathcompareOptions
- Compare optionspublic final Path compare(Path filePath, SaveOptions saveOptions)
Compares documents and save result to file path
filePath
- Result document file pathsaveOptions
- Save optionspublic final Path compare(Path filePath, SaveOptions saveOptions, CompareOptions compareOptions)
Compares documents and saves result to file path
filePath
- Result document file pathsaveOptions
- Save optionscompareOptions
- Compare optionspublic final Path compare(SaveOptions saveOptions, CompareOptions compareOptions)
Compares documents without saving result.
saveOptions
- Save optionscompareOptions
- Compare optionspublic final Path compare(String filePath)
Compares documents and saves result to file path
filePath
- Result document pathpublic final Path compare(String filePath, CompareOptions compareOptions)
Compares documents and saves result to file path
filePath
- Result document file pathcompareOptions
- Compare optionspublic final Path compare(String filePath, SaveOptions saveOptions)
Compares documents and save result to file path
filePath
- Result document file pathsaveOptions
- Save optionspublic final Path compare(String filePath, SaveOptions saveOptions, CompareOptions compareOptions)
Compares documents and saves result to file path
filePath
- Result document file pathsaveOptions
- Save optionscompareOptions
- Compare optionspublic final void dispose()
Releases resources.
dispose
in interface com.aspose.ms.System.IDisposable
public final ChangeInfo[] getChanges()
Gets list of changes between source and target file(s).
public final ChangeInfo[] getChanges(GetChangeOptions getChangeOptions)
Gets list of changes between source and target file(s).
getChangeOptions
- Get change optionspublic String getResultString()
public final Document getSource()
Source file that is being compared.