Click or drag to resize

mxObjectCodecDecode Method

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Overload List
  NameDescription
Public methodDecode(mxCodec, XmlNode)
Parses the given node into the object or returns a new object representing the given node.
Public methodDecode(mxCodec, XmlNode, Object)
Parses the given node into the object or returns a new object representing the given node. Dec is a reference to the calling decoder. It is used to decode complex objects and resolve references. If a node has an id attribute then the object cache is checked for the object. If the object is not yet in the cache then it is constructed using the constructor of template and cached in mxCodec.objects. This implementation decodes all attributes and childs of a node according to the following rules: - If the variable name is in exclude or if the attribute name is "id" or "as" then it is ignored. - If the variable name is in idrefs then mxCodec.getObject is used to replace the reference with an object. - The variable name is mapped using a reverse mapping. - If the value has a child node, then the codec is used to create a child object with the variable name taken from the "as" attribute. - If the object is an array and the variable name is empty then the value or child object is appended to the array. - If an add child has no value or the object is not an array then the child text content is evaluated using mxUtils.eval. If no object exists for an ID in idrefs a warning is issued using mxLog.warn. Returns the resulting object that represents the given XML node or the configured given object.
Top
See Also