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

io.robe.convert.excel.parsers.Parsers Maven / Gradle / Ivy

The newest version!
package io.robe.convert.excel.parsers;

public enum Parsers {
    BIGDECIMAL("java.math.BigDecimal", ParseBigDecimal.class),
    BOOLEAN("java.lang.Boolean", ParseBool.class),
    BYTE("java.lang.Byte", ParseByte.class),
    DOUBLE("java.lang.Double", ParseDouble.class),
    INT("int", ParseInt.class),
    INTEGER("java.lang.Integer", ParseInt.class),
    LONG("java.lang.Long", ParseLong.class),
    STRING("java.lang.String", ParseString.class),
    DATE("java.util.Date", ParseDate.class),
    ENUM("java.lang.String", ParseEnum.class);


    private final String type;
    private final Class parser;

    public IsParser getParser() {
        try {
            return parser.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private Parsers(String type, Class parser) {
        this.type = type;
        this.parser = parser;
    }

    @Override
    public String toString() {
        return type;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy