Package chemaxon.checkers.runner
Class AdvancedCheckerRunner
java.lang.Object
chemaxon.checkers.runner.BasicCheckerRunner
chemaxon.checkers.runner.AdvancedCheckerRunner
- All Implemented Interfaces:
CheckerRunner
CheckerRunner
implementation with advanced fixing capabilities.StructureFixer
selection is based on provided fixer class if
available, or falls back to StructureCheckerResult
based selection.Supports multiple iterations of checking and fixing for the best fixing efforts.
- Since:
- 5.7
-
Field Summary
Modifier and TypeFieldDescriptionprotected chemaxon.checkers.logger.StructureCheckerLogger
Fields inherited from class chemaxon.checkers.runner.BasicCheckerRunner
backgroundThread, molecule
-
Constructor Summary
ConstructorDescriptionAdvancedCheckerRunner
(ConfigurationReader configurationReader) ConstructsCheckerRunner
with more advanced fixing capabilities. -
Method Summary
Modifier and TypeMethodDescriptionvoid
check()
Invokes a background thread which will run all checkers on the given moleculeExecutes all the checker instances on the given molecule and returns aList
ofStructureCheckerResult
containing all the identified problemsboolean
fix()
Checks the structure, then fixes the problems based on configuration.
NOTE:FixMode
and fixerClassName from configuration is used to choose best fixer.boolean
fix
(StructureCheckerResult result) Fixes the given result based on the fixer defined for the checker.protected boolean
fix
(StructureChecker checker, StructureCheckerResult result) Tries to fix the problem detected by the specified checker, or falls back to result based behavior.protected chemaxon.checkers.logger.StructureCheckerLogger
Returns the current logger.protected boolean
Returnstrue
if runner should fall back to basic runner when preferred fix failed.void
setLogger
(chemaxon.checkers.logger.StructureCheckerLogger logger) Sets the logger.void
setMolecule
(Molecule molecule) Sets the molecule to be checked by the checkersMethods inherited from class chemaxon.checkers.runner.BasicCheckerRunner
addPropertyChangeListener, addPropertyChangeListener, cancel, convertResult, getChangeSupport, getCheckerConfiguration, getCheckerList, getCurrent, getCurrentCheckerName, getFixers, getIndex, getMolecule, getProgessLength, getResultList, getStrategy, isCanceled, isChecking, isDoodle, setCanceled, setChangeSupport, setCheckerList, setConfigurationReader, setDoodle, setIgnoreConfigurationErrors, setIndex, setResultList
-
Field Details
-
logger
protected chemaxon.checkers.logger.StructureCheckerLogger logger
-
-
Constructor Details
-
AdvancedCheckerRunner
ConstructsCheckerRunner
with more advanced fixing capabilities.- Parameters:
configurationReader
- the checker configuration
-
-
Method Details
-
fix
Fixes the given result based on the fixer defined for the checker. If fixer is not defined, the fixer with the highest priority associated to the error type of the result will be executed.- Specified by:
fix
in interfaceCheckerRunner
- Overrides:
fix
in classchemaxon.checkers.runner.BasicCheckerRunner
- Parameters:
result
- the checker result to fix- Returns:
- true if the fix ended correctly false otherwise
-
fix
Tries to fix the problem detected by the specified checker, or falls back to result based behavior. NOTE: ifFixMode
is different fromFixMode.FIX
, no fixing attempt will be performed.- Parameters:
checker
- the checker that detected the problemresult
- the result of check- Returns:
true
if problem is fixed
-
isFallBackToBasic
protected boolean isFallBackToBasic()Returnstrue
if runner should fall back to basic runner when preferred fix failed.- Returns:
true
if runner should fall back to basic runner when preferred fix failed- Since:
- 5.12
-
fix
public boolean fix()Checks the structure, then fixes the problems based on configuration.
NOTE:FixMode
and fixerClassName from configuration is used to choose best fixer. Checkers with FixModeFixMode.ASK
will not be fixed. Runs multiple iterations for best fix results.- Specified by:
fix
in interfaceCheckerRunner
- Overrides:
fix
in classchemaxon.checkers.runner.BasicCheckerRunner
- Returns:
- true if the fix ended correctly false otherwise
-
checkAndWait
Description copied from interface:CheckerRunner
Executes all the checker instances on the given molecule and returns aList
ofStructureCheckerResult
containing all the identified problems- Specified by:
checkAndWait
in interfaceCheckerRunner
- Overrides:
checkAndWait
in classchemaxon.checkers.runner.BasicCheckerRunner
- Returns:
- a
List
ofStructureCheckerResult
containing all the identified problem about the given molecule
-
check
public void check()Description copied from interface:CheckerRunner
Invokes a background thread which will run all checkers on the given molecule- Specified by:
check
in interfaceCheckerRunner
- Overrides:
check
in classchemaxon.checkers.runner.BasicCheckerRunner
-
setMolecule
Description copied from interface:CheckerRunner
Sets the molecule to be checked by the checkers- Specified by:
setMolecule
in interfaceCheckerRunner
- Overrides:
setMolecule
in classchemaxon.checkers.runner.BasicCheckerRunner
- Parameters:
molecule
- aMolecule
instance to be checked
-
getLogger
protected chemaxon.checkers.logger.StructureCheckerLogger getLogger()Returns the current logger. For internal use only.- Returns:
- the current logger
-
setLogger
public void setLogger(chemaxon.checkers.logger.StructureCheckerLogger logger) Sets the logger. For internal use only.- Parameters:
logger
- the new logger
-