convertValue(ci.interpolate(value), targetClass, ci));
/** * Performs the conversion from the passed in source object to the specified * target class. This method is called for each conversion to be done. The * source object has already been passed to the * {@link ConfigurationInterpolator}, so interpolation does not have to be * done again. (The passed in {@code ConfigurationInterpolator} may still be * necessary for extracting values from complex objects; it is guaranteed to * be non <b>null</b>.) The source object may be a complex object, e.g. a * collection or an array. This base implementation checks whether the * source object is complex. If so, it delegates to * {@link #extractConversionValue(Object, Class, ConfigurationInterpolator)} * to obtain a single value. Eventually, * {@link #convertValue(Object, Class, ConfigurationInterpolator)} is called * with the single value to be converted. * * @param <T> the desired target type of the conversion * @param src the source object to be converted * @param targetCls the desired target class * @param ci the {@code ConfigurationInterpolator} (not <b>null</b>) * @return the converted value * @throws ConversionException if conversion is not possible */ protected <T> T convert(final Object src, final Class<T> targetCls, final ConfigurationInterpolator ci) { final Object conversionSrc = isComplexObject(src) ? extractConversionValue(src, targetCls, ci) : src; return convertValue(ci.interpolate(conversionSrc), targetCls, ci); }