maxGraph/java/docs/com/mxgraph/io/mxCodec.html

732 lines
42 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Tue Mar 01 10:14:01 CET 2016 -->
<title>mxCodec (mxGraph 3.5.0.0 API Specification)</title>
<meta name="date" content="2016-03-01">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="mxCodec (mxGraph 3.5.0.0 API Specification)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/mxCodec.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><p><b>mxGraph 3.5.0.0</b></p></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/mxgraph/io/mxChildChangeCodec.html" title="class in com.mxgraph.io"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../com/mxgraph/io/mxCodecRegistry.html" title="class in com.mxgraph.io"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/mxgraph/io/mxCodec.html" target="_top">Frames</a></li>
<li><a href="mxCodec.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.mxgraph.io</div>
<h2 title="Class mxCodec" class="title">Class mxCodec</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.mxgraph.io.mxCodec</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">mxCodec</span>
extends <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">XML codec for Java object graphs. In order to resolve forward references
when reading files the XML document that contains the data must be passed
to the constructor.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#document">document</a></strong></code>
<div class="block">Holds the owner document of the codec.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#elements">elements</a></strong></code>
<div class="block">Maps from IDs to elements.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#encodeDefaults">encodeDefaults</a></strong></code>
<div class="block">Specifies if default values should be encoded.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#objects">objects</a></strong></code>
<div class="block">Maps from IDs to objects.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#mxCodec()">mxCodec</a></strong>()</code>
<div class="block">Constructs an XML encoder/decoder with a new owner document.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#mxCodec(org.w3c.dom.Document)">mxCodec</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a>&nbsp;document)</code>
<div class="block">Constructs an XML encoder/decoder for the specified owner document.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#addElement(org.w3c.dom.Node)">addElement</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node)</code>
<div class="block">Adds the given element to <elements> if it has an ID.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node)">decode</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node)</code>
<div class="block">Decodes the given XML node using <a href="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node, java.lang.Object)"><code>decode(Node, Object)</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node, java.lang.Object)">decode</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;into)</code>
<div class="block">Decodes the given XML node.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../com/mxgraph/model/mxICell.html" title="interface in com.mxgraph.model">mxICell</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#decodeCell(org.w3c.dom.Node, boolean)">decodeCell</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
boolean&nbsp;restoreStructures)</code>
<div class="block">Decodes cells that have been encoded using inversion, ie.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#encode(java.lang.Object)">encode</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Encodes the specified object and returns the resulting XML node.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#encodeCell(com.mxgraph.model.mxICell, org.w3c.dom.Node, boolean)">encodeCell</a></strong>(<a href="../../../com/mxgraph/model/mxICell.html" title="interface in com.mxgraph.model">mxICell</a>&nbsp;cell,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
boolean&nbsp;includeChildren)</code>
<div class="block">Encoding of cell hierarchies is built-into the core, but is a
higher-level function that needs to be explicitely used by the
respective object encoders (eg.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#getDocument()">getDocument</a></strong>()</code>
<div class="block">Returns the owner document of the codec.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#getElementById(java.lang.String)">getElementById</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</code>
<div class="block">Returns the element with the given ID from the document.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#getId(java.lang.Object)">getId</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Returns the ID of the specified object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#getObject(java.lang.String)">getObject</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</code>
<div class="block">Returns the decoded object for the element with the specified ID in
<a href="../../../com/mxgraph/io/mxCodec.html#document"><code>document</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#getObjects()">getObjects</a></strong>()</code>
<div class="block">Returns the object lookup table.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#insertIntoGraph(com.mxgraph.model.mxICell)">insertIntoGraph</a></strong>(<a href="../../../com/mxgraph/model/mxICell.html" title="interface in com.mxgraph.model">mxICell</a>&nbsp;cell)</code>
<div class="block">Inserts the given cell into its parent and terminal cells.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#isEncodeDefaults()">isEncodeDefaults</a></strong>()</code>
<div class="block">Returns if default values of member variables should be encoded.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#lookup(java.lang.String)">lookup</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</code>
<div class="block">Hook for subclassers to implement a custom lookup mechanism for cell IDs.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#putObject(java.lang.String, java.lang.Object)">putObject</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Assoiates the given object with the given ID.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#reference(java.lang.Object)">reference</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Hook for subclassers to implement a custom method for retrieving IDs from
objects.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#setAttribute(org.w3c.dom.Node, java.lang.String, java.lang.Object)">setAttribute</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attribute,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">Sets the attribute on the specified node to value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#setDocument(org.w3c.dom.Document)">setDocument</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a>&nbsp;value)</code>
<div class="block">Sets the owner document of the codec.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../com/mxgraph/io/mxCodec.html#setEncodeDefaults(boolean)">setEncodeDefaults</a></strong>(boolean&nbsp;encodeDefaults)</code>
<div class="block">Sets if default values of member variables should be encoded.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="document">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>document</h4>
<pre>protected&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a> document</pre>
<div class="block">Holds the owner document of the codec.</div>
</li>
</ul>
<a name="objects">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>objects</h4>
<pre>protected&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt; objects</pre>
<div class="block">Maps from IDs to objects.</div>
</li>
</ul>
<a name="elements">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>elements</h4>
<pre>protected&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&gt; elements</pre>
<div class="block">Maps from IDs to elements.</div>
</li>
</ul>
<a name="encodeDefaults">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>encodeDefaults</h4>
<pre>protected&nbsp;boolean encodeDefaults</pre>
<div class="block">Specifies if default values should be encoded. Default is false.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="mxCodec()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mxCodec</h4>
<pre>public&nbsp;mxCodec()</pre>
<div class="block">Constructs an XML encoder/decoder with a new owner document.</div>
</li>
</ul>
<a name="mxCodec(org.w3c.dom.Document)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>mxCodec</h4>
<pre>public&nbsp;mxCodec(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a>&nbsp;document)</pre>
<div class="block">Constructs an XML encoder/decoder for the specified owner document.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>document</code> - Optional XML document that contains the data. If no document
is specified then a new document is created using mxUtils.createDocument</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getDocument()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDocument</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a>&nbsp;getDocument()</pre>
<div class="block">Returns the owner document of the codec.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Returns the owner document.</dd></dl>
</li>
</ul>
<a name="setDocument(org.w3c.dom.Document)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDocument</h4>
<pre>public&nbsp;void&nbsp;setDocument(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Document.html?is-external=true" title="class or interface in org.w3c.dom">Document</a>&nbsp;value)</pre>
<div class="block">Sets the owner document of the codec.</div>
</li>
</ul>
<a name="isEncodeDefaults()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEncodeDefaults</h4>
<pre>public&nbsp;boolean&nbsp;isEncodeDefaults()</pre>
<div class="block">Returns if default values of member variables should be encoded.</div>
</li>
</ul>
<a name="setEncodeDefaults(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEncodeDefaults</h4>
<pre>public&nbsp;void&nbsp;setEncodeDefaults(boolean&nbsp;encodeDefaults)</pre>
<div class="block">Sets if default values of member variables should be encoded.</div>
</li>
</ul>
<a name="getObjects()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getObjects</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;&nbsp;getObjects()</pre>
<div class="block">Returns the object lookup table.</div>
</li>
</ul>
<a name="putObject(java.lang.String, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putObject</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;putObject(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</pre>
<div class="block">Assoiates the given object with the given ID.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>id</code> - ID for the object to be associated with.</dd><dd><code>object</code> - Object to be associated with the ID.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns the given object.</dd></dl>
</li>
</ul>
<a name="getObject(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getObject</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;getObject(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</pre>
<div class="block">Returns the decoded object for the element with the specified ID in
<a href="../../../com/mxgraph/io/mxCodec.html#document"><code>document</code></a>. If the object is not known then <a href="../../../com/mxgraph/io/mxCodec.html#lookup(java.lang.String)"><code>lookup(String)</code></a>
is used to find an object. If no object is found, then the element with
the respective ID from the document is parsed using <a href="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node)"><code>decode(Node)</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>id</code> - ID of the object to be returned.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns the object for the given ID.</dd></dl>
</li>
</ul>
<a name="lookup(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lookup</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;lookup(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</pre>
<div class="block">Hook for subclassers to implement a custom lookup mechanism for cell IDs.
This implementation always returns null.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>id</code> - ID of the object to be returned.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns the object for the given ID.</dd></dl>
</li>
</ul>
<a name="getElementById(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElementById</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;getElementById(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;id)</pre>
<div class="block">Returns the element with the given ID from the document.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>id</code> - ID of the element to be returned.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns the element for the given ID.</dd></dl>
</li>
</ul>
<a name="addElement(org.w3c.dom.Node)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addElement</h4>
<pre>protected&nbsp;void&nbsp;addElement(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node)</pre>
<div class="block">Adds the given element to <elements> if it has an ID.</div>
</li>
</ul>
<a name="getId(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getId(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Returns the ID of the specified object. This implementation calls
reference first and if that returns null handles the object as an
mxCell by returning their IDs using mxCell.getId. If no ID exists for
the given cell, then an on-the-fly ID is generated using
mxCellPath.create.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - Object to return the ID for.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns the ID for the given object.</dd></dl>
</li>
</ul>
<a name="reference(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reference</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;reference(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Hook for subclassers to implement a custom method for retrieving IDs from
objects. This implementation always returns null.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - Object whose ID should be returned.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns the ID for the given object.</dd></dl>
</li>
</ul>
<a name="encode(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;encode(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Encodes the specified object and returns the resulting XML node.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - Object to be encoded.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns an XML node that represents the given object.</dd></dl>
</li>
</ul>
<a name="decode(org.w3c.dom.Node)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decode(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node)</pre>
<div class="block">Decodes the given XML node using <a href="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node, java.lang.Object)"><code>decode(Node, Object)</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - XML node to be decoded.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns an object that represents the given node.</dd></dl>
</li>
</ul>
<a name="decode(org.w3c.dom.Node, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decode(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;into)</pre>
<div class="block">Decodes the given XML node. The optional "into" argument specifies an
existing object to be used. If no object is given, then a new
instance is created using the constructor from the codec.
The function returns the passed in object or the new instance if no
object was given.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - XML node to be decoded.</dd><dd><code>into</code> - Optional object to be decodec into.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns an object that represents the given node.</dd></dl>
</li>
</ul>
<a name="encodeCell(com.mxgraph.model.mxICell, org.w3c.dom.Node, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeCell</h4>
<pre>public&nbsp;void&nbsp;encodeCell(<a href="../../../com/mxgraph/model/mxICell.html" title="interface in com.mxgraph.model">mxICell</a>&nbsp;cell,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
boolean&nbsp;includeChildren)</pre>
<div class="block">Encoding of cell hierarchies is built-into the core, but is a
higher-level function that needs to be explicitely used by the
respective object encoders (eg. mxModelCodec, mxChildChangeCodec
and mxRootChangeCodec). This implementation writes the given cell
and its children as a (flat) sequence into the given node. The
children are not encoded if the optional includeChildren is false.
The function is in charge of adding the result into the given node
and has no return value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cell</code> - mxCell to be encoded.</dd><dd><code>node</code> - Parent XML node to add the encoded cell into.</dd><dd><code>includeChildren</code> - Boolean indicating if the method
should include all descendents.</dd></dl>
</li>
</ul>
<a name="decodeCell(org.w3c.dom.Node, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decodeCell</h4>
<pre>public&nbsp;<a href="../../../com/mxgraph/model/mxICell.html" title="interface in com.mxgraph.model">mxICell</a>&nbsp;decodeCell(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
boolean&nbsp;restoreStructures)</pre>
<div class="block">Decodes cells that have been encoded using inversion, ie. where the
user object is the enclosing node in the XML, and restores the group
and graph structure in the cells. Returns a new <mxCell> instance
that represents the given node.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - XML node that contains the cell data.</dd><dd><code>restoreStructures</code> - Boolean indicating whether the graph
structure should be restored by calling insert and insertEdge on the
parent and terminals, respectively.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Graph cell that represents the given node.</dd></dl>
</li>
</ul>
<a name="insertIntoGraph(com.mxgraph.model.mxICell)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>insertIntoGraph</h4>
<pre>public&nbsp;void&nbsp;insertIntoGraph(<a href="../../../com/mxgraph/model/mxICell.html" title="interface in com.mxgraph.model">mxICell</a>&nbsp;cell)</pre>
<div class="block">Inserts the given cell into its parent and terminal cells.</div>
</li>
</ul>
<a name="setAttribute(org.w3c.dom.Node, java.lang.String, java.lang.Object)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setAttribute</h4>
<pre>public static&nbsp;void&nbsp;setAttribute(<a href="http://download.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/Node.html?is-external=true" title="class or interface in org.w3c.dom">Node</a>&nbsp;node,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attribute,
<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<div class="block">Sets the attribute on the specified node to value. This is a
helper method that makes sure the attribute and value arguments
are not null.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - XML node to set the attribute for.</dd><dd><code>attribute</code> - Name of the attribute whose value should be set.</dd><dd><code>value</code> - New value of the attribute.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/mxCodec.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><p><b>mxGraph 3.5.0.0</b></p></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/mxgraph/io/mxChildChangeCodec.html" title="class in com.mxgraph.io"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../com/mxgraph/io/mxCodecRegistry.html" title="class in com.mxgraph.io"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/mxgraph/io/mxCodec.html" target="_top">Frames</a></li>
<li><a href="mxCodec.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><font size=1>Copyright (c) 2010 <a href="http://www.mxgraph.com/"
target="_blank">Gaudenz Alder, David Benson</a>. All rights reserved.</font></small></p>
</body>
</html>