public class ConsolePresenter extends BasePresenter
Modification
s of a comparison run to the log. If used for a batch comparison
the presenter will print a summary for all compared documents at the end of the batch run.BasePresenter.ERROR_SOURCE
LOGGER, MAX_FILENAME_LENGTH
Constructor and Description |
---|
ConsolePresenter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canInformUserOnErrors()
Returns whether the presenter is able to handle errors in a way to notify the user.
|
ConsolePresenter |
configure(IProfile profile)
Configures the presenter according to a profile.
|
java.lang.String |
getExtensionName()
Returns the UNIQUE name of the extension.
|
void |
onComparisonDone()
Called to indicate that a comparison has finished.
|
void |
onError(ExceptionData error,
boolean interrupted,
BasePresenter.ERROR_SOURCE source)
Called in case of an error that occurred either in one of the parser threads or in the compare thread.
|
void |
onFinish()
OPTIONAL: Called in case of batch comparison at the end of all comparisons of the batch run.
|
void |
onInit()
Called at the time the document informations have been set.
|
void |
setLogWriter(java.io.PrintWriter writer)
Sets a writer to print the result to
|
void |
setMaxErrors(int maxErrors)
Sets the maximum number of errors to be displayed per comparison.
|
ConsolePresenter |
spawn(boolean spawnWithParent)
Creates another presenter of the the same type as the current one.
|
createExportFilename, detachFromModel, executeImmediately, getDefaultExportName, getLastPresenterException, getModel, getParent, getPresenterExceptions, onClear, onDataUpdate, onFilterChange, onProgressUpdate, setModel, setParent
public java.lang.String getExtensionName()
public void setLogWriter(java.io.PrintWriter writer)
writer
- the writer to print the result to, if null
the default logger will be usedpublic void onInit() throws java.lang.Exception
onInit
in class BasePresenter
java.lang.Exception
- thrown in case the processing of the init step failspublic ConsolePresenter configure(IProfile profile)
PDFCProperty.MAX_ERRORS_PER_FILE
from the profile.configure
in class BasePresenter
profile
- the profile to read from, must not be null
public void setMaxErrors(int maxErrors)
maxErrors
- the maximum number of Modification
public void onComparisonDone() throws java.lang.Exception
onComparisonDone
in class BasePresenter
java.lang.Exception
- thrown in case the processing of the finish step failspublic void onFinish()
PDFComparer.batchCompare(java.io.File, java.io.File)
method.onFinish
in class BasePresenter
public void onError(ExceptionData error, boolean interrupted, BasePresenter.ERROR_SOURCE source)
ResultModel
.onError
in class BasePresenter
error
- the exceptioninterrupted
- indicates whether the comparison was interrupted due to this exception. If true
there will be no further calls (e.g. onComparisonDone)source
- the source module of the exception.protected boolean canInformUserOnErrors()
canInformUserOnErrors
in class BasePresenter
true
of BasePresenter.onError(ExceptionData, boolean, ERROR_SOURCE)
will
directly inform the user.public ConsolePresenter spawn(boolean spawnWithParent)
spawn
in class BasePresenter
spawnWithParent
- if true, the presenter is allowed to keep a reference to it's parent to create a summary on onFinish()Copyright © 2010-2022 by i-net software GmbH