All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sfm.csv.column.CustomReaderProperty Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

There is a newer version: 1.10.3
Show newest version
package org.sfm.csv.column;


import org.sfm.csv.CellValueReader;
import org.sfm.map.column.ColumnProperty;
import org.sfm.reflect.TypeHelper;

import java.lang.reflect.Type;

public class CustomReaderProperty implements ColumnProperty {
    private final CellValueReader reader;

    public CustomReaderProperty(CellValueReader reader) {
        if (reader == null) throw new NullPointerException();
        this.reader = reader;
    }

    public CellValueReader getReader() {
        return reader;
    }

    public Type getReturnType() {
        final Type[] paramTypesForInterface = TypeHelper.getParamTypesForInterface(reader.getClass(), CellValueReader.class);
        return paramTypesForInterface != null ? paramTypesForInterface[0] : null;
    }


    @Override
    public String toString() {
        return "CustomReader{CellValueReader}";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy