Interface HTMLCompare


public interface HTMLCompare

The entry point into the HTML Compare Java API.

Call create() to obtain an instance.

  • Field Details

    • HTML_COMPARE_CONFIG_NAMESPACE

      static final String HTML_COMPARE_CONFIG_NAMESPACE
      XML Namespace used by the HTML Compare configuration file.
      See Also:
  • Method Details

    • create

      Create a new HTMLCompare instance.
      Returns:
      the new HTMLCompare instance.
      Throws:
      HTMLCompareInitializationException
    • compare

      This method compares two InputSource and writes the result in XHTML format to a StreamResult.
      Parameters:
      inputA - The InputSource for the "A" input.
      inputB - The InputSource for the "B" input.
      output - The StreamResult that the result will be written to.
      Throws:
      IOException - if there was a problem reading the inputs or writing the comparison result.
      HTMLCompareException - if an HTML Compare specific error occurs.
      com.deltaxml.licensing.LicenseException - when the license cannot be read or is not valid
      ParserException - when there is a problem creating/configuring an XML parser
      FilterException - when an error occurs running a filter in the pipeline
      DifferentRootElementException - if the two input Files have different roots
      InvalidInputException - if an input file is not in the correct format
      InputLoadException - when there is a problem loading an input File
      ComparisonCancelledException - if a comparison is cancelled by some cancellation policy
      SerializationException - when there is a problem writing the result File
    • compare

      This method compares two File and writes the result in XHTML format to another File.
      Parameters:
      inputA - The File for the "A" input.
      inputB - The File for the "B" input.
      output - The File that the result wil be written to.
      Throws:
      IOException - if there was a problem reading the inputs or writing the comparison result.
      HTMLCompareException - if an HTML Compare specific error occurs.
      com.deltaxml.licensing.LicenseException - when the license cannot be read or is not valid
      ParserException - when there is a problem creating/configuring an XML parser
      FilterException - when an error occurs running a filter in the pipeline
      DifferentRootElementException - if the two input Files have different roots
      InvalidInputException - if an input file is not in the correct format
      InputLoadException - when there is a problem loading an input File
      ComparisonCancelledException - if a comparison is cancelled by some cancellation policy
      SerializationException - when there is a problem writing the result File
    • 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.
    • getDebugFiles

      boolean getDebugFiles()

      Gets whether the production of debug files is on or not.

      Returns:
      whether the production of debug files is on or not.
      See Also:
    • setDebugFilesPrefix

      void setDebugFilesPrefix(String debugFolderName)
      Sets what name to use for the folder containing debug files.
      Parameters:
      debugFolderName - the string name of the folder that contains debug files
    • getDebugFilesPrefix

      String getDebugFilesPrefix()
      Get the current prefix used for debug result files.
      Returns:
      the current prefix used for debug result files.
      See Also:
    • getEntityResolver

      EntityResolver getEntityResolver()

      Gets the explicitly set EntityResolver in use by the comparison.

      Returns:
      the explicitly set EntityResolver in use by the comparison.
    • getEntityResolver

      EntityResolver getEntityResolver(boolean builtInResolver)

      Gets the EntityResolver in use by the comparison.

      Parameters:
      builtInResolver - Whether to get the built-in resolver (with any explicit enhancement), or just the explicitly set resolver.
      Returns:
      the explicitly set EntityResolver in use by the comparison.
    • setEntityResolver

      void setEntityResolver(EntityResolver resolver, boolean fallbackToDefaultCatalogResolver)

      Sets the EntityResolver to use during the comparison.

      By default, the Apache Commons Resolver is used as an EntityResolver. If you wish to use a different one, set it up using this method. Note you can turn off the default catalog support by providing a null resolver and setting the fallbackToDefaultCatalogResolver to false.

      Parameters:
      resolver - The resolver to use. Using null removes an existing resolver.
      fallbackToDefaultCatalogResolver - Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the entity.
    • getURIResolver

      URIResolver getURIResolver()

      Gets the explicitly set URIResolver in use by the comparison.

      Returns:
      the explicitly set URIResolver in use by the comparison.
    • getURIResolver

      URIResolver getURIResolver(boolean builtInResolver)

      Gets the URIResolver in use by the comparison.

      Parameters:
      builtInResolver - Whether to get the built-in resolver (with any explicit enhancement), or just the explicitly set resolver.
      Returns:
      the explicitly set URIResolver in use by the comparison.
    • setURIResolver

      void setURIResolver(URIResolver resolver, boolean fallbackToDefaultCatalogResolver)

      Sets the URIResolver to use during the comparison.

      By default, the Apache Commons Resolver is used as a URIResolver. If you wish to use a different one, set it up using this method. Note you can turn off the default catalog support by providing a null resolver and setting the fallbackToDefaultCatalogResolver to false.

      Parameters:
      resolver - The resolver to use. Using null removes an existing resolver.
      fallbackToDefaultCatalogResolver - Sets whether to use the inbuilt catalog resolver if the provided resolver fails to resolve the URI.
    • addHTMLCompareProgressListener

      void addHTMLCompareProgressListener(HTMLCompareProgressListener listener)
      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:
      listener - the progress listener to add.
    • removeHTMLCompareProgressListener

      void removeHTMLCompareProgressListener(HTMLCompareProgressListener listener)
      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:
      listener - the progress listener to add.
    • clearHTMLCompareProgressListener

      void clearHTMLCompareProgressListener()
      Clears all registered progress listeners.
    • addLicenseFile

      void addLicenseFile(File licenseFile) throws com.deltaxml.licensing.LicenseSecurityException, IOException, com.deltaxml.licensing.LicenseException
      Adds the 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 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
    • addLicenseServer

      void addLicenseServer(String hostname, int port) throws IllegalArgumentException, 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
    • getComparisonTypeConfiguration

      ComparisonTypeConfiguration getComparisonTypeConfiguration()
      Get the current ComparisonTypeConfiguration in use by this HTMLCompare.
      Returns:
      the current ComparisonTypeConfiguration
    • setComparisonTypeConfiguration

      void setComparisonTypeConfiguration(ComparisonTypeConfiguration comparisonTypeConfiguration)
      Set the ComparisonTypeConfiguration to be used by this HTMLCompare.
      Parameters:
      comparisonTypeConfiguration - the new ComparisonTypeConfiguration to be used.
    • getFormattingConfiguration

      FormattingConfiguration getFormattingConfiguration()
      Get the current FormattingConfiguration in use by this HTMLCompare.
      Returns:
      the current FormattingConfiguration
    • setFormattingConfiguration

      void setFormattingConfiguration(FormattingConfiguration formattingConfiguration)
      Set the FormattingConfiguration to be used by this HTMLCompare.
      Parameters:
      formattingConfiguration - the new FormattingConfiguration to be used.
    • getTableConfiguration

      TableConfiguration getTableConfiguration()
      Get the current TableConfiguration in use by this HTMLCompare.
      Returns:
      the current TableConfiguration
    • setTableConfiguration

      void setTableConfiguration(TableConfiguration tableConfiguration)
      Set the TableConfiguration to be used by this HTMLCompare.
      Parameters:
      tableConfiguration - the new TableConfiguration to be used.
    • getMathMLConfiguration

      MathMLConfiguration getMathMLConfiguration()
      Get the current MathMLConfiguration in use by this HTMLCompare.
      Returns:
      the current MathMLConfiguration
    • setMathMLConfiguration

      void setMathMLConfiguration(MathMLConfiguration mathMLConfiguration)
      Set the MathMLConfiguration to be used by this HTMLCompare.
      Parameters:
      mathMLConfiguration - the new MathMLConfiguration to be used.
    • getSvgConfiguration

      SvgConfiguration getSvgConfiguration()
      Get the current SvgConfiguration in use by this HTMLCompare.
      Returns:
      the current SvgConfiguration
    • setSvgConfiguration

      void setSvgConfiguration(SvgConfiguration svgConfiguration)
      Set the SvgConfiguration to be used by this HTMLCompare.
      Parameters:
      svgConfiguration - the new SvgConfiguration to be used.
    • getHtmlConfiguration

      HTMLConfiguration getHtmlConfiguration()
      Get the current HTMLConfiguration in use by this HTMLCompare.
      Returns:
      the current HTMLConfiguration
    • setHtmlConfiguration

      void setHtmlConfiguration(HTMLConfiguration htmlConfiguration)
      Set the HTMLConfiguration to be used by this HTMLCompare.
      Parameters:
      htmlConfiguration - the new HTMLConfiguration to be used.
    • getImageConfiguration

      ImageConfiguration getImageConfiguration()
      Get the current ImageConfiguration in use by this HTMLCompare.
      Returns:
      the current ImageConfiguration
    • setImageConfiguration

      void setImageConfiguration(ImageConfiguration imageConfiguration)
      Set the ImageConfiguration to be used by this HTMLCompare.
      Parameters:
      imageConfiguration - the new ImageConfiguration to be used.