chemaxon.checkers
Class AbstractStructureChecker

java.lang.Object
  extended by chemaxon.checkers.AbstractStructureChecker
All Implemented Interfaces:
StructureChecker, chemaxon.license.Licensable
Direct Known Subclasses:
AbbreviatedGroupChecker, AromaticityErrorChecker, AttachedDataChecker, ComponentChecker, CoordinationSystemErrorChecker, DoubleBondStereoErrorChecker, ExternalStructureChecker, MoleculeChargeChecker, ReactionChecker, WedgeErrorChecker, WigglyDoubleBondChecker

public abstract class AbstractStructureChecker
extends java.lang.Object
implements StructureChecker, chemaxon.license.Licensable

Abstract base class of all functions checking and repairing chemical structures.

Since:
Marvin 5.3
Version:
5.3
Author:
Attila Szabo

Field Summary
protected  StructureCheckerErrorType errorType
           
 
Constructor Summary
AbstractStructureChecker(StructureCheckerErrorType errorType)
          Constructor to create a Structure checker instance with the given errorType
 
Method Summary
 StructureCheckerResult check(Molecule molecule)
          Detects a specific error in the molecule.
protected abstract  StructureCheckerResult check1(Molecule molecule)
           
protected  java.lang.String getErrorDescription(int errorCount)
          Generate the error description depends on erroCount
 java.lang.String getHelpText()
          Gets the help text of the checker
 javax.swing.Icon getIcon()
          Gets the Icon of the current checker
 java.lang.String getLocalMenuName()
          Gets the local menu name of the checker
 java.lang.String getName()
          Gets the name of the checker
 boolean isLicensed()
          Returns information about the licensing of the product.
 void setHelpText(java.lang.String helpText)
          Sets the detailed help of the checker which will shown in the tooltip on the GUI
 void setIcon(javax.swing.Icon icon)
          Sets the icon of the checker
 void setLicenseEnvironment(java.lang.String env)
          Every license can have a modifier environment that's typically an integration environment.
 void setLocalMenuName(java.lang.String localMenuName)
          Set the local menu name of the checker
 void setMoreErrorMessage(java.lang.String moreErrorMessage)
          Sets the message which will given in the result if two or more error found
 void setName(java.lang.String name)
          Sets the name of the checker
 void setNoErrorMessage(java.lang.String noErrorMessage)
          Sets the message which will given in the result if no error found
 void setOneErrorMessage(java.lang.String oneErrorMessage)
          Sets the message which will given in the result if one error found
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorType

protected final StructureCheckerErrorType errorType
Constructor Detail

AbstractStructureChecker

public AbstractStructureChecker(StructureCheckerErrorType errorType)
Constructor to create a Structure checker instance with the given errorType

Parameters:
errorType - element of StructureCheckerErrorType
Method Detail

getName

public java.lang.String getName()
Description copied from interface: StructureChecker
Gets the name of the checker

Specified by:
getName in interface StructureChecker
Returns:
a human readable name

setName

public void setName(java.lang.String name)
Description copied from interface: StructureChecker
Sets the name of the checker

Specified by:
setName in interface StructureChecker
Parameters:
name - the human readable name of the checker

setNoErrorMessage

public void setNoErrorMessage(java.lang.String noErrorMessage)
Description copied from interface: StructureChecker
Sets the message which will given in the result if no error found

Specified by:
setNoErrorMessage in interface StructureChecker
Parameters:
noErrorMessage - the error message if no error found

setOneErrorMessage

public void setOneErrorMessage(java.lang.String oneErrorMessage)
Description copied from interface: StructureChecker
Sets the message which will given in the result if one error found

Specified by:
setOneErrorMessage in interface StructureChecker
Parameters:
oneErrorMessage - the error message if one error found

setMoreErrorMessage

public void setMoreErrorMessage(java.lang.String moreErrorMessage)
Description copied from interface: StructureChecker
Sets the message which will given in the result if two or more error found

Specified by:
setMoreErrorMessage in interface StructureChecker
Parameters:
moreErrorMessage - the error message if two or more error found

getErrorDescription

protected java.lang.String getErrorDescription(int errorCount)
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

public java.lang.String getLocalMenuName()
Description copied from interface: StructureChecker
Gets the local menu name of the checker

Specified by:
getLocalMenuName in interface StructureChecker
Returns:
the name for the local menu

setLocalMenuName

public void setLocalMenuName(java.lang.String localMenuName)
Description copied from interface: StructureChecker
Set the local menu name of the checker

Specified by:
setLocalMenuName in interface StructureChecker
Parameters:
localMenuName - a String to be shown in the local menu

getHelpText

public java.lang.String getHelpText()
Description copied from interface: StructureChecker
Gets the help text of the checker

Specified by:
getHelpText in interface StructureChecker
Returns:
the help text of the checker

setHelpText

public void setHelpText(java.lang.String helpText)
Description copied from interface: StructureChecker
Sets the detailed help of the checker which will shown in the tooltip on the GUI

Specified by:
setHelpText in interface StructureChecker
Parameters:
helpText - a String to be shown in the tooltip

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: StructureChecker
Gets the Icon of the current checker

Specified by:
getIcon in interface StructureChecker
Returns:
the Icon of the current checker

setIcon

public void setIcon(javax.swing.Icon icon)
Description copied from interface: StructureChecker
Sets the icon of the checker

Specified by:
setIcon in interface StructureChecker
Parameters:
icon - is an instance of Icon

check

public final StructureCheckerResult check(Molecule molecule)
                                   throws java.lang.NullPointerException,
                                          chemaxon.license.LicenseException
Description copied from interface: StructureChecker
Detects a specific error in the molecule.

Specified by:
check in interface StructureChecker
Parameters:
molecule - a Molecule instance 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, null otherwise
Throws:
java.lang.NullPointerException
chemaxon.license.LicenseException

check1

protected abstract StructureCheckerResult check1(Molecule molecule)

isLicensed

public boolean isLicensed()
Description copied from interface: chemaxon.license.Licensable
Returns information about the licensing of the product. Example implementation: return LicenseHandler.isLicensed( LicenseHandler.MY_IDENTIFIER, licenseEnvironment );

Specified by:
isLicensed in interface chemaxon.license.Licensable
Returns:
true if the product is correctly licensed

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Description copied from interface: chemaxon.license.Licensable
Every license can have a modifier environment that's typically an integration environment. All being Licensable should be prepared to store and show a set environment to the LicenseHandler. Example implementation:
 private String licenseEnvironment = "";
 public void setLicenseEnvironment(String env) {
     licenseEnvironment = env;
 }
 

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable
Parameters:
env - environment String to be stored and passed to the LicenseHandler in the isLicensed method