src/main/java/com/mxgraph/io/mxObjectCodec.java
protected void addObjectValue(Object obj, String fieldname, Object value,
			Object template)
	{
		if (value != null && !value.equals(template))
		{
			if (fieldname != null && obj instanceof Map)
			{
				((Map) obj).put(fieldname, value);
			}
			else if (fieldname != null && fieldname.length() > 0)
			{
				setFieldValue(obj, fieldname, value);
			}
			// Arrays are treated as collections and
			// converted in setFieldValue
			else if (obj instanceof Collection)
			{
				((Collection) obj).add(value);
			}
		}
	}
/**
	 * 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.
	 */
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.
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 .
protected void addObjectValue(Object obj, String fieldname, Object value,
			Object template)
	{
		if (value != null && !value.equals(template))
		{
			if (fieldname != null && obj instanceof Map)
			{
				((Map) obj).put(fieldname, value);
			}
			else if (fieldname != null && fieldname.length() > 0)
			{
				setFieldValue(obj, fieldname, value);
			}
			else if (obj instanceof Collection)
			{
				((Collection) obj).add(value);
			}
		}
	}
protected void addObjectValue ( Object obj , String fieldname , Object value , Object template ) { if ( value != null && ! value . equals ( template ) ) { if ( fieldname != null && obj instanceof Map ) { ( ( Map ) obj ) . put ( fieldname , value ) ; } else if ( fieldname != null && fieldname . length ( ) > 0 ) { setFieldValue ( obj , fieldname , value ) ; } else if ( obj instanceof Collection ) { ( ( Collection ) obj ) . add ( value ) ; } } }
Sets the decoded child node as a value of the given object.
Sets the decoded child node as a value of the given object .
// Arrays are treated as collections and // converted in setFieldValue