Package chemaxon.structurechecker
Class AdvancedCheckerRunner
java.lang.Object
chemaxon.structurechecker.BasicCheckerRunner
chemaxon.structurechecker.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
FieldsFields inherited from class chemaxon.structurechecker.BasicCheckerRunner
backgroundThread, molecule -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedCheckerRunner(StructureCheckerConfigurationReader configurationReader) ConstructsCheckerRunnerwith more advanced fixing capabilities.AdvancedCheckerRunner(StructureCheckerConfigurationReader 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 StructureCheckerMonitorReturns the current monitor.protected booleanReturnstrueif runner should fall back to basic runner when preferred fix failed.voidsetMolecule(Molecule molecule) Sets the molecule to be checked by the checkersvoidsetMonitor(StructureCheckerMonitor monitor) Sets the monitor.Methods inherited from class chemaxon.structurechecker.BasicCheckerRunner
addPropertyChangeListener, addPropertyChangeListener, cancel, convertResult, getCheckerConfiguration, getCheckerList, getCurrent, getCurrentCheckerName, getFixers, getMolecule, getProgessLength, getResultList, isChecking, setConfigurationReader, setIgnoreConfigurationErrors
-
Field Details
-
monitor
-
-
Constructor Details
-
AdvancedCheckerRunner
ConstructsCheckerRunnerwith more advanced fixing capabilities.- Parameters:
configurationReader- the checker configuration
-
AdvancedCheckerRunner
public AdvancedCheckerRunner(StructureCheckerConfigurationReader 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 classBasicCheckerRunner- 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 classBasicCheckerRunner- 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 classBasicCheckerRunner- 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 classBasicCheckerRunner
-
setMolecule
Description copied from interface:CheckerRunnerSets the molecule to be checked by the checkers- Specified by:
setMoleculein interfaceCheckerRunner- Overrides:
setMoleculein classBasicCheckerRunner- Parameters:
molecule- aMoleculeinstance to be checked
-
getMonitor
Returns the current monitor. For internal use only.- Returns:
- the current monitor
-
setMonitor
Sets the monitor. For internal use only.- Parameters:
monitor- the new monitor
-