@PublicAPI public abstract class AbstractStandardizerAction extends java.lang.Object implements StandardizerAction, chemaxon.license.Licensable, java.lang.Cloneable, java.beans.PropertyChangeListener
StandardizerAction
. standardize1(Molecule)
RgMolecule
,
RxnMolecule
) are decomponented by the method
getComponents(Molecule)
, and standardize1(Molecule)
method
is called on each component, before applied on the original molecule. If a
descendant does not want this to occur, this method must be overridden.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_PATH_KEY
The key of configuration path parameter of the abstract action.
|
static java.lang.String |
FORMAT_KEY
The key of the molecule format parameter of the abstract action.
|
static java.lang.String |
ID_KEY
The key of the ID parameter of the abstract action.
|
protected java.beans.PropertyChangeSupport |
support |
Modifier | Constructor and Description |
---|---|
protected |
AbstractStandardizerAction(java.util.Map<java.lang.String,java.lang.String> params)
Initializes the functionality of the abstract implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property.
|
AbstractStandardizerAction |
clone() |
StandardizerAction |
cloneItem()
Returns a clone of this
StandardizerAction instance |
protected java.util.List<Molecule> |
getComponents(Molecule molecule)
A recursive algorithm getting all components (reactants, agents and
products of reaction molecules, R-group definitions of Rg-Molecules) of
the molecule.
|
StandardizerActionDescriptor |
getDescriptor()
Gets the descriptor of the standardizer action.
|
java.lang.String |
getID()
Gets the identifier string of the standardizer action.
|
boolean |
isActive()
Returns true if the action is active, and can be used
|
boolean |
isAvailable()
Returns true if the action is available, and can be used
|
boolean |
isLicensed() |
boolean |
isValid()
Returns true if the action's parameters are valid, false otherwise
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.
|
void |
setActive(boolean active)
Sets whether the action is active, and can be used
|
void |
setID(java.lang.String id)
Sets the identifier string of the standardizer action
|
void |
setLicenseEnvironment(java.lang.String env)
Sets the license environment of the action
|
void |
setValid(boolean valid)
Sets the validity of the standardizer action.
|
Changes |
standardize(Molecule molecule)
Standardizes the provided molecule.
Logs of standardization should be generated to a Logger , that can be
collected by using StandardizerLogger.getLogger() method. |
protected abstract Changes |
standardize1(Molecule molecule)
This method contains the current standardization mechanism.
|
java.lang.String |
toString() |
public static final java.lang.String CONFIG_PATH_KEY
AbstractStandardizerAction(Map)
may
contain the value of the path of the configuration defined by this key.public static final java.lang.String ID_KEY
AbstractStandardizerAction(Map)
may
contain the value of the identifier of the action defined by this key.public static final java.lang.String FORMAT_KEY
AbstractStandardizerAction(Map)
may
contain the value of the identifier of the action defined by this key.protected java.beans.PropertyChangeSupport support
protected AbstractStandardizerAction(java.util.Map<java.lang.String,java.lang.String> params)
params
- the parameters of the action in a map representationpublic StandardizerActionDescriptor getDescriptor()
StandardizerAction
getDescriptor
in interface StandardizerAction
public boolean isValid()
StandardizerAction
isValid
in interface StandardizerAction
public void setValid(boolean valid)
AbstractStandardizerAction(Map)
valid
- the validity of the standardizer actionpublic boolean isAvailable()
StandardizerAction
isAvailable
in interface StandardizerAction
public final Changes standardize(Molecule molecule)
StandardizerAction
Logger
, that can be
collected by using StandardizerLogger.getLogger()
method.standardize
in interface StandardizerAction
molecule
- the target molecule of the standardization processprotected abstract Changes standardize1(Molecule molecule) throws java.lang.IllegalArgumentException
RgMolecule
,
RxnMolecule
) are decomponented by the method
getComponents(Molecule)
, and standardize1(Molecule)
method is called on each component, before applied on the original
molecule. If a descendant does not want this to occur, this method must
be overridden.Logger
, that can
be collected by using StandardizerLogger.getLogger()
method.molecule
- the Molecule
instance to be standardizedjava.lang.IllegalArgumentException
- if the provided molecule or the provided parameters of the
action are invalidpublic StandardizerAction cloneItem()
StandardizerAction
StandardizerAction
instancecloneItem
in interface StandardizerAction
StandardizerAction
instancepublic AbstractStandardizerAction clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
StandardizerAction
listener
was added more than once to the same event source
for the specified property, it will be notified one less time after being
removed. If propertyName
is null, no exception is thrown and
no action is taken. If listener
is null, or was never added
for the specified property, no exception is thrown and no action is
taken.removePropertyChangeListener
in interface StandardizerAction
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(String,
PropertyChangeListener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
StandardizerAction
propertyName
or listener
is null, no exception is thrown and no action is taken.addPropertyChangeListener
in interface StandardizerAction
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(String,
PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
StandardizerAction
listener
was added more than once to the same event source,
it will be notified one less time after being removed. If
listener
is null, or was never added, no exception is thrown
and no action is taken.removePropertyChangeListener
in interface StandardizerAction
listener
- The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
StandardizerAction
listener
is null, no exception is thrown and no action is
taken.addPropertyChangeListener
in interface StandardizerAction
listener
- The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)
public void setLicenseEnvironment(java.lang.String env)
StandardizerAction
setLicenseEnvironment
in interface chemaxon.license.Licensable
setLicenseEnvironment
in interface StandardizerAction
env
- the license environment of the actionpublic boolean isLicensed()
isLicensed
in interface chemaxon.license.Licensable
public java.lang.String toString()
toString
in class java.lang.Object
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public java.lang.String getID()
getID
in interface StandardizerAction
public void setID(java.lang.String id)
id
- the identifier string of the standardizer actionpublic boolean isActive()
StandardizerAction
isActive
in interface StandardizerAction
public void setActive(boolean active)
StandardizerAction
setActive
in interface StandardizerAction
active
- whether the action should be active, and can be usedprotected java.util.List<Molecule> getComponents(Molecule molecule)
molecule
- the target molecule