Package chemaxon.standardizer.runner
Interface StandardizerActionRunner
- All Superinterfaces:
 Cloneable
- All Known Implementing Classes:
 BasicStandardizerRunner
The descendant of 
As standardizer configuration may contain actions in groups, using
By default, in case of the provided configuration containing error(s) the runner throws
If errors of configuration needs to be checked, use the
Standardization can be executed by
The applied standardizer actions can be collected using
Logs are generated to a
Note, that
StandardizerActionRunner interface has to provide
 the functionality to run StandardizerConfiguration instances
 automatically on the given molecule.As standardizer configuration may contain actions in groups, using
setTargetGroup(String) and setTargetGroups(String...)
 methods, the target groups, containing the actions to be executed can be
 defined.By default, in case of the provided configuration containing error(s) the runner throws
IllegalArgumentException. Configuration errors can be
 ignored using the method
 setIgnoreConfigurationErrors(boolean) with
 true as parameter. In this case the faulty actions are not executed, error
 message or exception should not occur! If errors of configuration needs to be checked, use the
getConfiguration() method to get the
 configuration, and check the validity of the configuration by using the
 function StandardizerConfiguration.isValid().Standardization can be executed by
standardize() and
 standardizeAndWait() method. The method standardize()
 executes the standardization in a background thread. The state of the
 standardization can be gathered using isRunning() method. Using
 standardizeAndWait() method the thread is blocked until the
 standardization finishes. The applied standardizer actions can be collected using
getAppliedActions(), and the changes applied on the molecule can be
 collected using getChanges() method.Logs are generated to a
System.Logger, that can be collected by using
 StandardizerLogger.getLogger() method.Note, that
setMolecule(Molecule) method must be called prior
 standardization.- Since:
 - 5.11
 
- 
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener changeListener) Adds aPropertyChangeListenerthat will receive all thePropertyChangeEventfired by this classvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Adds aPropertyChangeListenerthat will receive thePropertyChangeEventfired when the property with the given name is changedvoidcancel()Stops the background threadGets the list of actions applied in the configuration at the last executionGets the list of changes applied on the molecule.Gets the configuration of the runnerintGets the current progress percentGets whichStandardizerActioninstance run currentlyintGets the length of the standardization processbooleanThis function identifies the state of the standardizer threadvoidsetConfiguration(StandardizerConfiguration configuration) Sets the configuration of the runnervoidSets a new configuration for the runner.voidsetIgnoreConfigurationErrors(boolean ignore) Sets whether configuration errors should be ignoredvoidSets the license environment of the runnervoidsetMolecule(Molecule molecule) Sets the molecule to be standardized by the standardizer actionsvoidsetTargetGroup(String groupName) Sets the target group of standardizer action of the runnervoidsetTargetGroups(String... groupNames) Sets the target groups of standardizer action of the runnervoidInvoke a background thread which will run all standardizer actions on the given moleculeExecutes all standardizer actions contained by the pre-set configuration on the given molecule and returns the list of applied changes. 
- 
Method Details
- 
setConfigurationReader
Sets a new configuration for the runner.- Parameters:
 reader- is theStandardizerConfigurationReaderinstance which provides the current configuration
 - 
standardize
Invoke a background thread which will run all standardizer actions on the given molecule- Throws:
 IllegalArgumentException- if the configuration or the molecule contains errors
 - 
standardizeAndWait
Executes all standardizer actions contained by the pre-set configuration on the given molecule and returns the list of applied changes. For each action of the configuration there is a change object (or null) in the list.- Returns:
 - the list of changes applied on the molecule
 - Throws:
 IllegalArgumentException- if the configuration or the molecule contains errors
 - 
cancel
void cancel()Stops the background thread - 
isRunning
boolean isRunning()This function identifies the state of the standardizer thread- Returns:
 - true if the background thread runs false otherwise
 
 - 
getCurrent
int getCurrent()Gets the current progress percent- Returns:
 - the current progress percent
 
 - 
getCurrentActionName
String getCurrentActionName()Gets whichStandardizerActioninstance run currently- Returns:
 - which 
StandardizerActioninstance run currently 
 - 
getProgessLength
int getProgessLength()Gets the length of the standardization process- Returns:
 - the length of the standardization process
 
 - 
getChanges
Gets the list of changes applied on the molecule. For each action of the configuration there is a change object (or null) in the list.- Returns:
 - the list of changes applied on the molecule
 
 - 
setMolecule
Sets the molecule to be standardized by the standardizer actions- Parameters:
 molecule- aMoleculeinstance to be standardized
 - 
addPropertyChangeListener
Adds aPropertyChangeListenerthat will receive all thePropertyChangeEventfired by this class- Parameters:
 changeListener- aPropertyChangeListenerinstance
 - 
addPropertyChangeListener
Adds aPropertyChangeListenerthat will receive thePropertyChangeEventfired when the property with the given name is changed- Parameters:
 propertyName- the name of the property to be listenedlistener- aPropertyChangeListenerinstance
 - 
getConfiguration
StandardizerConfiguration getConfiguration()Gets the configuration of the runner- Returns:
 - the configuration of the runner
 
 - 
setConfiguration
Sets the configuration of the runner- Parameters:
 configuration- the configuration to be set to the runner
 - 
getAppliedActions
List<StandardizerAction> getAppliedActions()Gets the list of actions applied in the configuration at the last execution- Returns:
 - the list of applied actions at the last execution
 
 - 
setTargetGroup
Sets the target group of standardizer action of the runner- Parameters:
 groupName- the name of the group of standardizer actions
 - 
setTargetGroups
Sets the target groups of standardizer action of the runner- Parameters:
 groupNames- the names of the groups of standardizer actions
 - 
setLicenseEnvironment
Sets the license environment of the runner- Parameters:
 env- the license environment of the runner
 - 
setIgnoreConfigurationErrors
void setIgnoreConfigurationErrors(boolean ignore) Sets whether configuration errors should be ignored- Parameters:
 ignore- whether configuration errors should be ignored
 
 -