class ListFieldProcessor implements FieldProcessor {

	@Override
	public Object mapResourceToField(Resource resource, ValueMap valueMap, Field field, String propertyName) {
		if (valueMap == null) {
			return null;
		}
		Object value = valueMap.get(propertyName);
		if (value == null) {
			return null;
		}
		if (value.getClass().isArray()) {
			return Arrays.asList((Object[]) value);
		} else {
			return Arrays.asList(value);
		}
	}

}