Class AdvancedCheckerRunner

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

@PublicApi public class AdvancedCheckerRunner extends chemaxon.checkers.runner.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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected chemaxon.checkers.logger.StructureCheckerLogger
     

    Fields inherited from class chemaxon.checkers.runner.BasicCheckerRunner

    backgroundThread, molecule
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs CheckerRunner with more advanced fixing capabilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invokes a background thread which will run all checkers on the given molecule
    Executes all the checker instances on the given molecule and returns a List of StructureCheckerResult containing all the identified problems
    boolean
    fix()
    Checks the structure, then fixes the problems based on configuration.
    NOTE: FixMode and fixerClassName from configuration is used to choose best fixer.
    boolean
    Fixes the given result based on the fixer defined for the checker.
    protected boolean
    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
    Returns true if runner should fall back to basic runner when preferred fix failed.
    void
    setLogger(chemaxon.checkers.logger.StructureCheckerLogger logger)
    Sets the logger.
    void
    Sets the molecule to be checked by the checkers

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected chemaxon.checkers.logger.StructureCheckerLogger logger
  • Constructor Details

    • AdvancedCheckerRunner

      public AdvancedCheckerRunner(ConfigurationReader configurationReader)
      Constructs CheckerRunner with more advanced fixing capabilities.
      Parameters:
      configurationReader - the checker configuration
  • 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 chemaxon.checkers.runner.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 chemaxon.checkers.runner.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 chemaxon.checkers.runner.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 chemaxon.checkers.runner.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 chemaxon.checkers.runner.BasicCheckerRunner
      Parameters:
      molecule - a Molecule 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