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

net.optionfactory.csv.parser.CsvParserSpi Maven / Gradle / Ivy

The newest version!
package net.optionfactory.csv.parser;

import java.util.ArrayList;
import java.util.List;
import net.optionfactory.csv.parser.CsvParser.Trimming;
import net.optionfactory.csv.parser.javacc.ParseException;
import net.optionfactory.csv.parser.javacc.Token;

public interface CsvParserSpi {

    Record record(Trimming trimming) throws ParseException;

    Token skipToNextRecord() throws ParseException;

    default void add(Record r, String field){
        if(field == null) return;
        r.values.add(field); 
    }    
    
    
    public static class Record {

        public static Record empty(int beginLine, int beginColumn) {
            final Record r = new Record();
            r.values = new ArrayList<>();
            r.source = Source.of(beginLine, beginColumn, beginLine, beginColumn);
            return r;
        }

        public List values;
        public Source source;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy