new ChemDataWriterManager()
A manager to create suitable data writer.
- Source:
Methods
-
(static) createWriter(condition, srcObj) → {Kekule.IO.ChemDataWriter}
-
Create a new writer instance by condition and suitable for srcObj.
Parameters:
Name Type Description condition
Hash srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) createWriterByFileExt(fileExt, otherConditions, srcObj) → {Kekule.IO.ChemDataWriter}
-
Create writer instance by file ext.
Parameters:
Name Type Description fileExt
String otherConditions
Hash srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) createWriterByFormat(formatId, otherConditions) → {Kekule.IO.ChemDataWriter}
-
Create new writer instance by formatId.
Parameters:
Name Type Description formatId
String otherConditions
Hash - Source:
Returns:
-
(static) createWriterById(id, srcObj) → {Kekule.IO.ChemDataWriter}
-
Create a new writer instance by id and meet srcObj.
Parameters:
Name Type Description id
String srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) createWriterByMimeType(mimeType, srcObj) → {Kekule.IO.ChemDataWriter}
-
Create a new reader instance by MIME type.
Parameters:
Name Type Description mimeType
String srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) getAllWritableFormatIds() → {Array}
-
Returns all file format IDs that has corresponding writer.
- Source:
Returns:
Array of format id.- Type
- Array
-
(static) getAllWritableFormats() → {Array}
-
Returns all file formats that has corresponding writer.
- Source:
Returns:
Array of format object.- Type
- Array
-
(static) getAvailableWriterInfos(condition, srcObjOrClass) → {Array}
-
Get all available writer infos by condition provided and suitble for srcObj. For example: Kekule.IO.ChemDataWriterManager.getWriterInfo({'id': 'mol'});
Parameters:
Name Type Description condition
Hash srcObjOrClass
Variant - Source:
Returns:
- Type
- Array
-
(static) getWriter(condition, srcObj) → {Kekule.IO.ChemDataWriter}
-
Get a reusable writer instance by condition and suitable for srcObj.
Parameters:
Name Type Description condition
Hash srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) getWriterByFileExt(fileExt, otherConditions, srcObj) → {Kekule.IO.ChemDataWriter}
-
Get a reusbale writer instance by file ext.
Parameters:
Name Type Description fileExt
String otherConditions
Hash srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) getWriterByFormat(formatId, otherConditions) → {Kekule.IO.ChemDataWriter}
-
Get new writer instance by formatId.
Parameters:
Name Type Description formatId
String otherConditions
Hash - Source:
Returns:
-
(static) getWriterById(id, srcObj) → {Kekule.IO.ChemDataWriter}
-
Get a reusable writer instance by id and meet srcObj.
Parameters:
Name Type Description id
String srcObj
Kekule.ChemObject - Source:
Returns:
-
(static) getWriterByMimeType(mimeType) → {Kekule.IO.ChemDataWriter}
-
Get a reusable new reader instance by MIME type.
Parameters:
Name Type Description mimeType
String - Source:
Returns:
-
(static) getWriterInfo(condition, srcObj) → {Hash}
-
Get writer info by condition provided and suitble for srcObj. For example: Kekule.IO.ChemDataWriterManager.getWriterInfo({'id': 'mol'});
Parameters:
Name Type Description condition
Hash srcObj
Kekule.ChemObject - Source:
Returns:
- Type
- Hash
-
(static) getWriterInfoByFileExt(fileExt, otherConditions, srcObj) → {Hash}
-
Get writer information by file ext.
Parameters:
Name Type Description fileExt
String otherConditions
Hash srcObj
Kekule.ChemObject - Source:
Returns:
- Type
- Hash
-
(static) getWriterInfoByFormat(formatId, otherConditions) → {Hash}
-
Get writer information by data format id.
Parameters:
Name Type Description formatId
String otherConditions
Hash - Source:
Returns:
- Type
- Hash
-
(static) getWriterInfoById(id, srcObj) → {Hash}
-
Get writer information by Id.
Parameters:
Name Type Description id
String srcObj
Kekule.ChemObject - Source:
Returns:
- Type
- Hash
-
(static) register(id, writerClass, srcClasses, formatId, additionalInfo)
-
Register a data writer.
Parameters:
Name Type Description id
String A UID string for writer. writerClass
Class Class of writer. srcClasses
Array Instance of which classes can be written by this writer. formatId
Variant Data format, string or array. additionalInfo
Hash More information on this reader class. Can include the following fields: { {Hash} createOptions: hash passed into writer's constructor. (String) title: Writer title, (String) mimeType (String) fileExt: if write to a file, the file ext. } - Source:
-
(static) unregister(id)
-
Unregister a data writer.
Parameters:
Name Type Description id
String A UID string for reader. - Source: