@PublicAPI public interface StandardizerActionRunner extends java.lang.Cloneable
StandardizerActionRunner
interface has to provide
the functionality to run StandardizerConfiguration
instances
automatically on the given molecule.setTargetGroup(String)
and setTargetGroups(String...)
methods, the target groups, containing the actions to be executed can be
defined.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! getConfiguration()
method to get the
configuration, and check the validity of the configuration by using the
function StandardizerConfiguration.isValid()
.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. getAppliedActions()
, and the changes applied on the molecule can be
collected using getChanges()
method.Logger
, that can be collected by using
StandardizerLogger.getLogger()
method.setMolecule(Molecule)
method must be called prior
standardization.Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener changeListener)
Adds a
PropertyChangeListener that will receive all the
PropertyChangeEvent fired by this class |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a
PropertyChangeListener that will receive the
PropertyChangeEvent fired when the property with the given name
is changed |
void |
cancel()
Stops the background thread
|
java.util.List<StandardizerAction> |
getAppliedActions()
Gets the list of actions applied in the configuration at the last
execution
|
java.util.List<Changes> |
getChanges()
Gets the list of changes applied on the molecule.
|
StandardizerConfiguration |
getConfiguration()
Gets the configuration of the runner
|
int |
getCurrent()
Gets the current progress percent
|
java.lang.String |
getCurrentActionName()
Gets which
StandardizerAction instance run currently |
int |
getProgessLength()
Gets the length of the standardization process
|
boolean |
isRunning()
This function identifies the state of the standardizer thread
|
void |
setConfiguration(StandardizerConfiguration configuration)
Sets the configuration of the runner
|
void |
setConfigurationReader(StandardizerConfigurationReader reader)
Sets a new configuration for the runner.
|
void |
setIgnoreConfigurationErrors(boolean ignore)
Sets whether configuration errors should be ignored
|
void |
setLicenseEnvironment(java.lang.String env)
Sets the license environment of the runner
|
void |
setMolecule(Molecule molecule)
Sets the molecule to be standardized by the standardizer actions
|
void |
setTargetGroup(java.lang.String groupName)
Sets the target group of standardizer action of the runner
|
void |
setTargetGroups(java.lang.String... groupNames)
Sets the target groups of standardizer action of the runner
|
void |
standardize()
Invoke a background thread which will run all standardizer actions on the
given molecule
|
java.util.List<Changes> |
standardizeAndWait()
Executes all standardizer actions contained by the pre-set configuration
on the given molecule and returns the list of applied changes.
|
void setConfigurationReader(StandardizerConfigurationReader reader)
reader
- is the StandardizerConfigurationReader
instance which
provides the current configurationvoid standardize() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the configuration or the molecule contains errorsjava.util.List<Changes> standardizeAndWait() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the configuration or the molecule contains errorsvoid cancel()
boolean isRunning()
int getCurrent()
java.lang.String getCurrentActionName()
StandardizerAction
instance run currentlyStandardizerAction
instance run currentlyint getProgessLength()
java.util.List<Changes> getChanges()
void setMolecule(Molecule molecule)
molecule
- a Molecule
instance to be standardizedvoid addPropertyChangeListener(java.beans.PropertyChangeListener changeListener)
PropertyChangeListener
that will receive all the
PropertyChangeEvent
fired by this classchangeListener
- a PropertyChangeListener
instancevoid addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
PropertyChangeListener
that will receive the
PropertyChangeEvent
fired when the property with the given name
is changedpropertyName
- the name of the property to be listenedlistener
- a PropertyChangeListener
instanceStandardizerConfiguration getConfiguration()
void setConfiguration(StandardizerConfiguration configuration)
configuration
- the configuration to be set to the runnerjava.util.List<StandardizerAction> getAppliedActions()
void setTargetGroup(java.lang.String groupName)
groupName
- the name of the group of standardizer actionsvoid setTargetGroups(java.lang.String... groupNames)
groupNames
- the names of the groups of standardizer actionsvoid setLicenseEnvironment(java.lang.String env)
env
- the license environment of the runnervoid setIgnoreConfigurationErrors(boolean ignore)
ignore
- whether configuration errors should be ignored