132 lines
98 KiB
HTML
132 lines
98 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
|
|
<html><head><title>mxObjectCodec</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
|
|
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
|
|
|
|
<!-- Generated by Natural Docs, version 1.5 -->
|
|
<!-- http://www.naturaldocs.org -->
|
|
|
|
<!-- saved from url=(0026)http://www.naturaldocs.org -->
|
|
|
|
|
|
|
|
|
|
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="mxObjectCodec"></a>mxObjectCodec</h1><div class=CBody><p>Generic codec for JavaScript objects that implements a mapping between JavaScript objects and XML nodes that maps each field or element to an attribute or child node, and vice versa.</p><h4 class=CHeading>Atomic Values</h4><p>Consider the following example.</p><blockquote><pre class="prettyprint">var obj = new Object();
|
|
obj.foo = "Foo";
|
|
obj.bar = "Bar";</pre></blockquote><p>This object is encoded into an XML node using the following.</p><blockquote><pre class="prettyprint">var enc = new mxCodec();
|
|
var node = enc.encode(obj);</pre></blockquote><p>The output of the encoding may be viewed using <a href="../util/mxLog-js.html#mxLog" class=LClass id=link43 onMouseOver="ShowTip(event, 'tt34', 'link43')" onMouseOut="HideTip('tt34')">mxLog</a> as follows.</p><blockquote><pre class="prettyprint">mxLog.show();
|
|
mxLog.debug(mxUtils.getPrettyXml(node));</pre></blockquote><p>Finally, the result of the encoding looks as follows.</p><blockquote><pre class="prettyprint"><Object foo="Foo" bar="Bar"/></pre></blockquote><p>In the above output, the foo and bar fields have been mapped to attributes with the same names, and the name of the constructor was used for the nodename.</p><h4 class=CHeading>Booleans</h4><p>Since booleans are numbers in JavaScript, all boolean values are encoded into 1 for true and 0 for false. The decoder also accepts the string true and false for boolean values.</p><h4 class=CHeading>Objects</h4><p>The above scheme is applied to all atomic fields, that is, to all non-object fields of an object. For object fields, a child node is created with a special attribute that contains the fieldname. This special attribute is called “as” and hence, as is a reserved word that should not be used for a fieldname.</p><p>Consider the following example where foo is an object and bar is an atomic property of foo.</p><blockquote><pre class="prettyprint">var obj = {foo: {bar: "Bar"}};</pre></blockquote><p>This will be mapped to the following XML structure by mxObjectCodec.</p><blockquote><pre class="prettyprint"><Object>
|
|
<Object bar="Bar" as="foo"/>
|
|
</Object></pre></blockquote><p>In the above output, the inner Object node contains the as-attribute that specifies the fieldname in the enclosing object. That is, the field foo was mapped to a child node with an as-attribute that has the value foo.</p><h4 class=CHeading>Arrays</h4><p>Arrays are special objects that are either associative, in which case each key, value pair is treated like a field where the key is the fieldname, or they are a sequence of atomic values and objects, which is mapped to a sequence of child nodes. For object elements, the above scheme is applied without the use of the special as-attribute for creating each child. For atomic elements, a special add-node is created with the value stored in the value-attribute.</p><p>For example, the following array contains one atomic value and one object with a field called bar. Furthermore it contains two associative entries called bar with an atomic value, and foo with an object value.</p><blockquote><pre class="prettyprint">var obj = ["Bar", {bar: "Bar"}];
|
|
obj["bar"] = "Bar";
|
|
obj["foo"] = {bar: "Bar"};</pre></blockquote><p>This array is represented by the following XML nodes.</p><blockquote><pre class="prettyprint"><Array bar="Bar">
|
|
<add value="Bar"/>
|
|
<Object bar="Bar"/>
|
|
<Object bar="Bar" as="foo"/>
|
|
</Array></pre></blockquote><p>The Array node name is the name of the constructor. The additional as-attribute in the last child contains the key of the associative entry, whereas the second last child is part of the array sequence and does not have an as-attribute.</p><h4 class=CHeading>References</h4><p>Objects may be represented as child nodes or attributes with ID values, which are used to lookup the object in a table within <a href="mxCodec-js.html#mxCodec" class=LClass id=link44 onMouseOver="ShowTip(event, 'tt35', 'link44')" onMouseOut="HideTip('tt35')">mxCodec</a>. The <a href="#mxObjectCodec.isReference" class=LFunction id=link45 onMouseOver="ShowTip(event, 'tt12', 'link45')" onMouseOut="HideTip('tt12')">isReference</a> function is in charge of deciding if a specific field should be encoded as a reference or not. Its default implementation returns true if the fieldname is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link46 onMouseOver="ShowTip(event, 'tt4', 'link46')" onMouseOut="HideTip('tt4')">idrefs</a>, an array of strings that is used to configure the <a href="#mxObjectCodec.mxObjectCodec" class=LFunction id=link47 onMouseOver="ShowTip(event, 'tt1', 'link47')" onMouseOut="HideTip('tt1')">mxObjectCodec</a>.</p><p>Using this approach, the mapping does not guarantee that the referenced object itself exists in the document. The fields that are encoded as references must be carefully chosen to make sure all referenced objects exist in the document, or may be resolved by some other means if necessary.</p><p>For example, in the case of the graph model all cells are stored in a tree whose root is referenced by the model’s root field. A tree is a structure that is well suited for an XML representation, however, the additional edges in the graph model have a reference to a source and target cell, which are also contained in the tree. To handle this case, the source and target cell of an edge are treated as references, whereas the children are treated as objects. Since all cells are contained in the tree and no edge references a source or target outside the tree, this setup makes sure all referenced objects are contained in the document.</p><p>In the case of a tree structure we must further avoid infinite recursion by ignoring the parent reference of each child. This is done by returning true in <a href="#mxObjectCodec.isExcluded" class=LFunction id=link48 onMouseOver="ShowTip(event, 'tt11', 'link48')" onMouseOut="HideTip('tt11')">isExcluded</a>, whose default implementation uses the array of excluded fieldnames passed to the mxObjectCodec constructor.</p><p>References are only used for cells in mxGraph. For defining other referencable object types, the codec must be able to work out the ID of an object. This is done by implementing <a href="mxCodec-js.html#mxCodec.reference" class=LFunction id=link49 onMouseOver="ShowTip(event, 'tt36', 'link49')" onMouseOut="HideTip('tt36')">mxCodec.reference</a>. For decoding a reference, the XML node with the respective id-attribute is fetched from the document, decoded, and stored in a lookup table for later reference. For looking up external objects, <a href="mxCodec-js.html#mxCodec.lookup" class=LFunction id=link50 onMouseOver="ShowTip(event, 'tt37', 'link50')" onMouseOut="HideTip('tt37')">mxCodec.lookup</a> may be implemented.</p><h4 class=CHeading>Expressions</h4><p>For decoding JavaScript expressions, the add-node may be used with a text content that contains the JavaScript expression. For example, the following creates a field called foo in the enclosing object and assigns it the value of <a href="../util/mxConstants-js.html#mxConstants.ALIGN_LEFT" class=LVariable id=link51 onMouseOver="ShowTip(event, 'tt38', 'link51')" onMouseOut="HideTip('tt38')">mxConstants.ALIGN_LEFT</a>.</p><blockquote><pre class="prettyprint"><Object>
|
|
<add as="foo">mxConstants.ALIGN_LEFT</add>
|
|
</Object></pre></blockquote><p>The resulting object has a field called foo with the value “left”. Its XML representation looks as follows.</p><blockquote><pre class="prettyprint"><Object foo="left"/></pre></blockquote><p>This means the expression is evaluated at decoding time and the result of the evaluation is stored in the respective field. Valid expressions are all JavaScript expressions, including function definitions, which are mapped to functions on the resulting object.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#mxObjectCodec" >mxObjectCodec</a></td><td class=SDescription>Generic codec for JavaScript objects that implements a mapping between JavaScript objects and XML nodes that maps each field or element to an attribute or child node, and vice versa.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxObjectCodec.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.mxObjectCodec" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">mxObjectCodec</a></td><td class=SDescription>Constructs a new codec for the specified template object. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxObjectCodec.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.template" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">template</a></td><td class=SDescription>Holds the template object associated with this codec.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxObjectCodec.exclude" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">exclude</a></td><td class=SDescription>Array containing the variable names that should be ignored by the codec.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.idrefs" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">idrefs</a></td><td class=SDescription>Array containing the variable names that should be turned into or converted from references. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxObjectCodec.mapping" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">mapping</a></td><td class=SDescription>Maps from from fieldnames to XML attribute names.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.reverse" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">reverse</a></td><td class=SDescription>Maps from from XML attribute names to fieldnames.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxObjectCodec.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.getName" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">getName</a></td><td class=SDescription>Returns the name used for the nodenames and lookup of the codec when classes are encoded and nodes are decoded. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.cloneTemplate" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">cloneTemplate</a></td><td class=SDescription>Returns a new instance of the template for this codec.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.getFieldName" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">getFieldName</a></td><td class=SDescription>Returns the fieldname for the given attributename. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.getAttributeName" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">getAttributeName</a></td><td class=SDescription>Returns the attributename for the given fieldname. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.isExcluded" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">isExcluded</a></td><td class=SDescription>Returns true if the given attribute is to be ignored by the codec. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.isReference" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">isReference</a></td><td class=SDescription>Returns true if the given fieldname is to be treated as a textual reference (ID). </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.encode" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">encode</a></td><td class=SDescription>Encodes the specified object and returns a node representing then given object. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.encodeObject" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">encodeObject</a></td><td class=SDescription>Encodes the value of each member in then given obj into the given node using <a href="#mxObjectCodec.encodeValue" class=LFunction id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">encodeValue</a>.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.encodeValue" id=link16 onMouseOver="ShowTip(event, 'tt15', 'link16')" onMouseOut="HideTip('tt15')">encodeValue</a></td><td class=SDescription>Converts the given value according to the mappings and id-refs in this codec and uses <a href="#mxObjectCodec.writeAttribute" class=LFunction id=link17 onMouseOver="ShowTip(event, 'tt16', 'link17')" onMouseOut="HideTip('tt16')">writeAttribute</a> to write the attribute into the given node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.writeAttribute" id=link18 onMouseOver="ShowTip(event, 'tt16', 'link18')" onMouseOut="HideTip('tt16')">writeAttribute</a></td><td class=SDescription>Writes the given value into node using <a href="#mxObjectCodec.writePrimitiveAttribute" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt17', 'link19')" onMouseOut="HideTip('tt17')">writePrimitiveAttribute</a> or <a href="#mxObjectCodec.writeComplexAttribute" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt18', 'link20')" onMouseOut="HideTip('tt18')">writeComplexAttribute</a> depending on the type of the value.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.writePrimitiveAttribute" id=link21 onMouseOver="ShowTip(event, 'tt17', 'link21')" onMouseOut="HideTip('tt17')">writePrimitiveAttribute</a></td><td class=SDescription>Writes the given value as an attribute of the given node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.writeComplexAttribute" id=link22 onMouseOver="ShowTip(event, 'tt18', 'link22')" onMouseOut="HideTip('tt18')">writeComplexAttribute</a></td><td class=SDescription>Writes the given value as a child node of the given node.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.convertValueToXml" id=link23 onMouseOver="ShowTip(event, 'tt19', 'link23')" onMouseOut="HideTip('tt19')">convertValueToXml</a></td><td class=SDescription>Converts true to “1” and false to “0”. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.convertValueFromXml" id=link24 onMouseOver="ShowTip(event, 'tt20', 'link24')" onMouseOut="HideTip('tt20')">convertValueFromXml</a></td><td class=SDescription>Converts booleans and numeric values to the respective types.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.beforeEncode" id=link25 onMouseOver="ShowTip(event, 'tt21', 'link25')" onMouseOut="HideTip('tt21')">beforeEncode</a></td><td class=SDescription>Hook for subclassers to pre-process the object before encoding. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.afterEncode" id=link26 onMouseOver="ShowTip(event, 'tt22', 'link26')" onMouseOut="HideTip('tt22')">afterEncode</a></td><td class=SDescription>Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.decode" id=link27 onMouseOver="ShowTip(event, 'tt23', 'link27')" onMouseOut="HideTip('tt23')">decode</a></td><td class=SDescription>Parses the given node into the object or returns a new object representing the given node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.decodeNode" id=link28 onMouseOver="ShowTip(event, 'tt24', 'link28')" onMouseOut="HideTip('tt24')">decodeNode</a></td><td class=SDescription>Calls <a href="#mxObjectCodec.decodeAttributes" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt25', 'link29')" onMouseOut="HideTip('tt25')">decodeAttributes</a> and <a href="#mxObjectCodec.decodeChildren" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt26', 'link30')" onMouseOut="HideTip('tt26')">decodeChildren</a> for the given node.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.decodeAttributes" id=link31 onMouseOver="ShowTip(event, 'tt25', 'link31')" onMouseOut="HideTip('tt25')">decodeAttributes</a></td><td class=SDescription>Decodes all attributes of the given node using <a href="#mxObjectCodec.decodeAttribute" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt27', 'link32')" onMouseOut="HideTip('tt27')">decodeAttribute</a>.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.decodeAttribute" id=link33 onMouseOver="ShowTip(event, 'tt27', 'link33')" onMouseOut="HideTip('tt27')">decodeAttribute</a></td><td class=SDescription>Reads the given attribute into the specified object.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.decodeChildren" id=link34 onMouseOver="ShowTip(event, 'tt26', 'link34')" onMouseOut="HideTip('tt26')">decodeChildren</a></td><td class=SDescription>Decodec all children of the given node using <a href="#mxObjectCodec.decodeChild" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt28', 'link35')" onMouseOut="HideTip('tt28')">decodeChild</a>.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.decodeChild" id=link36 onMouseOver="ShowTip(event, 'tt28', 'link36')" onMouseOut="HideTip('tt28')">decodeChild</a></td><td class=SDescription>Reads the specified child into the given object.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.getFieldTemplate" id=link37 onMouseOver="ShowTip(event, 'tt29', 'link37')" onMouseOut="HideTip('tt29')">getFieldTemplate</a></td><td class=SDescription>Returns the template instance for the given field. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.addObjectValue" id=link38 onMouseOver="ShowTip(event, 'tt30', 'link38')" onMouseOut="HideTip('tt30')">addObjectValue</a></td><td class=SDescription>Sets the decoded child node as a value of the given object. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.processInclude" id=link39 onMouseOver="ShowTip(event, 'tt31', 'link39')" onMouseOut="HideTip('tt31')">processInclude</a></td><td class=SDescription>Returns true if the given node is an include directive and executes the include by decoding the XML document. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.beforeDecode" id=link40 onMouseOver="ShowTip(event, 'tt32', 'link40')" onMouseOut="HideTip('tt32')">beforeDecode</a></td><td class=SDescription>Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by <a href="#mxObjectCodec.decode" class=LFunction id=link41 onMouseOver="ShowTip(event, 'tt23', 'link41')" onMouseOut="HideTip('tt23')">decode</a>. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.afterDecode" id=link42 onMouseOver="ShowTip(event, 'tt33', 'link42')" onMouseOut="HideTip('tt33')">afterDecode</a></td><td class=SDescription>Hook for subclassers to post-process the object after decoding. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.mxObjectCodec"></a>mxObjectCodec</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxObjectCodec(</td><td class=PParameter nowrap>template,</td></tr><tr><td></td><td class=PParameter nowrap>exclude,</td></tr><tr><td></td><td class=PParameter nowrap>idrefs,</td></tr><tr><td></td><td class=PParameter nowrap>mapping</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes. The argument is created as follows:</p><blockquote><pre class="prettyprint">var mapping = new Object();
|
|
mapping['variableName'] = 'attribute-name';</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>template</td><td class=CDLDescription>Prototypical instance of the object to be encoded/decoded.</td></tr><tr><td class=CDLEntry>exclude</td><td class=CDLDescription>Optional array of fieldnames to be ignored.</td></tr><tr><td class=CDLEntry>idrefs</td><td class=CDLDescription>Optional array of fieldnames to be converted to/from references.</td></tr><tr><td class=CDLEntry>mapping</td><td class=CDLDescription>Optional mapping from field- to attributenames.</td></tr></table></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.Variables"></a>Variables</h3></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.template"></a>template</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.template</td></tr></table></blockquote><p>Holds the template object associated with this codec.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.exclude"></a>exclude</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.exclude</td></tr></table></blockquote><p>Array containing the variable names that should be ignored by the codec.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.idrefs"></a>idrefs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.idrefs</td></tr></table></blockquote><p>Array containing the variable names that should be turned into or converted from references. See <a href="mxCodec-js.html#mxCodec.getId" class=LFunction id=link52 onMouseOver="ShowTip(event, 'tt39', 'link52')" onMouseOut="HideTip('tt39')">mxCodec.getId</a> and <a href="mxCodec-js.html#mxCodec.getObject" class=LFunction id=link53 onMouseOver="ShowTip(event, 'tt40', 'link53')" onMouseOut="HideTip('tt40')">mxCodec.getObject</a>.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.mapping"></a>mapping</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.mapping</td></tr></table></blockquote><p>Maps from from fieldnames to XML attribute names.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.reverse"></a>reverse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.reverse</td></tr></table></blockquote><p>Maps from from XML attribute names to fieldnames.</p></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getName"></a>getName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.getName = function()</td></tr></table></blockquote><p>Returns the name used for the nodenames and lookup of the codec when classes are encoded and nodes are decoded. For classes to work with this the codec registry automatically adds an alias for the classname if that is different than what this returns. The default implementation returns the classname of the template class.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.cloneTemplate"></a>cloneTemplate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.cloneTemplate = function()</td></tr></table></blockquote><p>Returns a new instance of the template for this codec.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getFieldName"></a>getFieldName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.getFieldName = function(</td><td class=PParameter nowrap>attributename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the fieldname for the given attributename. Looks up the value in the <a href="#mxObjectCodec.reverse" class=LVariable id=link54 onMouseOver="ShowTip(event, 'tt6', 'link54')" onMouseOut="HideTip('tt6')">reverse</a> mapping or returns the input if there is no reverse mapping for the given name.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getAttributeName"></a>getAttributeName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.getAttributeName = function(</td><td class=PParameter nowrap>fieldname</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the attributename for the given fieldname. Looks up the value in the <a href="#mxObjectCodec.mapping" class=LVariable id=link55 onMouseOver="ShowTip(event, 'tt5', 'link55')" onMouseOut="HideTip('tt5')">mapping</a> or returns the input if there is no mapping for the given name.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.isExcluded"></a>isExcluded</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.isExcluded = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given attribute is to be ignored by the codec. This implementation returns true if the given fieldname is in <a href="#mxObjectCodec.exclude" class=LVariable id=link56 onMouseOver="ShowTip(event, 'tt3', 'link56')" onMouseOut="HideTip('tt3')">exclude</a> or if the fieldname equals <a href="../util/mxObjectIdentity-js.html#mxObjectIdentity.FIELD_NAME" class=LVariable id=link57 onMouseOver="ShowTip(event, 'tt41', 'link57')" onMouseOut="HideTip('tt41')">mxObjectIdentity.FIELD_NAME</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object instance that contains the field.</td></tr><tr><td class=CDLEntry>attr</td><td class=CDLDescription>Fieldname of the field.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the field.</td></tr><tr><td class=CDLEntry>write</td><td class=CDLDescription>Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.isReference"></a>isReference</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.isReference = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given fieldname is to be treated as a textual reference (ID). This implementation returns true if the given fieldname is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link58 onMouseOver="ShowTip(event, 'tt4', 'link58')" onMouseOut="HideTip('tt4')">idrefs</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object instance that contains the field.</td></tr><tr><td class=CDLEntry>attr</td><td class=CDLDescription>Fieldname of the field.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the field.</td></tr><tr><td class=CDLEntry>write</td><td class=CDLDescription>Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.encode"></a>encode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.encode = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the specified object and returns a node representing then given object. Calls <a href="#mxObjectCodec.beforeEncode" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt21', 'link59')" onMouseOut="HideTip('tt21')">beforeEncode</a> after creating the node and <a href="#mxObjectCodec.afterEncode" class=LFunction id=link60 onMouseOver="ShowTip(event, 'tt22', 'link60')" onMouseOut="HideTip('tt22')">afterEncode</a> with the resulting node after processing.</p><p>Enc is a reference to the calling encoder. It is used to encode complex objects and create references.</p><p>This implementation encodes all variables of an object according to the following rules:</p><ul><li>If the variable name is in <a href="#mxObjectCodec.exclude" class=LVariable id=link61 onMouseOver="ShowTip(event, 'tt3', 'link61')" onMouseOut="HideTip('tt3')">exclude</a> then it is ignored.</li><li>If the variable name is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link62 onMouseOver="ShowTip(event, 'tt4', 'link62')" onMouseOut="HideTip('tt4')">idrefs</a> then <a href="mxCodec-js.html#mxCodec.getId" class=LFunction id=link63 onMouseOver="ShowTip(event, 'tt39', 'link63')" onMouseOut="HideTip('tt39')">mxCodec.getId</a> is used to replace the object with its ID.</li><li>The variable name is mapped using <a href="#mxObjectCodec.mapping" class=LVariable id=link64 onMouseOver="ShowTip(event, 'tt5', 'link64')" onMouseOut="HideTip('tt5')">mapping</a>.</li><li>If obj is an array and the variable name is numeric (ie. an index) then it is not encoded.</li><li>If the value is an object, then the codec is used to create a child node with the variable name encoded into the “as” attribute.</li><li>Else, if <encodeDefaults> is true or the value differs from the template value, then ...</li><li>... if obj is not an array, then the value is mapped to an attribute.</li><li>... else if obj is an array, the value is mapped to an add child with a value attribute or a text child node, if the value is a function.</li></ul><p>If no ID exists for a variable in <a href="#mxObjectCodec.idrefs" class=LVariable id=link65 onMouseOver="ShowTip(event, 'tt4', 'link65')" onMouseOut="HideTip('tt4')">idrefs</a> or if an object cannot be encoded, a warning is issued using <a href="../util/mxLog-js.html#mxLog.warn" class=LFunction id=link66 onMouseOver="ShowTip(event, 'tt42', 'link66')" onMouseOut="HideTip('tt42')">mxLog.warn</a>.</p><p>Returns the resulting XML node that represents the given object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link67 onMouseOver="ShowTip(event, 'tt35', 'link67')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.encodeObject"></a>encodeObject</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.encodeObject = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the value of each member in then given obj into the given node using <a href="#mxObjectCodec.encodeValue" class=LFunction id=link68 onMouseOver="ShowTip(event, 'tt15', 'link68')" onMouseOut="HideTip('tt15')">encodeValue</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link69 onMouseOver="ShowTip(event, 'tt35', 'link69')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node that contains the encoded object.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.encodeValue"></a>encodeValue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.encodeValue = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts the given value according to the mappings and id-refs in this codec and uses <a href="#mxObjectCodec.writeAttribute" class=LFunction id=link70 onMouseOver="ShowTip(event, 'tt16', 'link70')" onMouseOut="HideTip('tt16')">writeAttribute</a> to write the attribute into the given node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link71 onMouseOver="ShowTip(event, 'tt35', 'link71')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object whose property is going to be encoded.</td></tr><tr><td class=CDLEntry>name</td><td class=CDLDescription>XML node that contains the encoded object.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the property to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node that contains the encoded object.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.writeAttribute"></a>writeAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.writeAttribute = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the given value into node using <a href="#mxObjectCodec.writePrimitiveAttribute" class=LFunction id=link72 onMouseOver="ShowTip(event, 'tt17', 'link72')" onMouseOut="HideTip('tt17')">writePrimitiveAttribute</a> or <a href="#mxObjectCodec.writeComplexAttribute" class=LFunction id=link73 onMouseOver="ShowTip(event, 'tt18', 'link73')" onMouseOut="HideTip('tt18')">writeComplexAttribute</a> depending on the type of the value.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.writePrimitiveAttribute"></a>writePrimitiveAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.writePrimitiveAttribute = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the given value as an attribute of the given node.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.writeComplexAttribute"></a>writeComplexAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.writeComplexAttribute = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the given value as a child node of the given node.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.convertValueToXml"></a>convertValueToXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.convertValueToXml = function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts true to “1” and false to “0”. All other values are ignored.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.convertValueFromXml"></a>convertValueFromXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.convertValueFromXml = function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts booleans and numeric values to the respective types.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.beforeEncode"></a>beforeEncode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.beforeEncode = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to pre-process the object before encoding. This returns the input object. The return value of this function is used in <a href="#mxObjectCodec.encode" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt13', 'link74')" onMouseOut="HideTip('tt13')">encode</a> to perform the default encoding into the given node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link75 onMouseOver="ShowTip(event, 'tt35', 'link75')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to encode the object into.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.afterEncode"></a>afterEncode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.afterEncode = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. This implementation returns the input node. The return value of this method is returned to the encoder from <a href="#mxObjectCodec.encode" class=LFunction id=link76 onMouseOver="ShowTip(event, 'tt13', 'link76')" onMouseOut="HideTip('tt13')">encode</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link77 onMouseOver="ShowTip(event, 'tt35', 'link77')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node that represents the default encoding.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decode"></a>decode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>into</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Parses the given node into the object or returns a new object representing the given node.</p><p>Dec is a reference to the calling decoder. It is used to decode complex objects and resolve references.</p><p>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 <a href="#mxObjectCodec.template" class=LVariable id=link78 onMouseOver="ShowTip(event, 'tt2', 'link78')" onMouseOut="HideTip('tt2')">template</a> and cached in <a href="mxCodec-js.html#mxCodec.objects" class=LVariable id=link79 onMouseOver="ShowTip(event, 'tt43', 'link79')" onMouseOut="HideTip('tt43')">mxCodec.objects</a>.</p><p>This implementation decodes all attributes and childs of a node according to the following rules:</p><ul><li>If the variable name is in <a href="#mxObjectCodec.exclude" class=LVariable id=link80 onMouseOver="ShowTip(event, 'tt3', 'link80')" onMouseOut="HideTip('tt3')">exclude</a> or if the attribute name is “id” or “as” then it is ignored.</li><li>If the variable name is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link81 onMouseOver="ShowTip(event, 'tt4', 'link81')" onMouseOut="HideTip('tt4')">idrefs</a> then <a href="mxCodec-js.html#mxCodec.getObject" class=LFunction id=link82 onMouseOver="ShowTip(event, 'tt40', 'link82')" onMouseOut="HideTip('tt40')">mxCodec.getObject</a> is used to replace the reference with an object.</li><li>The variable name is mapped using a reverse <a href="#mxObjectCodec.mapping" class=LVariable id=link83 onMouseOver="ShowTip(event, 'tt5', 'link83')" onMouseOut="HideTip('tt5')">mapping</a>.</li><li>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.</li><li>If the object is an array and the variable name is empty then the value or child object is appended to the array.</li><li>If an add child has no value or the object is not an array then the child text content is evaluated using <a href="../util/mxUtils-js.html#mxUtils.eval" class=LFunction id=link84 onMouseOver="ShowTip(event, 'tt44', 'link84')" onMouseOut="HideTip('tt44')">mxUtils.eval</a>.</li></ul><p>For add nodes where the object is not an array and the variable name is defined, the default mechanism is used, allowing to override/add methods as follows:</p><blockquote><pre class="prettyprint"><Object>
|
|
<add as="hello"><![CDATA[
|
|
function(arg1) {
|
|
mxUtils.alert('Hello '+arg1);
|
|
}
|
|
]]></add>
|
|
</Object></pre></blockquote><p>If no object exists for an ID in <a href="#mxObjectCodec.idrefs" class=LVariable id=link85 onMouseOver="ShowTip(event, 'tt4', 'link85')" onMouseOut="HideTip('tt4')">idrefs</a> a warning is issued using <a href="../util/mxLog-js.html#mxLog.warn" class=LFunction id=link86 onMouseOver="ShowTip(event, 'tt42', 'link86')" onMouseOut="HideTip('tt42')">mxLog.warn</a>.</p><p>Returns the resulting object that represents the given XML node or the object given to the method as the into parameter.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dec</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link87 onMouseOver="ShowTip(event, 'tt35', 'link87')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the decoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be decoded.</td></tr><tr><td class=CDLEntry>into</td><td class=CDLDescription>Optional objec to encode the node into.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeNode"></a>decodeNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeNode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Calls <a href="#mxObjectCodec.decodeAttributes" class=LFunction id=link88 onMouseOver="ShowTip(event, 'tt25', 'link88')" onMouseOut="HideTip('tt25')">decodeAttributes</a> and <a href="#mxObjectCodec.decodeChildren" class=LFunction id=link89 onMouseOver="ShowTip(event, 'tt26', 'link89')" onMouseOut="HideTip('tt26')">decodeChildren</a> for the given node.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeAttributes"></a>decodeAttributes</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeAttributes = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes all attributes of the given node using <a href="#mxObjectCodec.decodeAttribute" class=LFunction id=link90 onMouseOver="ShowTip(event, 'tt27', 'link90')" onMouseOut="HideTip('tt27')">decodeAttribute</a>.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeAttribute"></a>decodeAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeAttribute = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the given attribute into the specified object.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeChildren"></a>decodeChildren</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeChildren = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodec all children of the given node using <a href="#mxObjectCodec.decodeChild" class=LFunction id=link91 onMouseOver="ShowTip(event, 'tt28', 'link91')" onMouseOut="HideTip('tt28')">decodeChild</a>.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeChild"></a>decodeChild</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeChild = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>child,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the specified child into the given object.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getFieldTemplate"></a>getFieldTemplate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.getFieldTemplate = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>fieldname,</td></tr><tr><td></td><td class=PParameter nowrap>child</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the template instance for the given field. This returns the value of the field, null if the value is an array or an empty collection if the value is a collection. The value is then used to populate the field for a new instance. For strongly typed languages it may be required to override this to return the correct collection instance based on the encoded child.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.addObjectValue"></a>addObjectValue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.addObjectValue = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>fieldname,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>template</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the decoded child node as a value of the given object. If the object is a map, then the value is added with the given fieldname as a key. If the fieldname is not empty, then setFieldValue is called or else, if the object is a collection, the value is added to the collection. For strongly typed languages it may be required to override this with the correct code to add an entry to an object.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.processInclude"></a>processInclude</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.processInclude = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>into</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given node is an include directive and executes the include by decoding the XML document. Returns false if the given node is not an include directive.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dec</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link92 onMouseOver="ShowTip(event, 'tt35', 'link92')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding/decoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be checked.</td></tr><tr><td class=CDLEntry>into</td><td class=CDLDescription>Optional object to pass-thru to the codec.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.beforeDecode"></a>beforeDecode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.beforeDecode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by <a href="#mxObjectCodec.decode" class=LFunction id=link93 onMouseOver="ShowTip(event, 'tt23', 'link93')" onMouseOut="HideTip('tt23')">decode</a>. The object is created based on the template in the calling method and is never null. This implementation returns the input node. The return value of this function is used in <a href="#mxObjectCodec.decode" class=LFunction id=link94 onMouseOver="ShowTip(event, 'tt23', 'link94')" onMouseOut="HideTip('tt23')">decode</a> to perform the default decoding into the given object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dec</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link95 onMouseOver="ShowTip(event, 'tt35', 'link95')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the decoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be decoded.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to encode the node into.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.afterDecode"></a>afterDecode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.afterDecode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to post-process the object after decoding. This implementation returns the given object without any changes. The return value of this method is returned to the decoder from <a href="#mxObjectCodec.decode" class=LFunction id=link96 onMouseOver="ShowTip(event, 'tt23', 'link96')" onMouseOut="HideTip('tt23')">decode</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-js.html#mxCodec" class=LClass id=link97 onMouseOver="ShowTip(event, 'tt35', 'link97')" onMouseOut="HideTip('tt35')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be decoded.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object that represents the default decoding.</td></tr></table></div></div></div>
|
|
|
|
</div><!--Content-->
|
|
|
|
|
|
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
|
|
|
|
|
|
<div id=Menu><div class=MEntry><div class=MFile><a href="../index-txt.html">API Specification</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Editor</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../editor/mxDefaultKeyHandler-js.html">mxDefaultKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultPopupMenu-js.html">mxDefaultPopupMenu</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultToolbar-js.html">mxDefaultToolbar</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxEditor-js.html">mxEditor</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Handler</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../handler/mxCellHighlight-js.html">mxCellHighlight</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellMarker-js.html">mxCellMarker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellTracker-js.html">mxCellTracker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConnectionHandler-js.html">mxConnectionHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConstraintHandler-js.html">mxConstraintHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeHandler-js.html">mxEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeSegmentHandler-js.html">mxEdgeSegmentHandler.js</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxElbowEdgeHandler-js.html">mxElbowEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxGraphHandler-js.html">mxGraphHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxKeyHandler-js.html">mxKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPanningHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPopupMenuHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxRubberband-js.html">mxRubberband</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxSelectionCellsHandler-js.html">mxSelectionCellsHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxTooltipHandler-js.html">mxTooltipHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxVertexHandler-js.html">mxVertexHandler</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Io</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="mxCellCodec-js.html">mxCellCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxChildChangeCodec-js.html">mxChildChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxCodec-js.html">mxCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxCodecRegistry-js.html">mxCodecRegistry</a></div></div><div class=MEntry><div class=MFile><a href="mxDefaultKeyHandlerCodec-js.html">mxDefaultKeyHandlerCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxDefaultPopupMenuCodec-js.html">mxDefaultPopupMenuCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxDefaultToolbarCodec-js.html">mxDefaultToolbarCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxEditorCodec-js.html">mxEditorCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxGenericChangeCodec-js.html">mxGenericChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxGraphCodec-js.html">mxGraphCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxGraphViewCodec-js.html">mxGraphViewCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxModelCodec-js.html">mxModelCodec</a></div></div><div class=MEntry><div class=MFile id=MSelected>mxObjectCodec</div></div><div class=MEntry><div class=MFile><a href="mxRootChangeCodec-js.html">mxRootChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxStylesheetCodec-js.html">mxStylesheetCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxTerminalChangeCodec-js.html">mxTerminalChangeCodec</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent7')">Layout</a><div class=MGroupContent id=MGroupContent7><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Hierarchical</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Model</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../layout/hierarchical/model/mxGraphAbstractHierarchyCell-js.html">mxGraphAbstractHierarchyCell</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/model/mxGraphHierarchyEdge-js.html">mxGraphHierarchyEdge</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/model/mxGraphHierarchyModel-js.html">mxGraphHierarchyModel</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/model/mxGraphHierarchyNode-js.html">mxGraphHierarchyNode</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/model/mxSwimlaneModel-js.html">mxSwimlaneModel</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/mxHierarchicalLayout-js.html">mxHierarchicalLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/mxSwimlaneLayout-js.html">mxSwimlaneLayout</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Stage</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MFile><a href="../layout/hierarchical/stage/mxCoordinateAssignment-js.html">mxCoordinateAssignment</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/stage/mxHierarchicalLayoutStage-js.html">mxHierarchicalLayoutStage</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/stage/mxMedianHybridCrossingReduction-js.html">mxMedianHybridCrossingReduction</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/stage/mxMinimumCycleRemover-js.html">mxMinimumCycleRemover</a></div></div><div class=MEntry><div class=MFile><a href="../layout/hierarchical/stage/mxSwimlaneOrdering-js.html">mxSwimlaneOrdering</a></div></div></div></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../layout/mxCircleLayout-js.html">mxCircleLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxCompactTreeLayout-js.html">mxCompactTreeLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxCompositeLayout-js.html">mxCompositeLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxEdgeLabelLayout-js.html">mxEdgeLabelLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxFastOrganicLayout-js.html">mxFastOrganicLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxGraphLayout-js.html">mxGraphLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxParallelEdgeLayout-js.html">mxParallelEdgeLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxPartitionLayout-js.html">mxPartitionLayout</a></div></div><div class=MEntry><div class=MFile><a href="../layout/mxStackLayout-js.html">mxStackLayout</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent8')">Model</a><div class=MGroupContent id=MGroupContent8><div class=MEntry><div class=MFile><a href="../model/mxCell-js.html">mxCell</a></div></div><div class=MEntry><div class=MFile><a href="../model/mxCellPath-js.html">mxCellPath</a></div></div><div class=MEntry><div class=MFile><a href="../model/mxGeometry-js.html">mxGeometry</a></div></div><div class=MEntry><div class=MFile><a href="../model/mxGraphModel-js.html">mxGraphModel</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../mxClient-js.html">mxClient</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent9')">Shape</a><div class=MGroupContent id=MGroupContent9><div class=MEntry><div class=MFile><a href="../shape/mxActor-js.html">mxActor</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxArrow-js.html">mxArrow</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxCloud-js.html">mxCloud</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxConnector-js.html">mxConnector</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxCylinder-js.html">mxCylinder</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxDoubleEllipse-js.html">mxDoubleEllipse</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxEllipse-js.html">mxEllipse</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxHexagon-js.html">mxHexagon</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxImageShape-js.html">mxImageShape</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxLabel-js.html">mxLabel</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxLine-js.html">mxLine</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxMarker-js.html">mxMarker</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxPolyline-js.html">mxPolyline</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxRectangleShape-js.html">mxRectangleShape</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxRhombus-js.html">mxRhombus</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxShape-js.html">mxShape</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxStencil-js.html">mxStencil</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxStencilRegistry-js.html">mxStencilRegistry</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxSwimlane-js.html">mxSwimlane</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxText-js.html">mxText</a></div></div><div class=MEntry><div class=MFile><a href="../shape/mxTriangle-js.html">mxTriangle</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent10')">Util</a><div class=MGroupContent id=MGroupContent10><div class=MEntry><div class=MFile><a href="../util/mxAbstractCanvas2D-js.html">mxAbstractCanvas2D</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxAnimation-js.html">mxAnimation</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxAutoSaveManager-js.html">mxAutoSaveManager</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxClipboard-js.html">mxClipboard</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxConstants-js.html">mxConstants</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxDictionary-js.html">mxDictionary</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxDivResizer-js.html">mxDivResizer</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxDragSource-js.html">mxDragSource</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEffects-js.html">mxEffects</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEvent-js.html">mxEvent</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEventObject-js.html">mxEventObject</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEventSource-js.html">mxEventSource</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxForm-js.html">mxForm</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxGuide-js.html">mxGuide</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxImage-js.html">mxImage</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxImageBundle-js.html">mxImageBundle</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxImageExport-js.html">mxImageExport</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxLog-js.html">mxLog</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxMorphing-js.html">mxMorphing</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxMouseEvent-js.html">mxMouseEvent</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxObjectIdentity-js.html">mxObjectIdentity</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxPanningManager-js.html">mxPanningManager</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxPoint-js.html">mxPoint</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxPopupMenu-js.html">mxPopupMenu</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxRectangle-js.html">mxRectangle</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxResources-js.html">mxResources</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxSession-js.html">mxSession</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxSvgCanvas2D-js.html">mxSvgCanvas2D</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxToolbar-js.html">mxToolbar</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxUndoableEdit-js.html">mxUndoableEdit</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxUndoManager-js.html">mxUndoManager</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxUrlConverter-js.html">mxUrlConverter</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxUtils-js.html">mxUtils</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxVmlCanvas2D-js.html">mxVmlCanvas2D</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxWindow-js.html">mxWindow</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxXmlCanvas2D-js.html">mxXmlCanvas2D</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxXmlRequest-js.html">mxXmlRequest</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent11')">View</a><div class=MGroupContent id=MGroupContent11><div class=MEntry><div class=MFile><a href="../view/mxCellEditor-js.html">mxCellEditor</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxCellOverlay-js.html">mxCellOverlay</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxCellRenderer-js.html">mxCellRenderer</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxCellState-js.html">mxCellState</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxCellStatePreview-js.html">mxCellStatePreview</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxConnectionConstraint-js.html">mxConnectionConstraint</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxEdgeStyle-js.html">mxEdgeStyle</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxGraph-js.html">mxGraph</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxGraphSelectionModel-js.html">mxGraphSelectionModel</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxGraphView-js.html">mxGraphView</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxLayoutManager-js.html">mxLayoutManager</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxMultiplicity-js.html">mxMultiplicity</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxOutline-js.html">mxOutline</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxPerimeter-js.html">mxPerimeter</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxPrintPreview-js.html">mxPrintPreview</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxSpaceManager-js.html">mxSpaceManager</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxStyleRegistry-js.html">mxStyleRegistry</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxStylesheet-js.html">mxStylesheet</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxSwimlaneManager-js.html">mxSwimlaneManager</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxTemporaryCellStates-js.html">mxTemporaryCellStates</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent12')">Index</a><div class=MGroupContent id=MGroupContent12><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Cookies.html">Cookies</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Events.html">Events</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
|
|
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
|
|
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Cookies">Cookies</option><option value="Events">Events</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
|
|
HideAllBut([3], 13);// --></script></div><!--Menu-->
|
|
|
|
|
|
|
|
<!--START_ND_TOOLTIPS-->
|
|
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxObjectCodec(</td><td class=PParameter nowrap>template,</td></tr><tr><td></td><td class=PParameter nowrap>exclude,</td></tr><tr><td></td><td class=PParameter nowrap>idrefs,</td></tr><tr><td></td><td class=PParameter nowrap>mapping</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new codec for the specified template object. </div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.template</td></tr></table></blockquote>Holds the template object associated with this codec.</div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.exclude</td></tr></table></blockquote>Array containing the variable names that should be ignored by the codec.</div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.idrefs</td></tr></table></blockquote>Array containing the variable names that should be turned into or converted from references. </div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.mapping</td></tr></table></blockquote>Maps from from fieldnames to XML attribute names.</div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.reverse</td></tr></table></blockquote>Maps from from XML attribute names to fieldnames.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.getName = function()</td></tr></table></blockquote>Returns the name used for the nodenames and lookup of the codec when classes are encoded and nodes are decoded. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxObjectCodec.prototype.cloneTemplate = function()</td></tr></table></blockquote>Returns a new instance of the template for this codec.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.getFieldName = function(</td><td class=PParameter nowrap>attributename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the fieldname for the given attributename. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.getAttributeName = function(</td><td class=PParameter nowrap>fieldname</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the attributename for the given fieldname. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.isExcluded = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given attribute is to be ignored by the codec. </div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.isReference = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given fieldname is to be treated as a textual reference (ID). </div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.encode = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Encodes the specified object and returns a node representing then given object. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.encodeObject = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Encodes the value of each member in then given obj into the given node using encodeValue.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.encodeValue = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts the given value according to the mappings and id-refs in this codec and uses writeAttribute to write the attribute into the given node.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.writeAttribute = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Writes the given value into node using writePrimitiveAttribute or writeComplexAttribute depending on the type of the value.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.writePrimitiveAttribute = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Writes the given value as an attribute of the given node.</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.writeComplexAttribute = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Writes the given value as a child node of the given node.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.convertValueToXml = function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts true to “1” and false to “0”. </div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.convertValueFromXml = function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts booleans and numeric values to the respective types.</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.beforeEncode = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to pre-process the object before encoding. </div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.afterEncode = function(</td><td class=PParameter nowrap>enc,</td></tr><tr><td></td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. </div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>into</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Parses the given node into the object or returns a new object representing the given node.</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeNode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Calls decodeAttributes and decodeChildren for the given node.</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeAttributes = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Decodes all attributes of the given node using decodeAttribute.</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeChildren = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Decodec all children of the given node using decodeChild.</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeAttribute = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>attr,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Reads the given attribute into the specified object.</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.decodeChild = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>child,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Reads the specified child into the given object.</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.getFieldTemplate = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>fieldname,</td></tr><tr><td></td><td class=PParameter nowrap>child</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the template instance for the given field. </div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.addObjectValue = function(</td><td class=PParameter nowrap>obj,</td></tr><tr><td></td><td class=PParameter nowrap>fieldname,</td></tr><tr><td></td><td class=PParameter nowrap>value,</td></tr><tr><td></td><td class=PParameter nowrap>template</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the decoded child node as a value of the given object. </div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.processInclude = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>into</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given node is an include directive and executes the include by decoding the XML document. </div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.beforeDecode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by decode. </div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxObjectCodec.prototype.afterDecode = function(</td><td class=PParameter nowrap>dec,</td></tr><tr><td></td><td class=PParameter nowrap>node,</td></tr><tr><td></td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to post-process the object after decoding. </div></div><div class=CToolTip id="tt34"><div class=CClass>A singleton class that implements a simple console.</div></div><div class=CToolTip id="tt35"><div class=CClass>XML codec for JavaScript object graphs. </div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxCodec.prototype.reference = function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to implement a custom method for retrieving IDs from objects. </div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxCodec.prototype.lookup = function(</td><td class=PParameter nowrap>id</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to implement a custom lookup mechanism for cell IDs. </div></div><div class=CToolTip id="tt38"><div class=CVariable>Constant for left horizontal alignment. </div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxCodec.prototype.getId = function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the ID of the specified object. </div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxCodec.prototype.getObject = function(</td><td class=PParameter nowrap>id</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the decoded object for the element with the specified ID in document. </div></div><div class=CToolTip id="tt41"><div class=CVariable>Name of the field to be used to store the object ID. </div></div><div class=CToolTip id="tt42"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>warn: function()</td></tr></table></blockquote>Adds all arguments to the console if WARN is enabled.</div></div><div class=CToolTip id="tt43"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxCodec.prototype.objects</td></tr></table></blockquote>Maps from IDs to objects.</div></div><div class=CToolTip id="tt44"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>eval: function(</td><td class=PParameter nowrap>expr</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Evaluates the given expression using eval and returns the JavaScript object that represents the expression result. </div></div><!--END_ND_TOOLTIPS-->
|
|
|
|
|
|
|
|
|
|
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
|
|
|
|
|
|
<script language=JavaScript><!--
|
|
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |