public interface MoleculeCallback
Note that error propagation model is specific to the actual Updater
implementation. In case of
processing error(s) none, one or all of them might be reported.
Note that MRecordReader
based import provides String representation
(see MRecord.getMolString()
. It is however not necessarily used; for example a MolImporter
based
implementation is typically unable to supply original String
molecule source.
Note that
notifyMolecule(int, com.google.common.base.Optional, chemaxon.struc.Molecule, int)
is
always invoked for successfully processed structures and never for unsuccessfull ones. Method
notifyProcessingError(int, com.google.common.base.Optional, chemaxon.struc.Molecule, java.lang.Throwable)
is also incvoked when a structure is skipped due to a structure localized processing error. Howeve it is
implementation dependent if a parse error is resulting in
notifyParseError(int, com.google.common.base.Optional, java.lang.Throwable)
or in an
abortion.
Modifier and Type | Method and Description |
---|---|
void |
notifyMolecule(int readno,
Optional<String> molString,
Molecule m,
int index)
Introduce new processed molecule.
|
void |
notifyParseError(int readno,
Optional<String> molString,
Throwable t)
Notify a parsing error.
|
void |
notifyProcessingError(int readno,
Optional<String> molString,
Molecule m,
Throwable t)
Notify a processing error.
|
void notifyMolecule(int readno, Optional<String> molString, Molecule m, int index)
readno
- Read molecule count for this event (0 for the first molecule/record in the file). Note that
value does not depend on possible index shift value specified for the import method.molString
- Molecule string from underlying MRecord.getMolString()
if applicablem
- The given structure. If standardization was specified invocation is made after
standardization. In this case the structure represents the standardized structure. In case
the descriptor generation alters the molecule the altered molecule is passed.index
- Internal index which will refer to the given structurevoid notifyProcessingError(int readno, Optional<String> molString, Molecule m, Throwable t)
This method is invoked when molecule parse was successfull but processing (standardization, descriptor generation, etc. failed
readno
- Read molecule count for this event (0 for the first molecule/record in the file). Note that
value does not depend on possible index shift value specified for the import method.molString
- Molecule string from underlying MRecord.getMolString()
if applicablem
- The given structure when error caught. If standardization was specified and error occured
during standardization then the state of the structure (original or partially/fully
standardized) depends of the internal contracts realized by Standardizer.t
- Processing errorvoid notifyParseError(int readno, Optional<String> molString, Throwable t)
This method is invoked when molecule parse from String format failed.
readno
- Read molecule count for this event (0 for the first molecule/record in the file). Note that
value does not depend on possible index shift value specified for the import method.molString
- Molecule string from underlying MRecord.getMolString()
if applicablet
- Parsing error