public static Map<String, Object> getProperties(Object obj) {
		Map<String, Object> properties = new HashMap<String, Object>();

		if (obj == null) {
			return properties;
		} else {
			List<Object> cycleDetect = new ArrayList<Object>();
			performGetProperties(obj, null, properties, cycleDetect);
			return properties;
		}
	}
public static Map < String , Object > getProperties ( Object obj ) { Map < String , Object > properties = new HashMap < String , Object > ( ) ; if ( obj == null ) { return properties ; } else { List < Object > cycleDetect = new ArrayList < Object > ( ) ; performGetProperties ( obj , null , properties , cycleDetect ) ; return properties ; } }
Get values of all properties in specified object and its subobjects and
returns them as a map.

The object can be a user defined object, map or array. Returned properties
correspondently are object properties, map key-pairs or array elements with
their indexes.

@param obj an object to get properties from.
@return a map, containing the names of the object's properties and their
values.