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
FieldsModifier and TypeFieldDescriptionprotected chemaxon.checkers.logger.StructureCheckerLoggerFields inherited from class chemaxon.checkers.runner.BasicCheckerRunner
backgroundThread, molecule -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedCheckerRunner(ConfigurationReader configurationReader) ConstructsCheckerRunnerwith more advanced fixing capabilities.AdvancedCheckerRunner(ConfigurationReader configurationReader, CheckerFixerFactory checkerFixerFactory) ConstructsCheckerRunnerwith more advanced fixing capabilities.AdvancedCheckerRunner(List<StructureChecker> checkerList) ConstructsCheckerRunnerwith more advanced fixing capabilities. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck()Invokes a background thread which will run all checkers on the given moleculeExecutes all the checker instances on the given molecule and returns aListofStructureCheckerResultcontaining all the identified problemsbooleanfix()Checks the structure, then fixes the problems based on configuration.
NOTE:FixModeand fixerClassName from configuration is used to choose best fixer.booleanfix(StructureCheckerResult result) Fixes the given result based on the fixer defined for the checker.protected booleanfix(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.StructureCheckerLoggerReturns the current logger.protected booleanReturnstrueif runner should fall back to basic runner when preferred fix failed.voidsetLogger(chemaxon.checkers.logger.StructureCheckerLogger logger) Sets the logger.voidsetMolecule(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
ConstructsCheckerRunnerwith more advanced fixing capabilities.- Parameters:
configurationReader- the checker configuration
-
AdvancedCheckerRunner
public AdvancedCheckerRunner(ConfigurationReader configurationReader, CheckerFixerFactory checkerFixerFactory) ConstructsCheckerRunnerwith more advanced fixing capabilities.- Parameters:
configurationReader- the checker configurationcheckerFixerFactory- the factory for fixers
-
AdvancedCheckerRunner
ConstructsCheckerRunnerwith more advanced fixing capabilities.- Parameters:
checkerList- the checker list
-
-
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:
fixin interfaceCheckerRunner- Overrides:
fixin 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: ifFixModeis different fromFixMode.FIX, no fixing attempt will be performed.- Parameters:
checker- the checker that detected the problemresult- the result of check- Returns:
trueif problem is fixed
-
isFallBackToBasic
protected boolean isFallBackToBasic()Returnstrueif runner should fall back to basic runner when preferred fix failed.- Returns:
trueif 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:FixModeand fixerClassName from configuration is used to choose best fixer. Checkers with FixModeFixMode.ASKwill not be fixed. Runs multiple iterations for best fix results.- Specified by:
fixin interfaceCheckerRunner- Overrides:
fixin classchemaxon.checkers.runner.BasicCheckerRunner- Returns:
- true if the fix ended correctly false otherwise
-
checkAndWait
Description copied from interface:CheckerRunnerExecutes all the checker instances on the given molecule and returns aListofStructureCheckerResultcontaining all the identified problems- Specified by:
checkAndWaitin interfaceCheckerRunner- Overrides:
checkAndWaitin classchemaxon.checkers.runner.BasicCheckerRunner- Returns:
- a
ListofStructureCheckerResultcontaining all the identified problem about the given molecule
-
check
public void check()Description copied from interface:CheckerRunnerInvokes a background thread which will run all checkers on the given molecule- Specified by:
checkin interfaceCheckerRunner- Overrides:
checkin classchemaxon.checkers.runner.BasicCheckerRunner
-
setMolecule
Description copied from interface:CheckerRunnerSets the molecule to be checked by the checkers- Specified by:
setMoleculein interfaceCheckerRunner- Overrides:
setMoleculein classchemaxon.checkers.runner.BasicCheckerRunner- Parameters:
molecule- aMoleculeinstance 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
-