Package chemaxon.checkers
Class AbstractStructureChecker
java.lang.Object
chemaxon.checkers.AbstractStructureChecker
- All Implemented Interfaces:
StructureChecker,chemaxon.license.Licensable,PropertyChangeListener,Cloneable,EventListener
- Direct Known Subclasses:
AbbreviatedGroupChecker,AbsentChiralFlagChecker,AbsoluteStereoConfigurationChecker,AromaticityErrorChecker,AtropisomerChecker,AttachedDataChecker,BondAngleChecker,BondLengthChecker,BracketsChecker,ChiralFlagChecker,ChiralFlagErrorChecker,CircularRGroupReferenceChecker,ComponentChecker,CoordinationSystemErrorChecker,CovalentCounterionChecker,EmptyStructureChecker,ExplicitHydrogenChecker,ExternalStructureChecker,EZDoubleBondChecker,IncorrectTetrahedralStereoChecker,MetalloceneErrorChecker,MissingRGroupChecker,MoleculeChargeChecker,MultiComponentChecker,MultipleStereocenterChecker,NonStandardWedgeSchemeChecker,NonStereoWedgeBondChecker,OCRErrorChecker,RatomChecker,ReactionChecker,RelativeStereoChecker,RgroupAttachmentErrorChecker,RgroupBridgeRatomChecker,RingStrainErrorChecker,SolventChecker,StereoCareBoxChecker,SubstructureChecker,UnbalancedReactionChecker,UnusedRGroupChecker,ValenceErrorChecker,WedgeErrorChecker,WigglyBondChecker,WigglyDoubleBondChecker
@PublicApi
public abstract class AbstractStructureChecker
extends Object
implements StructureChecker, chemaxon.license.Licensable, Cloneable, PropertyChangeListener
Abstract base class of all functions checking and repairing chemical
structures.
- Since:
- Marvin 5.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StructureCheckerErrorTypeThe error type of the current checker.protected PropertyChangeSupportproperty change support object bound to thisFields inherited from interface chemaxon.checkers.StructureChecker
PROPERTY_KEY_VALID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor to create a Structure checker instance with the given errorType -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a PropertyChangeListener to the listener list.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Add a PropertyChangeListener for a specific property.final StructureCheckerResultDetects a specific error in the molecule.protected abstract StructureCheckerResultThis method contains the current checking mechanism.clone()Returns a clone of this StructureChecker instanceprotected voidconvertResult(Molecule originalMolecule, Molecule expandedMolecule, StructureCheckerResult result, Map<MolAtom, MolAtom> atomMap, Map<MolBond, MolBond> bondMap) Handles the mapping of a cloned and expanded molecule result to the original molecule.booleanprotected MoleculeReturns the original molecule if no groups to expand, or the clone of the original molecule with expanded groups.Returns aStructureCheckerDescriptorinstance which represents the user interface related informations of the checkerDeprecated, for removal: This API element is subject to removal in a future version.Returns theStringrepresented error code of the checker (this error code should be used for external implementation support instead ofStructureChecker.getErrorType())protected StringgetErrorDescription(int errorCount) Generate the error description depends on erroCountGets the help text of the checkergetIcon()Gets theIconof the current checkerGets the local menu name of the checkergetName()Gets the name of the checkerinthashCode()booleanReturns true if the checker is available, and can be usedbooleanbooleanisValid()Returns true if the checker's configuration is valid, false otherwisevoidvoidRemove a PropertyChangeListener from the listener list.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Remove a PropertyChangeListener for a specific property.voidsetDescription(String description) Deprecated, for removal: This API element is subject to removal in a future version.voidsetHelpText(String helpText) Deprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.voidvoidsetLocalMenuName(String localMenuName) Deprecated, for removal: This API element is subject to removal in a future version.voidsetMoreErrorMessage(String moreErrorMessage) Deprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetNoErrorMessage(String noErrorMessage) Deprecated, for removal: This API element is subject to removal in a future version.voidsetOneErrorMessage(String oneErrorMessage) Deprecated, for removal: This API element is subject to removal in a future version.toString()
-
Field Details
-
errorType
The error type of the current checker. It is a value so can not assigned more than once -
propertyChangeSupport
property change support object bound to this
-
-
Constructor Details
-
AbstractStructureChecker
Constructor to create a Structure checker instance with the given errorType- Parameters:
errorType- element ofStructureCheckerErrorType
-
-
Method Details
-
getName
Description copied from interface:StructureCheckerGets the name of the checker- Specified by:
getNamein interfaceStructureChecker- Returns:
- a human readable name
-
setName
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the name of the checker- Specified by:
setNamein interfaceStructureChecker- Parameters:
name- the human-readable name of the checker
-
setNoErrorMessage
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setNoErrorMessage(String noErrorMessage) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the message which will given in the result if no error found- Specified by:
setNoErrorMessagein interfaceStructureChecker- Parameters:
noErrorMessage- the error message if no error found
-
setOneErrorMessage
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setOneErrorMessage(String oneErrorMessage) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the message which will given in the result if one error found- Specified by:
setOneErrorMessagein interfaceStructureChecker- Parameters:
oneErrorMessage- the error message if one error found
-
setMoreErrorMessage
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setMoreErrorMessage(String moreErrorMessage) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the message which will given in the result if two or more error found- Specified by:
setMoreErrorMessagein interfaceStructureChecker- Parameters:
moreErrorMessage- the error message if two or more error found
-
getErrorDescription
Generate the error description depends on erroCount- Parameters:
errorCount- number of errors found- Returns:
- a human readable description about how many and which kind of errors found
-
getLocalMenuName
Description copied from interface:StructureCheckerGets the local menu name of the checker- Specified by:
getLocalMenuNamein interfaceStructureChecker- Returns:
- the name for the local menu
-
setLocalMenuName
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setLocalMenuName(String localMenuName) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSet the local menu name of the checker- Specified by:
setLocalMenuNamein interfaceStructureChecker- Parameters:
localMenuName- aStringto be shown in the local menu
-
getHelpText
Description copied from interface:StructureCheckerGets the help text of the checker- Specified by:
getHelpTextin interfaceStructureChecker- Returns:
- the help text of the checker
-
setHelpText
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setHelpText(String helpText) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the detailed help of the checker which will shown in the tooltip on the GUI- Specified by:
setHelpTextin interfaceStructureChecker- Parameters:
helpText- aStringto be shown in the tooltip
-
getIcon
Description copied from interface:StructureCheckerGets theIconof the current checker- Specified by:
getIconin interfaceStructureChecker- Returns:
- the
Iconof the current checker
-
setIcon
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the icon of the checker- Specified by:
setIconin interfaceStructureChecker- Parameters:
icon- is an instance ofIcon
-
check
public final StructureCheckerResult check(Molecule molecule) throws NullPointerException, LicenseException Description copied from interface:StructureCheckerDetects a specific error in the molecule.- Specified by:
checkin interfaceStructureChecker- Parameters:
molecule- aMoleculeinstance have to be checked- Returns:
- an instance of
StructureCheckerResult(which contains all data needed to fix the problem) if the molecule contains the examined error,nullotherwise - Throws:
NullPointerException- if molecule is nullLicenseException
-
check1
This method contains the current checking mechanism.- Parameters:
molecule- theMoleculeinstance to be checked for problems- Returns:
- a
StructureCheckerResultwhich represents the problem or null if no problem found
-
expandMolecule
protected Molecule expandMolecule(Molecule molecule, Map<MolAtom, MolAtom> atomMap, Map<MolBond, MolBond> bondMap) Returns the original molecule if no groups to expand, or the clone of the original molecule with expanded groups.- Parameters:
molecule- the molecule to check- Returns:
- the original molecule, or a clone with expanded sgroups
- Since:
- 5.9
-
convertResult
protected void convertResult(Molecule originalMolecule, Molecule expandedMolecule, StructureCheckerResult result, Map<MolAtom, MolAtom> atomMap, Map<MolBond, MolBond> bondMap) Handles the mapping of a cloned and expanded molecule result to the original molecule.- Parameters:
originalMolecule- the original moleculeexpandedMolecule- the cloned then expanded moleculeresult- the structure checker result on cloned moleculeatomMap- the mapping of cloned molecule and original molecule atomsbondMap- the mapping of cloned molecule and original molecule bonds- Since:
- 5.9
-
isLicensed
public boolean isLicensed()- Specified by:
isLicensedin interfacechemaxon.license.Licensable
-
setLicenseEnvironment
- Specified by:
setLicenseEnvironmentin interfacechemaxon.license.Licensable
-
getErrorType
- Specified by:
getErrorTypein interfaceStructureChecker- Returns:
- the error type of this checker
-
getErrorCode
Description copied from interface:StructureCheckerReturns theStringrepresented error code of the checker (this error code should be used for external implementation support instead ofStructureChecker.getErrorType())- Specified by:
getErrorCodein interfaceStructureChecker- Returns:
- the
Stringrepresented error code of the checker (this error code should be used for external implementation support instead ofStructureChecker.getErrorType())
-
getEditorClassName
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getEditorClassNamein interfaceStructureChecker- Returns:
- the name of the editor class of the checker
-
getDescription
- Specified by:
getDescriptionin interfaceStructureChecker- Returns:
- the description
-
isValid
public boolean isValid()Description copied from interface:StructureCheckerReturns true if the checker's configuration is valid, false otherwise- Specified by:
isValidin interfaceStructureChecker- Returns:
- true if the checker's configuration is valid, false otherwise
-
isAvailable
public boolean isAvailable()Description copied from interface:StructureCheckerReturns true if the checker is available, and can be used- Specified by:
isAvailablein interfaceStructureChecker- Returns:
- true if the checker is available, and can be used
-
cloneItem
Description copied from interface:StructureCheckerReturns a clone of this StructureChecker instance- Specified by:
cloneItemin interfaceStructureChecker- Returns:
- a clone of this StructureChecker instance
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
setDescription
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setDescription(String description) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StructureCheckerSets the description of the checker- Specified by:
setDescriptionin interfaceStructureChecker- Parameters:
description- the description to set
-
addPropertyChangeListener
Description copied from interface:StructureCheckerAdd 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. Iflisteneris null, no exception is thrown and no action is taken.- Specified by:
addPropertyChangeListenerin interfaceStructureChecker- Parameters:
listener- The PropertyChangeListener to be added- See Also:
-
removePropertyChangeListener
Description copied from interface:StructureCheckerRemove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. Iflistenerwas added more than once to the same event source, it will be notified one less time after being removed. Iflisteneris null, or was never added, no exception is thrown and no action is taken.- Specified by:
removePropertyChangeListenerin interfaceStructureChecker- Parameters:
listener- The PropertyChangeListener to be removed- See Also:
-
addPropertyChangeListener
Description copied from interface:StructureCheckerAdd 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. IfpropertyNameorlisteneris null, no exception is thrown and no action is taken.- Specified by:
addPropertyChangeListenerin interfaceStructureChecker- Parameters:
propertyName- The name of the property to listen on.listener- The PropertyChangeListener to be added- See Also:
-
removePropertyChangeListener
Description copied from interface:StructureCheckerRemove a PropertyChangeListener for a specific property. Iflistenerwas added more than once to the same event source for the specified property, it will be notified one less time after being removed. IfpropertyNameis null, no exception is thrown and no action is taken. Iflisteneris null, or was never added for the specified property, no exception is thrown and no action is taken.- Specified by:
removePropertyChangeListenerin interfaceStructureChecker- Parameters:
propertyName- The name of the property that was listened on.listener- The PropertyChangeListener to be removed- See Also:
-
getDescriptor
Description copied from interface:StructureCheckerReturns aStructureCheckerDescriptorinstance which represents the user interface related informations of the checker- Specified by:
getDescriptorin interfaceStructureChecker- Returns:
- a
StructureCheckerDescriptorinstance which represents the user interface related informations of the checker
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
hashCode
public int hashCode() -
equals
-
toString
-