Package com.deltaxml.msword
Interface WordCompare
public interface WordCompare
The entry point into the Word Compare Java API.
Call create() to obtain an instance.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddLicenseFile(File licenseFile) Adds a license file for use with Flexera licensing.voidaddLicenseServer(String hostname) Adds a license server (for use with a flexera license server).voidaddLicenseServer(String hostname, int port) Adds a license server and port (for use with a flexera license server).voidaddProgressListener(WordCompareProgressListener progressListener) Add a progress listener.voidClears all registered progress listeners.voidCompare two docx documents and write the comparison result to the given result file.voidCompare two docx documents and write the comparison result to the given result path.static WordComparecreate()Create the newWordCompareinstance.static WordComparecreate(net.sf.saxon.s9api.Processor saxonProcessor) Initialize a WordCompare instance, allows passing in a Saxon Processor.Get theImageConfigin use by thisWordCompare.Get theMovesConfigin use by thisWordCompare.Get theTableConfigin use by thisWordCompare.voidremoveProgressListener(WordCompareProgressListener progressListener) Remove a progress listener.voidsetDebugFiles(boolean debug) Sets whether to produce debug files for each filter.voidsetDebugFilesPrefix(String value) Sets what name to use for the folder containing debug files.voidsetImageConfig(ImageConfig imageConfig) Set theImageConfigin use by thisWordCompare.voidsetMovesConfig(MovesConfig movesConfig) Set theMovesConfigin use by thisWordCompare.voidsetTableConfig(TableConfig tableConfig) Set theTableConfigin use by thisWordCompare.
-
Method Details
-
create
Create the newWordCompareinstance.- Returns:
- the new
WordCompareinstance.
-
create
Initialize a WordCompare instance, allows passing in a Saxon Processor. Use this constructor if your application has a Saxon processor, and you want to share it with WordCompare.- Parameters:
saxonProcessor- A Saxon s9api processor.- Returns:
- the new
WordCompareinstance.
-
compare
void compare(File documentA, File documentB, File resultDocument) throws IOException, DeltaXMLException Compare two docx documents and write the comparison result to the given result file.- Parameters:
documentA- The first document to compare (the 'A' document)documentB- The second document to compare (the 'B' document)resultDocument- The comparison result as a '.docx' file which includes change tracking markup of the differences between the 'A' and 'B' documents- Throws:
IOException- when unable to read/write files.DeltaXMLException- when an error occurs during Word Comparison.
-
compare
void compare(Path documentA, Path documentB, Path resultDocument) throws IOException, DeltaXMLException Compare two docx documents and write the comparison result to the given result path.- Parameters:
documentA- The first document to compare (the 'A' document)documentB- The second document to compare (the 'B' document)resultDocument- The comparison result as a '.docx' file which includes change tracking markup of the differences between the 'A' and 'B' documents- Throws:
IOException- when unable to read/write files.DeltaXMLException- when an error occurs during Word Comparison.
-
setDebugFiles
void setDebugFiles(boolean debug) Sets whether to produce debug files for each filter.- Parameters:
debug- sets whether to produce debug files for each filter, default is false.
-
setDebugFilesPrefix
Sets what name to use for the folder containing debug files.- Parameters:
value- the string name of the folder that contains debug files
-
getTableConfig
TableConfig getTableConfig()Get theTableConfigin use by thisWordCompare. TheTableConfigcontains parameters that control how tables are handled and compared.- Returns:
- the active
TableConfigin use by thisWordCompare - See Also:
-
setTableConfig
Set theTableConfigin use by thisWordCompare. TheTableConfigcontains parameters that control how tables are handled and compared.- Parameters:
tableConfig- theTableConfigto use- Throws:
IllegalArgumentException- if passedTableConfigis null- See Also:
-
getImageConfig
ImageConfig getImageConfig()Get theImageConfigin use by thisWordCompare. TheImageConfigcontains parameters that control how images are handled and compared.- Returns:
- the active
ImageConfigin use by thisWordCompare - See Also:
-
setImageConfig
Set theImageConfigin use by thisWordCompare. TheImageConfigcontains parameters that control how images are handled and compared.- Parameters:
imageConfig- theImageConfigto use- Throws:
IllegalArgumentException- if passedImageConfigis null- See Also:
-
getMovesConfig
MovesConfig getMovesConfig()Get theMovesConfigin use by thisWordCompare. TheMovesConfigcontains parameters that control how moved paragraphs are handled and compared.- Returns:
- the active
MovesConfigin use by thisWordCompare - See Also:
-
setMovesConfig
Set theMovesConfigin use by thisWordCompare. TheMovesConfigcontains parameters that control how moved paragraphs are handled and compared.- Parameters:
movesConfig- theMovesConfigto use- Throws:
IllegalArgumentException- if passedMovesConfigis null- See Also:
-
addProgressListener
Add a progress listener. This adds a progress listener to the list of registered progress listeners. The same listener may be added more than once.- Parameters:
progressListener- the progress listener to add.
-
removeProgressListener
Remove a progress listener. This removes the first occurrence of the progress listener from the registered progress listener list.- Parameters:
progressListener- the progress listener to remove.
-
clearProgressListeners
void clearProgressListeners()Clears all registered progress listeners. -
addLicenseFile
void addLicenseFile(File licenseFile) throws com.deltaxml.licensing.LicenseSecurityException, IOException, com.deltaxml.licensing.LicenseException Adds a license file for use with Flexera licensing. This can be either simple server/named-user license file or a concurrent license file containing the USE_SERVER directive.- Parameters:
licenseFile- the FlexLM format license file- Throws:
com.deltaxml.licensing.LicenseSecurityException- if the file cannot be accessedIOException- if there are problems reading the filecom.deltaxml.licensing.LicenseException- if there is a problem using the license file
-
addLicenseServer
void addLicenseServer(String hostname) throws IllegalArgumentException, com.deltaxml.licensing.LicenseException Adds a license server (for use with a flexera license server).- Parameters:
hostname- of the license server host or its ip address- Throws:
com.deltaxml.licensing.LicenseException- if there is a problem using the license serverIllegalArgumentException
-
addLicenseServer
Adds a license server and port (for use with a flexera license server).- Parameters:
hostname- of the license server host or its ip addressport- the port number on the license server for the lmgrd- Throws:
IllegalArgumentException- if the port number is out of rangecom.deltaxml.licensing.LicenseException- if there is a problem using the license server
-