Class: ChemDataReaderManager

Kekule.IO. ChemDataReaderManager

new ChemDataReaderManager()

A manager to create suitable data reader.
Source:

Methods

(static) createReader(condition) → {Kekule.IO.ChemDataReader}

Create a new reader instance by condition.
Parameters:
Name Type Description
condition Hash
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) createReaderByFileExt(fileExt, otherConditions) → {Kekule.IO.ChemDataReader}

Create reader instance by file ext.
Parameters:
Name Type Description
fileExt String
otherConditions Hash
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) createReaderByFormat(formatId, otherConditions) → {Kekule.IO.ChemDataReader}

Create new reader instance by formatId.
Parameters:
Name Type Description
formatId String
otherConditions Hash
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) createReaderById(id) → {Kekule.IO.ChemDataReader}

Create a new reader instance by id.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) createReaderByMimeType(mimeType) → {Kekule.IO.ChemDataReader}

Create a new reader instance by MIME type.
Parameters:
Name Type Description
mimeType String
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) getAllReadableFormatIds() → {Array}

Returns all file format IDs that has corresponding reader.
Source:
Returns:
Array of format id.
Type
Array

(static) getAllReadableFormats() → {Array}

Returns all file formats that has corresponding reader.
Source:
Returns:
Array of format object.
Type
Array

(static) getAvailableReaderInfos(condition) → {Array}

Get all available reader infos by condition provided and be suitable for targetClass. For example: Kekule.IO.ChemDataReaderManager.getAvailableReaderInfos({'id': 'mol'});
Parameters:
Name Type Description
condition Hash
Source:
Returns:
Type
Array

(static) getReader(condition) → {Kekule.IO.ChemDataReader}

Get a reusable reader instance by condition.
Parameters:
Name Type Description
condition Hash
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) getReaderByFileExt(fileExt, otherConditions) → {Kekule.IO.ChemDataReader}

Get reader instance by file ext.
Parameters:
Name Type Description
fileExt String
otherConditions Hash
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) getReaderByFormat(fileExt, otherConditions) → {Kekule.IO.ChemDataReader}

Get reader instance by format Id.
Parameters:
Name Type Description
fileExt String
otherConditions Hash
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) getReaderById(id) → {Kekule.IO.ChemDataReader}

Get a reusable reader instance by id.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) getReaderByMimeType(mimeType) → {Kekule.IO.ChemDataReader}

Get a reusable reader instance by MIME type.
Parameters:
Name Type Description
mimeType String
Source:
Returns:
Type
Kekule.IO.ChemDataReader

(static) getReaderInfo(condition) → {Hash}

Get reader information by condition provided. For example: Kekule.IO.ChemDataWriterManager.getReaderInfo({'formatId': 'cml'});
Parameters:
Name Type Description
condition Hash
Source:
Returns:
Type
Hash

(static) getReaderInfoByFileExt(fileExt, otherConditions) → {Hash}

Get reader information by file ext.
Parameters:
Name Type Description
fileExt String
otherConditions Hash
Source:
Returns:
Type
Hash

(static) getReaderInfoByFormat(formatId, otherConditions) → {Hash}

Get reader information by data format id.
Parameters:
Name Type Description
formatId String
otherConditions Hash
Source:
Returns:
Type
Hash

(static) getReaderInfoById(id) → {Hash}

Get reader information by Id.
Parameters:
Name Type Description
id String
Source:
Returns:
Type
Hash

(static) register(id, readerClass, formatId, additionalInfo)

Register a data reader.
Parameters:
Name Type Description
id String A UID string for reader.
readerClass Class Class of reader.
formatId Variant String or Array, associated format IDs.
additionalInfo Hash More information on this reader class. Can include the following fields: { {Hash} createOptions: hash passed into reader's constructor. (String) title: Reader title, {String} formatId: id of data format //(String) mimeType //(Variant) fileExt: if load from a file, the file ext. Can be a string or Array of string. }
Source:

(static) unregister(id)

Unregister a data reader.
Parameters:
Name Type Description
id String A UID string for reader.
Source: