cz.jalasoft.lifeconfig.reader.ConvertingConfigReader Maven / Gradle / Ivy
package cz.jalasoft.lifeconfig.reader;
import cz.jalasoft.lifeconfig.converterprovider.ConverterNotFoundException;
import cz.jalasoft.lifeconfig.converterprovider.ConverterProvider;
import cz.jalasoft.lifeconfig.converter.Converter;
import cz.jalasoft.lifeconfig.converter.ConverterException;
import cz.jalasoft.lifeconfig.format.ConfigFormat;
import cz.jalasoft.lifeconfig.format.PropertyValue;
import cz.jalasoft.lifeconfig.source.ConfigSource;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Optional;
/**
* @author Honza Lastovicka ([email protected])
* @since 2016-09-19.
*/
public final class ConvertingConfigReader implements ConfigReader {
private final ConfigSource configSource;
private final ConfigFormat configFormat;
private final ConverterProvider converterProvider;
public ConvertingConfigReader(ConfigSource configSource, ConfigFormat configFormat, ConverterProvider conversion) {
this.configSource = configSource;
this.configFormat = configFormat;
this.converterProvider = conversion;
}
@Override
public Optional