src/main/java/com/mxgraph/io/mxCodec.java
public Node encode(Object obj)
	{
		Node node = null;

		if (obj != null)
		{
			String name = mxCodecRegistry.getName(obj);
			mxObjectCodec enc = mxCodecRegistry.getCodec(name);

			if (enc != null)
			{
				node = enc.encode(this, obj);
			}
			else
			{
				if (obj instanceof Node)
				{
					node = ((Node) obj).cloneNode(true);
				}
				else
				{
					log.log(Level.FINEST, "No codec for " + name);
				}
			}
		}

		return node;
	}
/**
	 * Encodes the specified object and returns the resulting XML node.
	 * 
	 * @param obj Object to be encoded.
	 * @return Returns an XML node that represents the given object.
	 */
Encodes the specified object and returns the resulting XML node.

@param obj Object to be encoded.
@return Returns an XML node that represents the given object.
Encodes the specified object and returns the resulting XML node . @param obj Object to be encoded . @return Returns an XML node that represents the given object .
public Node encode(Object obj)
	{
		Node node = null;
		if (obj != null)
		{
			String name = mxCodecRegistry.getName(obj);
			mxObjectCodec enc = mxCodecRegistry.getCodec(name);
			if (enc != null)
			{
				node = enc.encode(this, obj);
			}
			else
			{
				if (obj instanceof Node)
				{
					node = ((Node) obj).cloneNode(true);
				}
				else
				{
					log.log(Level.FINEST, "No codec for " + name);
				}
			}
		}
		return node;
	}
public Node encode ( Object obj ) { Node node = null ; if ( obj != null ) { String name = mxCodecRegistry . getName ( obj ) ; mxObjectCodec enc = mxCodecRegistry . getCodec ( name ) ; if ( enc != null ) { node = enc . encode ( this , obj ) ; } else { if ( obj instanceof Node ) { node = ( ( Node ) obj ) . cloneNode ( true ) ; } else { log . log ( Level . FINEST , "No codec for " + name ) ; } } } return node ; }
Encodes the specified object and returns the resulting XML node.
Encodes the specified object and returns the resulting XML node .