Class AbstractDocumentComparator

java.lang.Object
com.logicaldoc.comparison.AbstractDocumentComparator
All Implemented Interfaces:
DocumentComparator
Direct Known Subclasses:
BasicComparator, NotAvailableComparator, WorkShareComparator

public abstract class AbstractDocumentComparator extends Object implements DocumentComparator
Abstract comparator.
Since:
8.2.3
Author:
Marco Meschieri - LogicalDOC
  • Method Details

    • compare

      public final void compare(String sid, File original, File modified, File target) throws IOException, com.logicaldoc.core.parser.ParsingException
      Description copied from interface: DocumentComparator
      Performs the comparison
      Specified by:
      compare in interface DocumentComparator
      Parameters:
      sid - identifier of the session
      original - The original file
      modified - The modified file
      target - The comparison output as PDF file
      Throws:
      IOException - error writing the temporary files or in the comparison
      com.logicaldoc.core.parser.ParsingException - error in the parsing
    • compare

      public final void compare(String sid, com.logicaldoc.core.document.Version originalVersion, com.logicaldoc.core.document.Version modifiedVersion, File dest) throws IOException, com.logicaldoc.core.PersistenceException, com.logicaldoc.core.parser.ParsingException
      Description copied from interface: DocumentComparator
      Performs the comparison
      Specified by:
      compare in interface DocumentComparator
      Parameters:
      sid - The actual Session ID
      originalVersion - The original version
      modifiedVersion - The modified version
      dest - The comparison output as PDF file
      Throws:
      IOException - error writing the temporary files or in the comparison
      com.logicaldoc.core.PersistenceException - error at database level
      com.logicaldoc.core.parser.ParsingException - error in the parsing
    • loadParameters

      public void loadParameters()
      Description copied from interface: DocumentComparator
      Reads it's own parameters and stores them in the parameters map
      Specified by:
      loadParameters in interface DocumentComparator
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: DocumentComparator
      Checks if the comparator is enabled or not
      Specified by:
      isEnabled in interface DocumentComparator
      Returns:
      the enabled status
    • setEnabled

      public void setEnabled(boolean enabled)
      Description copied from interface: DocumentComparator
      Enables or disables the comparator
      Specified by:
      setEnabled in interface DocumentComparator
      Parameters:
      enabled - the new enabled status
    • getParameters

      public Map<String,String> getParameters()
      Description copied from interface: DocumentComparator
      Returns the map of parameters
      Specified by:
      getParameters in interface DocumentComparator
      Returns:
      map of parameters
    • getParameter

      public String getParameter(String name)
      Description copied from interface: DocumentComparator
      Gets the value of a parameter
      Specified by:
      getParameter in interface DocumentComparator
      Parameters:
      name - name of the parameter
      Returns:
      value of the configuration parameter
    • getParameterNames

      public List<String> getParameterNames()
      Description copied from interface: DocumentComparator
      Implementations should return the list of the required parameters. A parameter is stored in the context as comparator.SimpleClassName.parameter = value
      Specified by:
      getParameterNames in interface DocumentComparator
      Returns:
      the list of configuration parameters
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object