Interface WordCompare


public interface WordCompare

The entry point into the Word Compare Java API.

Call create() to obtain an instance.

  • Method Details

    • create

      static WordCompare create()
      Create the new WordCompare instance.
      Returns:
      the new WordCompare instance.
    • create

      static WordCompare create(net.sf.saxon.s9api.Processor saxonProcessor)
      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 WordCompare instance.
    • 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

      void setDebugFilesPrefix(String value)
      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 the TableConfig in use by this WordCompare. The TableConfig contains parameters that control how tables are handled and compared.
      Returns:
      the active TableConfig in use by this WordCompare
      See Also:
    • setTableConfig

      void setTableConfig(TableConfig tableConfig)
      Set the TableConfig in use by this WordCompare. The TableConfig contains parameters that control how tables are handled and compared.
      Parameters:
      tableConfig - the TableConfig to use
      Throws:
      IllegalArgumentException - if passed TableConfig is null
      See Also:
    • getImageConfig

      ImageConfig getImageConfig()
      Get the ImageConfig in use by this WordCompare. The ImageConfig contains parameters that control how images are handled and compared.
      Returns:
      the active ImageConfig in use by this WordCompare
      See Also:
    • setImageConfig

      void setImageConfig(ImageConfig imageConfig)
      Set the ImageConfig in use by this WordCompare. The ImageConfig contains parameters that control how images are handled and compared.
      Parameters:
      imageConfig - the ImageConfig to use
      Throws:
      IllegalArgumentException - if passed ImageConfig is null
      See Also:
    • getMovesConfig

      MovesConfig getMovesConfig()
      Get the MovesConfig in use by this WordCompare. The MovesConfig contains parameters that control how moved paragraphs are handled and compared.
      Returns:
      the active MovesConfig in use by this WordCompare
      See Also:
    • setMovesConfig

      void setMovesConfig(MovesConfig movesConfig)
      Set the MovesConfig in use by this WordCompare. The MovesConfig contains parameters that control how moved paragraphs are handled and compared.
      Parameters:
      movesConfig - the MovesConfig to use
      Throws:
      IllegalArgumentException - if passed MovesConfig is null
      See Also:
    • addProgressListener

      void addProgressListener(WordCompareProgressListener progressListener)
      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

      void removeProgressListener(WordCompareProgressListener progressListener)
      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 accessed
      IOException - if there are problems reading the file
      com.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 server
      IllegalArgumentException
    • addLicenseServer

      void addLicenseServer(String hostname, int port) throws com.deltaxml.licensing.LicenseException
      Adds a license server and port (for use with a flexera license server).
      Parameters:
      hostname - of the license server host or its ip address
      port - the port number on the license server for the lmgrd
      Throws:
      IllegalArgumentException - if the port number is out of range
      com.deltaxml.licensing.LicenseException - if there is a problem using the license server