Class AdvancedCheckerRunner

java.lang.Object
chemaxon.structurechecker.BasicCheckerRunner
chemaxon.structurechecker.AdvancedCheckerRunner
All Implemented Interfaces:
CheckerRunner

@PublicApi public class AdvancedCheckerRunner extends BasicCheckerRunner
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 Details

  • Constructor Details

    • AdvancedCheckerRunner

      public AdvancedCheckerRunner(StructureCheckerConfigurationReader configurationReader)
      Constructs CheckerRunner with more advanced fixing capabilities.
      Parameters:
      configurationReader - the checker configuration
    • AdvancedCheckerRunner

      public AdvancedCheckerRunner(StructureCheckerConfigurationReader configurationReader, CheckerFixerFactory checkerFixerFactory)
      Constructs CheckerRunner with more advanced fixing capabilities.
      Parameters:
      configurationReader - the checker configuration
      checkerFixerFactory - the factory for fixers
    • AdvancedCheckerRunner

      public AdvancedCheckerRunner(List<StructureChecker> checkerList)
      Constructs CheckerRunner with more advanced fixing capabilities.
      Parameters:
      checkerList - the checker list
  • Method Details

    • fix

      public boolean fix(StructureCheckerResult result)
      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 interface CheckerRunner
      Overrides:
      fix in class BasicCheckerRunner
      Parameters:
      result - the checker result to fix
      Returns:
      true if the fix ended correctly false otherwise
    • fix

      protected boolean fix(StructureChecker checker, StructureCheckerResult result)
      Tries to fix the problem detected by the specified checker, or falls back to result based behavior. NOTE: if FixMode is different from FixMode.FIX, no fixing attempt will be performed.
      Parameters:
      checker - the checker that detected the problem
      result - the result of check
      Returns:
      true if problem is fixed
    • isFallBackToBasic

      protected boolean isFallBackToBasic()
      Returns true 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 FixMode FixMode.ASK will not be fixed. Runs multiple iterations for best fix results.
      Specified by:
      fix in interface CheckerRunner
      Overrides:
      fix in class BasicCheckerRunner
      Returns:
      true if the fix ended correctly false otherwise
    • checkAndWait

      public List<StructureCheckerResult> checkAndWait()
      Description copied from interface: CheckerRunner
      Executes all the checker instances on the given molecule and returns a List of StructureCheckerResult containing all the identified problems
      Specified by:
      checkAndWait in interface CheckerRunner
      Overrides:
      checkAndWait in class BasicCheckerRunner
      Returns:
      a List of StructureCheckerResult 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 interface CheckerRunner
      Overrides:
      check in class BasicCheckerRunner
    • setMolecule

      public void setMolecule(Molecule molecule)
      Description copied from interface: CheckerRunner
      Sets the molecule to be checked by the checkers
      Specified by:
      setMolecule in interface CheckerRunner
      Overrides:
      setMolecule in class BasicCheckerRunner
      Parameters:
      molecule - a Molecule instance to be checked
    • getMonitor

      protected StructureCheckerMonitor getMonitor()
      Returns the current monitor. For internal use only.
      Returns:
      the current monitor
    • setMonitor

      public void setMonitor(StructureCheckerMonitor monitor)
      Sets the monitor. For internal use only.
      Parameters:
      monitor - the new monitor