Package chemaxon.standardizer.actions
Class InvalidStandardizerAction
java.lang.Object
chemaxon.standardizer.actions.InvalidStandardizerAction
- All Implemented Interfaces:
StandardizerAction
@PublicApi
public final class InvalidStandardizerAction
extends Object
implements StandardizerAction
Implementation of
StandardizerAction
representing an invalid instance
of a standardizer action. Used by StandardizerConfigurationReader
for
invalid configuration entries- Since:
- 5.11
-
Constructor Summary
ConstructorDescriptionInvalidStandardizerAction
(String errorMessage) Initializes an invalid standardizer instanceInitializes an invalid standardizer instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a PropertyChangeListener to the listener list.void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Add a PropertyChangeListener for a specific property.clone()
Returns a clone of thisStandardizerAction
instanceGets the name of the original actionGets the descriptor of the standardizer action.Gets the error message of the standardizer instancegetID()
Gets the identifier of the standardizer taskGets the parameter map of the actionboolean
isActive()
Returns true if the action is active, and can be usedboolean
Returns true if the action is available, and can be usedboolean
isValid()
Returns true if the action's parameters are valid, false otherwisevoid
Remove a PropertyChangeListener from the listener list.void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) Remove a PropertyChangeListener for a specific property.void
setActive
(boolean active) Sets whether the action is active, and can be usedvoid
Sets the license environment of the actionstandardize
(Molecule molecule) Standardizes the provided molecule.
Logs of standardization should be generated to aSystem.Logger
, that can be collected by usingStandardizerLogger.getLogger()
method.toString()
-
Constructor Details
-
InvalidStandardizerAction
Initializes an invalid standardizer instance- Parameters:
errorMessage
- the error message of the instance.
-
InvalidStandardizerAction
public InvalidStandardizerAction(String errorMessage, String actionName, Map<String, String> parameters) Initializes an invalid standardizer instance- Parameters:
actionName
- the name of the actionparameters
- the parameters of the actionerrorMessage
- the error message of the instance.
-
-
Method Details
-
standardize
Description copied from interface:StandardizerAction
Standardizes the provided molecule.
Logs of standardization should be generated to aSystem.Logger
, that can be collected by usingStandardizerLogger.getLogger()
method.- Specified by:
standardize
in interfaceStandardizerAction
- Parameters:
molecule
- the target molecule of the standardization process- Returns:
- the change set of the molecule
- Throws:
NullPointerException
-
cloneItem
Description copied from interface:StandardizerAction
Returns a clone of thisStandardizerAction
instance- Specified by:
cloneItem
in interfaceStandardizerAction
- Returns:
- a clone of this
StandardizerAction
instance
-
isValid
public boolean isValid()Description copied from interface:StandardizerAction
Returns true if the action's parameters are valid, false otherwise- Specified by:
isValid
in interfaceStandardizerAction
- Returns:
- true if the action's parameters are valid, false otherwise
-
isAvailable
public boolean isAvailable()Description copied from interface:StandardizerAction
Returns true if the action is available, and can be used- Specified by:
isAvailable
in interfaceStandardizerAction
- Returns:
- true if the action is available, and can be used
-
getDescriptor
Description copied from interface:StandardizerAction
Gets the descriptor of the standardizer action. Contains all necessary informations of the action for user interfaces.- Specified by:
getDescriptor
in interfaceStandardizerAction
- Returns:
- the descriptor of the standardizer action.
-
removePropertyChangeListener
Description copied from interface:StandardizerAction
Remove a PropertyChangeListener for a specific property. Iflistener
was added more than once to the same event source for the specified property, it will be notified one less time after being removed. IfpropertyName
is null, no exception is thrown and no action is taken. Iflistener
is null, or was never added for the specified property, no exception is thrown and no action is taken.- Specified by:
removePropertyChangeListener
in interfaceStandardizerAction
- Parameters:
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removed- See Also:
-
addPropertyChangeListener
Description copied from interface:StandardizerAction
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. IfpropertyName
orlistener
is null, no exception is thrown and no action is taken.- Specified by:
addPropertyChangeListener
in interfaceStandardizerAction
- Parameters:
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be added- See Also:
-
removePropertyChangeListener
Description copied from interface:StandardizerAction
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. Iflistener
was added more than once to the same event source, it will be notified one less time after being removed. Iflistener
is null, or was never added, no exception is thrown and no action is taken.- Specified by:
removePropertyChangeListener
in interfaceStandardizerAction
- Parameters:
listener
- The PropertyChangeListener to be removed- See Also:
-
addPropertyChangeListener
Description copied from interface:StandardizerAction
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. Iflistener
is null, no exception is thrown and no action is taken.- Specified by:
addPropertyChangeListener
in interfaceStandardizerAction
- Parameters:
listener
- The PropertyChangeListener to be added- See Also:
-
getErrorMessage
Gets the error message of the standardizer instance- Returns:
- the error message of the standardizer instance
-
toString
-
getID
Description copied from interface:StandardizerAction
Gets the identifier of the standardizer task- Specified by:
getID
in interfaceStandardizerAction
- Returns:
- the identifier of the standardizer task
-
isActive
public boolean isActive()Description copied from interface:StandardizerAction
Returns true if the action is active, and can be used- Specified by:
isActive
in interfaceStandardizerAction
- Returns:
- true if the action is active, and can be used
-
setActive
public void setActive(boolean active) Description copied from interface:StandardizerAction
Sets whether the action is active, and can be used- Specified by:
setActive
in interfaceStandardizerAction
- Parameters:
active
- whether the action should be active, and can be used
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getActionName
Gets the name of the original action- Returns:
- the name of the original action
-
getParameters
Gets the parameter map of the action- Returns:
- the parameter map of the action
-
setLicenseEnvironment
Description copied from interface:StandardizerAction
Sets the license environment of the action- Specified by:
setLicenseEnvironment
in interfaceStandardizerAction
- Parameters:
env
- the license environment of the action
-