<AHREF="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>
<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><B>com.mxgraph.io.mxCodec</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>mxCodec</B><DT>extends <AHREF="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></DL>
</PRE>
<P>
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
<CODE>protected <AHREF="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></FONT></TD>
<CODE>protected <AHREF="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><<AHREF="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>,<AHREF="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></FONT></TD>
Constructs an XML encoder/decoder with a new owner document.</TD>
</TR>
<TRBGCOLOR="white"CLASS="TableRowColor">
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#mxCodec(org.w3c.dom.Document)">mxCodec</A></B>(<AHREF="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)</CODE>
<BR>
Constructs an XML encoder/decoder for the specified owner document.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node)">decode</A></B>(<AHREF="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> node)</CODE>
<BR>
Decodes the given XML node using <AHREF="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node, java.lang.Object)"><CODE>decode(Node, Object)</CODE></A>.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node, java.lang.Object)">decode</A></B>(<AHREF="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> node,
<AHREF="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> into)</CODE>
<BR>
Decodes the given XML node.</TD>
<CODE> <AHREF="../../../com/mxgraph/model/mxICell.html"title="interface in com.mxgraph.model">mxICell</A></CODE></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#decodeCell(org.w3c.dom.Node, boolean)">decodeCell</A></B>(<AHREF="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> node,
boolean restoreStructures)</CODE>
<BR>
Decodes cells that have been encoded using inversion, ie.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#encode(java.lang.Object)">encode</A></B>(<AHREF="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> obj)</CODE>
<BR>
Encodes the specified object and returns the resulting XML node.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#encodeCell(com.mxgraph.model.mxICell, org.w3c.dom.Node, boolean)">encodeCell</A></B>(<AHREF="../../../com/mxgraph/model/mxICell.html"title="interface in com.mxgraph.model">mxICell</A> cell,
<AHREF="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> node,
boolean includeChildren)</CODE>
<BR>
Encoding of cell hierarchies is built-into the core, but is a
higher-level function that needs to be explicitely used by the
<CODE> <AHREF="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></FONT></TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#getElementById(java.lang.String)">getElementById</A></B>(<AHREF="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> id)</CODE>
<BR>
Returns the element with the given ID from the document.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#getElementById(java.lang.String, java.lang.String)">getElementById</A></B>(<AHREF="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> id,
<AHREF="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> attr)</CODE>
<BR>
Returns the element with the given ID from document.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#getId(java.lang.Object)">getId</A></B>(<AHREF="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> obj)</CODE>
<BR>
Returns the ID of the specified object.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#getObject(java.lang.String)">getObject</A></B>(<AHREF="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> id)</CODE>
<BR>
Returns the decoded object for the element with the specified ID in
<CODE> <AHREF="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><<AHREF="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>,<AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#insertIntoGraph(com.mxgraph.model.mxICell)">insertIntoGraph</A></B>(<AHREF="../../../com/mxgraph/model/mxICell.html"title="interface in com.mxgraph.model">mxICell</A> cell)</CODE>
<BR>
Inserts the given cell into its parent and terminal cells.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#lookup(java.lang.String)">lookup</A></B>(<AHREF="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> id)</CODE>
<BR>
Hook for subclassers to implement a custom lookup mechanism for cell IDs.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#putObject(java.lang.String, java.lang.Object)">putObject</A></B>(<AHREF="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> id,
<AHREF="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> object)</CODE>
<BR>
Assoiates the given object with the given ID.</TD>
<CODE> <AHREF="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></FONT></TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#reference(java.lang.Object)">reference</A></B>(<AHREF="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> obj)</CODE>
<BR>
Hook for subclassers to implement a custom method for retrieving IDs from
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#setAttribute(org.w3c.dom.Node, java.lang.String, java.lang.Object)">setAttribute</A></B>(<AHREF="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> node,
<AHREF="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> attribute,
<AHREF="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> value)</CODE>
<BR>
Sets the attribute on the specified node to value.</TD>
<TD><CODE><B><AHREF="../../../com/mxgraph/io/mxCodec.html#setDocument(org.w3c.dom.Document)">setDocument</A></B>(<AHREF="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> value)</CODE>
<BR>
Sets the owner document of the codec.</TD>
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="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></B></TH>
</TR>
<TRBGCOLOR="white"CLASS="TableRowColor">
<TD><CODE><AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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>, <AHREF="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></TD>
protected <AHREF="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><B>document</B></PRE>
<DL>
<DD>Holds the owner document of the codec.
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="objects"><!----></A><H3>
objects</H3>
<PRE>
protected <AHREF="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><<AHREF="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>,<AHREF="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>><B>objects</B></PRE>
<DL>
<DD>Maps from IDs to objects.
<P>
<DL>
</DL>
</DL>
<HR>
<ANAME="encodeDefaults"><!----></A><H3>
encodeDefaults</H3>
<PRE>
protected boolean <B>encodeDefaults</B></PRE>
<DL>
<DD>Specifies if default values should be encoded. Default is false.
public <B>mxCodec</B>(<AHREF="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>
<DL>
<DD>Constructs an XML encoder/decoder for the specified owner document.
<P>
<DL>
<DT><B>Parameters:</B><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</DL>
public <AHREF="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><B>getDocument</B>()</PRE>
<DL>
<DD>Returns the owner document of the codec.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Returns the owner document.</DL>
public void <B>setDocument</B>(<AHREF="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> value)</PRE>
<DL>
<DD>Sets the owner document of the codec.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="isEncodeDefaults()"><!----></A><H3>
isEncodeDefaults</H3>
<PRE>
public boolean <B>isEncodeDefaults</B>()</PRE>
<DL>
<DD>Returns if default values of member variables should be encoded.
public void <B>setEncodeDefaults</B>(boolean encodeDefaults)</PRE>
<DL>
<DD>Sets if default values of member variables should be encoded.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="getObjects()"><!----></A><H3>
getObjects</H3>
<PRE>
public <AHREF="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><<AHREF="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>,<AHREF="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>><B>getObjects</B>()</PRE>
public <AHREF="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><B>putObject</B>(<AHREF="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> id,
<AHREF="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> object)</PRE>
<DL>
<DD>Assoiates the given object with the given ID.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - ID for the object to be associated with.<DD><CODE>object</CODE> - Object to be associated with the ID.
<DT><B>Returns:</B><DD>Returns the given object.</DL>
public <AHREF="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><B>getObject</B>(<AHREF="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> id)</PRE>
<DL>
<DD>Returns the decoded object for the element with the specified ID in
<AHREF="../../../com/mxgraph/io/mxCodec.html#document"><CODE>document</CODE></A>. If the object is not known then <AHREF="../../../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 <AHREF="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node)"><CODE>decode(Node)</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - ID of the object to be returned.
<DT><B>Returns:</B><DD>Returns the object for the given ID.</DL>
</DD>
</DL>
<HR>
<ANAME="lookup(java.lang.String)"><!----></A><H3>
lookup</H3>
<PRE>
public <AHREF="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><B>lookup</B>(<AHREF="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> id)</PRE>
<DL>
<DD>Hook for subclassers to implement a custom lookup mechanism for cell IDs.
This implementation always returns null.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - ID of the object to be returned.
<DT><B>Returns:</B><DD>Returns the object for the given ID.</DL>
public <AHREF="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><B>getElementById</B>(<AHREF="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> id)</PRE>
<DL>
<DD>Returns the element with the given ID from the document.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - ID of the element to be returned.
<DT><B>Returns:</B><DD>Returns the element for the given ID.</DL>
public <AHREF="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><B>getElementById</B>(<AHREF="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> id,
<AHREF="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> attr)</PRE>
<DL>
<DD>Returns the element with the given ID from document. The optional attr
argument specifies the name of the ID attribute. Default is "id". The
XPath expression used to find the element is //*[@attr='arg'] where attr
is the name of the ID attribute and arg is the given id.
Parameters:
id - String that contains the ID.
attr - Optional string for the attributename. Default is id.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<ANAME="getId(java.lang.Object)"><!----></A><H3>
getId</H3>
<PRE>
public <AHREF="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><B>getId</B>(<AHREF="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> obj)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - Object to return the ID for.
<DT><B>Returns:</B><DD>Returns the ID for the given object.</DL>
public <AHREF="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><B>reference</B>(<AHREF="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> obj)</PRE>
<DL>
<DD>Hook for subclassers to implement a custom method for retrieving IDs from
objects. This implementation always returns null.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - Object whose ID should be returned.
<DT><B>Returns:</B><DD>Returns the ID for the given object.</DL>
</DD>
</DL>
<HR>
<ANAME="encode(java.lang.Object)"><!----></A><H3>
encode</H3>
<PRE>
public <AHREF="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><B>encode</B>(<AHREF="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> obj)</PRE>
<DL>
<DD>Encodes the specified object and returns the resulting XML node.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - Object to be encoded.
<DT><B>Returns:</B><DD>Returns an XML node that represents the given object.</DL>
</DD>
</DL>
<HR>
<ANAME="decode(org.w3c.dom.Node)"><!----></A><H3>
decode</H3>
<PRE>
public <AHREF="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><B>decode</B>(<AHREF="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> node)</PRE>
<DL>
<DD>Decodes the given XML node using <AHREF="../../../com/mxgraph/io/mxCodec.html#decode(org.w3c.dom.Node, java.lang.Object)"><CODE>decode(Node, Object)</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - XML node to be decoded.
<DT><B>Returns:</B><DD>Returns an object that represents the given node.</DL>
public <AHREF="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><B>decode</B>(<AHREF="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> node,
<AHREF="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> into)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - XML node to be decoded.<DD><CODE>into</CODE> - Optional object to be decodec into.
<DT><B>Returns:</B><DD>Returns an object that represents the given node.</DL>
public void <B>encodeCell</B>(<AHREF="../../../com/mxgraph/model/mxICell.html"title="interface in com.mxgraph.model">mxICell</A> cell,
<AHREF="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> node,
boolean includeChildren)</PRE>
<DL>
<DD>Encoding of cell hierarchies is built-into the core, but is a
higher-level function that needs to be explicitely used by the
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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cell</CODE> - mxCell to be encoded.<DD><CODE>node</CODE> - Parent XML node to add the encoded cell into.<DD><CODE>includeChildren</CODE> - Boolean indicating if the method
public <AHREF="../../../com/mxgraph/model/mxICell.html"title="interface in com.mxgraph.model">mxICell</A><B>decodeCell</B>(<AHREF="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> node,
boolean restoreStructures)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - XML node that contains the cell data.<DD><CODE>restoreStructures</CODE> - Boolean indicating whether the graph
structure should be restored by calling insert and insertEdge on the
parent and terminals, respectively.
<DT><B>Returns:</B><DD>Graph cell that represents the given node.</DL>
public static void <B>setAttribute</B>(<AHREF="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> node,
<AHREF="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> attribute,
<AHREF="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> value)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - XML node to set the attribute for.<DD><CODE>attribute</CODE> - Name of the attribute whose value should be set.<DD><CODE>value</CODE> - New value of the attribute.</DL>