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
public interface IChemObjectReader extends IChemObjectIO
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
orIIteratingChemObjectReader
. These sub-interfaces specify the information access methods: a simple read() method for theISimpleChemObjectReader
and more advanced iterator based access for theIIteratingChemObjectReader
(suitable for large files)- Author:
- Egon Willighagen <egonw@users.sf.net>
- See Also:
ISimpleChemObjectReader
,IIteratingChemObjectReader
- Source code:
- main
- Belongs to CDK module:
- io
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IChemObjectReader.Mode
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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
setErrorHandler(IChemObjectReaderErrorHandler handler)
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
setReader(Reader reader)
Sets the Reader from which this ChemObjectReader should read the contents.void
setReaderMode(IChemObjectReader.Mode mode)
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 Detail
-
setReader
void setReader(Reader reader) throws CDKException
Sets the Reader from which this ChemObjectReader should read the contents.- Throws:
CDKException
-
setReader
void setReader(InputStream reader) throws CDKException
Sets the InputStream from which this ChemObjectReader should read the contents.- Throws:
CDKException
-
setReaderMode
void setReaderMode(IChemObjectReader.Mode mode)
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
void setErrorHandler(IChemObjectReaderErrorHandler handler)
Sets an error handler that is sent events when file format issues occur.- Parameters:
handler
-IChemObjectReaderErrorHandler
to send error messages to.
-
handleError
void handleError(String message) throws CDKException
Redirects an error message to theIChemObjectReaderErrorHandler
. Throws anCDKException
when in STRICTIChemObjectReader.Mode
.- Parameters:
message
- the error message.- Throws:
CDKException
-
handleError
void handleError(String message, Exception exception) throws CDKException
Redirects an error message to theIChemObjectReaderErrorHandler
. Throws anCDKException
when in STRICTIChemObjectReader.Mode
.- Parameters:
message
- the error message.exception
- the correspondingException
.- Throws:
CDKException
-
handleError
void handleError(String message, int row, int colStart, int colEnd) throws CDKException
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
-
-