private void processValueForCounter(String counterName, Object value, String[] path) {
		String key = path[0];
		Object result = null;
		if (value instanceof List) {
			for (Object item : (List<?>) value) {
				processValueForCounter(counterName, item, path);
			}
		}
		else if (value instanceof Tuple) {
			Tuple t = (Tuple) value;
			if (t.hasFieldName(key)) {
				result = t.getValue(key);
			}
		}
		else if (value instanceof Map) {
			result = ((Map<?, ?>) value).get(key);
		}
		if (result != null) {
			if (path.length == 1) {
				processValue(counterName, result);
			}
			else {
				path = Arrays.copyOfRange(path, 1, path.length);
				processValueForCounter(counterName, result, path);
			}
		}
	}
Counts the occurrence of values for a set of JavaBean properties or Tuple fields using a FieldValueCounterRepository.
Assumes a String payload is JSON and will convert it to a Tuple.

@author Mark Pollack
@author David Turanski
@author Mark Fisher
spring-xd-analytics/src/main/java/org/springframework/xd/analytics/metrics/integration/FieldValueCounterHandler.java