Package org.openscience.cdk.io
Interface IChemObjectReader
- All Superinterfaces:
AutoCloseable
,Closeable
,IChemObjectIO
- All Known Subinterfaces:
IIteratingChemObjectReader<T>
,ISimpleChemObjectReader
- All Known Implementing Classes:
CDKOWLReader
,CIFReader
,CMLReader
,CrystClustReader
,CTXReader
,DefaultChemObjectReader
,DefaultIteratingChemObjectReader
,GamessReader
,Gaussian03Reader
,Gaussian98Reader
,GhemicalMMReader
,HINReader
,INChIPlainTextReader
,INChIReader
,IteratingPCCompoundASNReader
,IteratingPCCompoundXMLReader
,IteratingPCSubstancesXMLReader
,IteratingSDFReader
,IteratingSMILESReader
,MDLReader
,MDLRXNReader
,MDLRXNV2000Reader
,MDLRXNV3000Reader
,MDLV2000Reader
,MDLV3000Reader
,Mol2Reader
,Mopac7Reader
,MoSSOutputReader
,PCCompoundASNReader
,PCCompoundXMLReader
,PCSubstanceXMLReader
,PDBReader
,PMPReader
,RGroupQueryReader
,ShelXReader
,SMILESReader
,VASPReader
,XYZReader
,ZMatrixReader
This interface specifies the common functionality all IO readers should provide.
IO readers should not implement this interface directly, but rather implement
one of its child interfaces:
ISimpleChemObjectReader
or IIteratingChemObjectReader
.
These sub-interfaces specify the information access methods:
a simple read() method for the ISimpleChemObjectReader
and
more advanced iterator based access for the IIteratingChemObjectReader
(suitable for large files)- Author:
- Egon Willighagen <egonw@users.sf.net>
- See Also:
- Source code:
- main
- Belongs to CDK module:
- io
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleError
(String message) Redirects an error message to theIChemObjectReaderErrorHandler
.void
handleError
(String message, int row, int colStart, int colEnd) Redirects an error message to theIChemObjectReaderErrorHandler
.void
handleError
(String message, int row, int colStart, int colEnd, Exception exception) Redirects an error message to theIChemObjectReaderErrorHandler
.void
handleError
(String message, Exception exception) Redirects an error message to theIChemObjectReaderErrorHandler
.void
Sets an error handler that is sent events when file format issues occur.void
setReader
(InputStream reader) Sets the InputStream from which this ChemObjectReader should read the contents.void
Sets the Reader from which this ChemObjectReader should read the contents.void
Sets the reader mode.Methods inherited from interface org.openscience.cdk.io.IChemObjectIO
accepts, addChemObjectIOListener, addSetting, addSettings, close, getFormat, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
-
Method Details
-
setReader
Sets the Reader from which this ChemObjectReader should read the contents.- Throws:
CDKException
-
setReader
Sets the InputStream from which this ChemObjectReader should read the contents.- Throws:
CDKException
-
setReaderMode
Sets the reader mode. If Mode.STRICT, then the reader will fail on any problem in the format of the read file, instead of trying to recover from that.- Parameters:
mode
-
-
setErrorHandler
Sets an error handler that is sent events when file format issues occur.- Parameters:
handler
-IChemObjectReaderErrorHandler
to send error messages to.
-
handleError
Redirects an error message to theIChemObjectReaderErrorHandler
. Throws anCDKException
when in STRICTIChemObjectReader.Mode
.- Parameters:
message
- the error message.- Throws:
CDKException
-
handleError
Redirects an error message to theIChemObjectReaderErrorHandler
. Throws anCDKException
when in STRICTIChemObjectReader.Mode
.- Parameters:
message
- the error message.exception
- the correspondingException
.- Throws:
CDKException
-
handleError
Redirects an error message to theIChemObjectReaderErrorHandler
. Throws anCDKException
when in STRICTIChemObjectReader.Mode
.- Parameters:
message
- the error message.row
- Row in the file where the error is found.colStart
- Start column in the file where the error is found.colEnd
- End column in the file where the error is found.- Throws:
CDKException
-
handleError
void handleError(String message, int row, int colStart, int colEnd, Exception exception) throws CDKException Redirects an error message to theIChemObjectReaderErrorHandler
. Throws anCDKException
when in STRICTIChemObjectReader.Mode
.- Parameters:
message
- the error message.exception
- the correspondingException
.row
- Row in the file where the error is found.colStart
- Start column in the file where the error is found.colEnd
- End column in the file where the error is found.- Throws:
CDKException
-