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);
			}
		}
	}