Class: CmlElementWriter

Kekule.IO. CmlElementWriter

new CmlElementWriter()

Base class of readers to read different CML elements.
Source:

Extends

Methods

doCreateElem(obj, parentElem) → {Object}

Create suitable new child element to write obj. Descendants may override this method.
Parameters:
Name Type Description
obj Kekule.ChemObject
parentElem Object
Source:
Returns:
Element created.
Type
Object

doWriteObject(obj, targetElem) → {Object}

Method to do the actual writeObject job. Descendants should override this method.
Parameters:
Name Type Description
obj Kekule.ChemObject
targetElem Object
Source:
Returns:
Type
Object

reportTypeMismatchError(obj)

Report this writer is not proper for writing obj.
Parameters:
Name Type Description
obj Object
Source:

writeObject(obj, parentElem, doc) → {Object}

Write Kekule obj to a new CML element in doc or insert new attributes to parentElem.
Parameters:
Name Type Description
obj Kekule.ChemObject
parentElem Object
doc Object
Source:
Returns:
Element created.
Type
Object