src/main/java/com/mxgraph/io/mxCodec.java
public mxICell decodeCell(Node node, boolean restoreStructures)
	{
		mxICell cell = null;

		if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
		{
			// Tries to find a codec for the given node name. If that does
			// not return a codec then the node is the user object (an XML node
			// that contains the mxCell, aka inversion).
			mxObjectCodec decoder = mxCodecRegistry
					.getCodec(node.getNodeName());

			// Tries to find the codec for the cell inside the user object.
			// This assumes all node names inside the user object are either
			// not registered or they correspond to a class for cells.
			if (!(decoder instanceof mxCellCodec))
			{
				Node child = node.getFirstChild();

				while (child != null && !(decoder instanceof mxCellCodec))
				{
					decoder = mxCodecRegistry.getCodec(child.getNodeName());
					child = child.getNextSibling();
				}

				String name = mxCell.class.getSimpleName();
				decoder = mxCodecRegistry.getCodec(name);
			}

			if (!(decoder instanceof mxCellCodec))
			{
				String name = mxCell.class.getSimpleName();
				decoder = mxCodecRegistry.getCodec(name);
			}

			cell = (mxICell) decoder.decode(this, node);

			if (restoreStructures)
			{
				insertIntoGraph(cell);
			}
		}

		return cell;
	}
/**
	 * 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.
	 * 
	 * @param node XML node that contains the cell data.
	 * @param restoreStructures Boolean indicating whether the graph
	 * structure should be restored by calling insert and insertEdge on the
	 * parent and terminals, respectively.
	 * @return Graph cell that represents the given node.
	 */
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  instance
that represents the given node.

@param node XML node that contains the cell data.
@param restoreStructures Boolean indicating whether the graph
structure should be restored by calling insert and insertEdge on the
parent and terminals, respectively.
@return Graph cell that represents the given node.
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 instance that represents the given node . @param node XML node that contains the cell data . @param restoreStructures Boolean indicating whether the graph structure should be restored by calling insert and insertEdge on the parent and terminals respectively . @return Graph cell that represents the given node .
public mxICell decodeCell(Node node, boolean restoreStructures)
	{
		mxICell cell = null;
		if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
		{
			mxObjectCodec decoder = mxCodecRegistry
					.getCodec(node.getNodeName());
			if (!(decoder instanceof mxCellCodec))
			{
				Node child = node.getFirstChild();
				while (child != null && !(decoder instanceof mxCellCodec))
				{
					decoder = mxCodecRegistry.getCodec(child.getNodeName());
					child = child.getNextSibling();
				}
				String name = mxCell.class.getSimpleName();
				decoder = mxCodecRegistry.getCodec(name);
			}
			if (!(decoder instanceof mxCellCodec))
			{
				String name = mxCell.class.getSimpleName();
				decoder = mxCodecRegistry.getCodec(name);
			}
			cell = (mxICell) decoder.decode(this, node);
			if (restoreStructures)
			{
				insertIntoGraph(cell);
			}
		}
		return cell;
	}
public mxICell decodeCell ( Node node , boolean restoreStructures ) { mxICell cell = null ; if ( node != null && node . getNodeType ( ) == Node . ELEMENT_NODE ) { mxObjectCodec decoder = mxCodecRegistry . getCodec ( node . getNodeName ( ) ) ; if ( ! ( decoder instanceof mxCellCodec ) ) { Node child = node . getFirstChild ( ) ; while ( child != null && ! ( decoder instanceof mxCellCodec ) ) { decoder = mxCodecRegistry . getCodec ( child . getNodeName ( ) ) ; child = child . getNextSibling ( ) ; } String name = mxCell . class . getSimpleName ( ) ; decoder = mxCodecRegistry . getCodec ( name ) ; } if ( ! ( decoder instanceof mxCellCodec ) ) { String name = mxCell . class . getSimpleName ( ) ; decoder = mxCodecRegistry . getCodec ( name ) ; } cell = ( mxICell ) decoder . decode ( this , node ) ; if ( restoreStructures ) { insertIntoGraph ( cell ) ; } } return cell ; }
Decodes cells that have been encoded using inversion, ie.
Decodes cells that have been encoded using inversion ie .
// Tries to find a codec for the given node name. If that does // not return a codec then the node is the user object (an XML node // that contains the mxCell, aka inversion). // Tries to find the codec for the cell inside the user object. // This assumes all node names inside the user object are either // not registered or they correspond to a class for cells.