public abstract class DefaultIteratingChemObjectReader<T extends IChemObject> extends ChemObjectIO implements IIteratingChemObjectReader<T>
IChemObjectReader.Mode
Modifier and Type | Field and Description |
---|---|
protected IChemObjectReaderErrorHandler |
errorHandler |
protected IChemObjectReader.Mode |
mode |
Constructor and Description |
---|
DefaultIteratingChemObjectReader() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Class<? extends IChemObject> objectClass)
Returns whether the given
IChemObject can be read or written. |
void |
handleError(String message)
Redirects an error message to the
IChemObjectReaderErrorHandler . |
void |
handleError(String message,
Exception exception)
Redirects an error message to the
IChemObjectReaderErrorHandler . |
void |
handleError(String message,
int row,
int colStart,
int colEnd)
Redirects an error message to the
IChemObjectReaderErrorHandler . |
void |
handleError(String message,
int row,
int colStart,
int colEnd,
Exception exception)
Redirects an error message to the
IChemObjectReaderErrorHandler . |
void |
remove()
File IO generally does not support removing of entries.
|
void |
setErrorHandler(IChemObjectReaderErrorHandler handler)
Sets an error handler that is sent events when file format issues occur.
|
void |
setReaderMode(IChemObjectReader.Mode mode)
Sets the reader mode.
|
addChemObjectIOListener, addSetting, addSettings, fireIOSettingQuestion, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setReader, setReader
addChemObjectIOListener, addSetting, addSettings, close, getFormat, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
forEachRemaining, hasNext, next
protected IChemObjectReader.Mode mode
protected IChemObjectReaderErrorHandler errorHandler
public boolean accepts(Class<? extends IChemObject> objectClass)
IChemObjectIO
IChemObject
can be read or written.accepts
in interface IChemObjectIO
objectClass
- IChemObject
of which is tested if it can be handled.IChemObject
can be handled.public void remove()
remove
in interface Iterator<T extends IChemObject>
public void setReaderMode(IChemObjectReader.Mode mode)
IChemObjectReader
setReaderMode
in interface IChemObjectReader
public void setErrorHandler(IChemObjectReaderErrorHandler handler)
setErrorHandler
in interface IChemObjectReader
handler
- IChemObjectReaderErrorHandler
to send error
messages to.public void handleError(String message) throws CDKException
IChemObjectReaderErrorHandler
.
Throws an CDKException
when in STRICT IChemObjectReader.Mode
.handleError
in interface IChemObjectReader
message
- the error message.CDKException
public void handleError(String message, Exception exception) throws CDKException
IChemObjectReaderErrorHandler
.
Throws an CDKException
when in STRICT IChemObjectReader.Mode
.handleError
in interface IChemObjectReader
message
- the error message.exception
- the corresponding Exception
.CDKException
public void handleError(String message, int row, int colStart, int colEnd) throws CDKException
IChemObjectReaderErrorHandler
.
Throws an CDKException
when in STRICT IChemObjectReader.Mode
.handleError
in interface IChemObjectReader
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.CDKException
public void handleError(String message, int row, int colStart, int colEnd, Exception exception) throws CDKException
IChemObjectReaderErrorHandler
.
Throws an CDKException
when in STRICT IChemObjectReader.Mode
.handleError
in interface IChemObjectReader
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.exception
- the corresponding Exception
.CDKException
Copyright © 2021. All rights reserved.