public Object reverseConversions()

in src/main/java/com/univocity/parsers/common/fields/FieldConversionMapping.java [207:245]


	public Object reverseConversions(boolean executeInReverseOrder, int index, Object value, boolean[] convertedFlags) {
		List<Conversion<?, ?>> conversions = conversionsByIndex.get(index);
		if (conversions != null) {
			if (convertedFlags != null) {
				convertedFlags[index] = true;
			}
			Conversion conversion = null;
			try {
				if (executeInReverseOrder) {
					for (int i = conversions.size() - 1; i >= 0; i--) {
						conversion = conversions.get(i);
						value = conversion.revert(value);
					}
				} else {
					for (Conversion<?, ?> c : conversions) {
						conversion = c;
						value = conversion.revert(value);
					}
				}
			} catch (DataProcessingException ex) {
				ex.setValue(value);
				ex.setColumnIndex(index);
				ex.markAsNonFatal();
				throw ex;
			} catch (Throwable ex) {
				DataProcessingException exception;
				if (conversion != null) {
					exception = new DataProcessingException("Error converting value '{value}' using conversion " + conversion.getClass().getName(), ex);
				} else {
					exception = new DataProcessingException("Error converting value '{value}'", ex);
				}
				exception.setValue(value);
				exception.setColumnIndex(index);
				exception.markAsNonFatal();
				throw exception;
			}
		}
		return value;
	}