Package com.logicaldoc.comparison
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
-
-
Constructor Summary
Constructors Constructor Description AbstractDocumentComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompare(String sid, com.logicaldoc.core.document.Version originalVersion, com.logicaldoc.core.document.Version modifiedVersion, File dest)Performs the comparisonvoidcompare(String sid, File original, File modified, File target)Performs the comparisonbooleanequals(Object other)StringgetParameter(String name)Gets the value of a parameterList<String>getParameterNames()Implementations should return the list of the required parameters.Map<String,String>getParameters()Returns the map of parametersinthashCode()booleanisEnabled()Checks if the comparator is enabled or notvoidloadParameters()Reads it's own parameters and stores them in the parameters mapvoidsetEnabled(boolean enabled)Enables or disables the comparator
-
-
-
Method Detail
-
compare
public final void compare(String sid, File original, File modified, File target) throws IOException, com.logicaldoc.core.parser.ParseException
Description copied from interface:DocumentComparatorPerforms the comparison- Specified by:
comparein interfaceDocumentComparator- Parameters:
sid- identifier of the sessionoriginal- The original filemodified- The modified filetarget- The comparison output as PDF file- Throws:
IOException- error writing the temporary files or in the comparisoncom.logicaldoc.core.parser.ParseException- 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.ParseException
Description copied from interface:DocumentComparatorPerforms the comparison- Specified by:
comparein interfaceDocumentComparator- Parameters:
sid- The actual Session IDoriginalVersion- The original versionmodifiedVersion- The modified versiondest- The comparison output as PDF file- Throws:
IOException- error writing the temporary files or in the comparisoncom.logicaldoc.core.PersistenceException- error at database levelcom.logicaldoc.core.parser.ParseException- error in the parsing
-
loadParameters
public void loadParameters()
Description copied from interface:DocumentComparatorReads it's own parameters and stores them in the parameters map- Specified by:
loadParametersin interfaceDocumentComparator
-
isEnabled
public boolean isEnabled()
Description copied from interface:DocumentComparatorChecks if the comparator is enabled or not- Specified by:
isEnabledin interfaceDocumentComparator- Returns:
- the enabled status
-
setEnabled
public void setEnabled(boolean enabled)
Description copied from interface:DocumentComparatorEnables or disables the comparator- Specified by:
setEnabledin interfaceDocumentComparator- Parameters:
enabled- the new enabled status
-
getParameters
public Map<String,String> getParameters()
Description copied from interface:DocumentComparatorReturns the map of parameters- Specified by:
getParametersin interfaceDocumentComparator- Returns:
- map of parameters
-
getParameter
public String getParameter(String name)
Description copied from interface:DocumentComparatorGets the value of a parameter- Specified by:
getParameterin interfaceDocumentComparator- Parameters:
name- name of the parameter- Returns:
- value of the configuration parameter
-
getParameterNames
public List<String> getParameterNames()
Description copied from interface:DocumentComparatorImplementations should return the list of the required parameters. A parameter is stored in the context as comparator.SimpleClassName.parameter = value- Specified by:
getParameterNamesin interfaceDocumentComparator- Returns:
- the list of configuration parameters
-
-