// Path: flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderParseFactory.java
// public class BuffReaderParseFactory implements ParserFactory {
//     private static final BuffReaderParseFactory INSTANCE = new BuffReaderParseFactory();
// 
//     public static ParserFactory getInstance() {
//         return INSTANCE;
//     }
// 
//     /**
//      * Not supported at this time.
//      */
//     @Override
//     public Parser newFixedLengthParser(final Connection con, final File dataSource, final String dataDefinition) {
//         throw new UnsupportedOperationException("Not supported...");
//     }
// 
//     /**
//      * Not supported at this time.
//      */
//     @Override
//     public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) {
//         throw new UnsupportedOperationException("Not supported...");
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.File,
//      *      java.io.File)
//      */
//     @Override
//     public Parser newFixedLengthParser(final File pzmapXML, final File dataSource) {
//         return new BuffReaderFixedParser(pzmapXML, dataSource);
//     }
// 
//     @Override
//     public Parser newFixedLengthParser(final Connection con, final Reader dataSource, final String dataDefinition) {
//         return new DBBuffReaderFixedParser(con, dataSource, dataDefinition);
//     }
// 
//     @Override
//     public Parser newFixedLengthParser(final Reader pzmapXMLStream, final Reader dataSource) {
//         return new BuffReaderFixedParser(pzmapXMLStream, dataSource);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.InputStream,
//      *      java.io.InputStream)
//      */
//     @Override
//     public Parser newFixedLengthParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream) {
//         return new BuffReaderFixedParser(pzmapXMLStream, dataSourceStream);
//     }
// 
//     @Override
//     public Parser newDelimitedParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition, final char delimiter,
//             final char qualifier, final boolean ignoreFirstRecord) {
//         throw new UnsupportedOperationException("Not supported.  Use 'Reader' Constructor Instead Of InputStream.");
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.File,
//      *      java.io.File, char, char, boolean)
//      */
//     @Override
//     public Parser newDelimitedParser(final File pzmapXML, final File dataSource, final char delimiter, final char qualifier,
//             final boolean ignoreFirstRecord) {
//         return new BuffReaderDelimParser(pzmapXML, dataSource, delimiter, qualifier, ignoreFirstRecord);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.InputStream,
//      *      java.io.InputStream, char, char, boolean)
//      */
//     @Override
//     public Parser newDelimitedParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream, final char delimiter, final char qualifier,
//             final boolean ignoreFirstRecord) {
//         return new BuffReaderDelimParser(pzmapXMLStream, dataSourceStream, delimiter, qualifier, ignoreFirstRecord);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.File, char,
//      *      char)
//      */
//     @Override
//     public Parser newDelimitedParser(final File dataSource, final char delimiter, final char qualifier) {
//         return new BuffReaderDelimParser(dataSource, delimiter, qualifier, false);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.InputStream,
//      *      char, char)
//      */
//     @Override
//     public Parser newDelimitedParser(final InputStream dataSourceStream, final char delimiter, final char qualifier) {
//         return new BuffReaderDelimParser(dataSourceStream, delimiter, qualifier, false);
//     }
// 
//     /**
//      * Not supported at this time.
//      */
//     @Override
//     public Parser newDelimitedParser(final Connection con, final Reader dataSource, final String dataDefinition, final char delimiter,
//             final char qualifier, final boolean ignoreFirstRecord) {
//         return new DBBuffReaderDelimParser(con, dataSource, dataDefinition, delimiter, qualifier, ignoreFirstRecord);
//     }
// 
//     @Override
//     public Parser newDelimitedParser(final Reader dataSource, final char delimiter, final char qualifier) {
//         return new BuffReaderDelimParser(dataSource, delimiter, qualifier, false);
//     }
// 
//     @Override
//     public Parser newDelimitedParser(final Reader pzmapXML, final Reader dataSource, final char delimiter, final char qualifier,
//             final boolean ignoreFirstRecord) {
//         return new BuffReaderDelimParser(pzmapXML, dataSource, delimiter, qualifier, ignoreFirstRecord);
//     }
// }


import java.io.Reader;
import lombok.experimental.UtilityClass;
import net.sf.flatpack.brparse.BuffReaderParseFactory;
package net.sf.flatpack;



/**
 * Easy way to get a CSV Parser (separator , and qualifier ").
 *
 */
@UtilityClass
public final class CsvParserFactory {
    /**
     * This should be your default mechanism, it does not keep previous records as you stream the results, so
     * it is more memory efficient but the downside is that you cannot reset the parsing or restart it.  It reads
     * a line, parses it and returns a Record or the next entry in the DataSet.
     * @param reader the data source
     * @return a CSV Parser
     */
    public static Parser newForwardParser(Reader reader) {
// Path: flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderParseFactory.java
// public class BuffReaderParseFactory implements ParserFactory {
//     private static final BuffReaderParseFactory INSTANCE = new BuffReaderParseFactory();
// 
//     public static ParserFactory getInstance() {
//         return INSTANCE;
//     }
// 
//     /**
//      * Not supported at this time.
//      */
//     @Override
//     public Parser newFixedLengthParser(final Connection con, final File dataSource, final String dataDefinition) {
//         throw new UnsupportedOperationException("Not supported...");
//     }
// 
//     /**
//      * Not supported at this time.
//      */
//     @Override
//     public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) {
//         throw new UnsupportedOperationException("Not supported...");
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.File,
//      *      java.io.File)
//      */
//     @Override
//     public Parser newFixedLengthParser(final File pzmapXML, final File dataSource) {
//         return new BuffReaderFixedParser(pzmapXML, dataSource);
//     }
// 
//     @Override
//     public Parser newFixedLengthParser(final Connection con, final Reader dataSource, final String dataDefinition) {
//         return new DBBuffReaderFixedParser(con, dataSource, dataDefinition);
//     }
// 
//     @Override
//     public Parser newFixedLengthParser(final Reader pzmapXMLStream, final Reader dataSource) {
//         return new BuffReaderFixedParser(pzmapXMLStream, dataSource);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.InputStream,
//      *      java.io.InputStream)
//      */
//     @Override
//     public Parser newFixedLengthParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream) {
//         return new BuffReaderFixedParser(pzmapXMLStream, dataSourceStream);
//     }
// 
//     @Override
//     public Parser newDelimitedParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition, final char delimiter,
//             final char qualifier, final boolean ignoreFirstRecord) {
//         throw new UnsupportedOperationException("Not supported.  Use 'Reader' Constructor Instead Of InputStream.");
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.File,
//      *      java.io.File, char, char, boolean)
//      */
//     @Override
//     public Parser newDelimitedParser(final File pzmapXML, final File dataSource, final char delimiter, final char qualifier,
//             final boolean ignoreFirstRecord) {
//         return new BuffReaderDelimParser(pzmapXML, dataSource, delimiter, qualifier, ignoreFirstRecord);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.InputStream,
//      *      java.io.InputStream, char, char, boolean)
//      */
//     @Override
//     public Parser newDelimitedParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream, final char delimiter, final char qualifier,
//             final boolean ignoreFirstRecord) {
//         return new BuffReaderDelimParser(pzmapXMLStream, dataSourceStream, delimiter, qualifier, ignoreFirstRecord);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.File, char,
//      *      char)
//      */
//     @Override
//     public Parser newDelimitedParser(final File dataSource, final char delimiter, final char qualifier) {
//         return new BuffReaderDelimParser(dataSource, delimiter, qualifier, false);
//     }
// 
//     /*
//      * (non-Javadoc)
//      *
//      * @see net.sf.flatpack.PZParserFactory#newParser(java.io.InputStream,
//      *      char, char)
//      */
//     @Override
//     public Parser newDelimitedParser(final InputStream dataSourceStream, final char delimiter, final char qualifier) {
//         return new BuffReaderDelimParser(dataSourceStream, delimiter, qualifier, false);
//     }
// 
//     /**
//      * Not supported at this time.
//      */
//     @Override
//     public Parser newDelimitedParser(final Connection con, final Reader dataSource, final String dataDefinition, final char delimiter,
//             final char qualifier, final boolean ignoreFirstRecord) {
//         return new DBBuffReaderDelimParser(con, dataSource, dataDefinition, delimiter, qualifier, ignoreFirstRecord);
//     }
// 
//     @Override
//     public Parser newDelimitedParser(final Reader dataSource, final char delimiter, final char qualifier) {
//         return new BuffReaderDelimParser(dataSource, delimiter, qualifier, false);
//     }
// 
//     @Override
//     public Parser newDelimitedParser(final Reader pzmapXML, final Reader dataSource, final char delimiter, final char qualifier,
//             final boolean ignoreFirstRecord) {
//         return new BuffReaderDelimParser(pzmapXML, dataSource, delimiter, qualifier, ignoreFirstRecord);
//     }
// }


// Path: flatpack/src/main/java/net/sf/flatpack/CsvParserFactory.java
import java.io.Reader;
import lombok.experimental.UtilityClass;
import net.sf.flatpack.brparse.BuffReaderParseFactory;

package net.sf.flatpack;



/**
 * Easy way to get a CSV Parser (separator , and qualifier ").
 *
 */
@UtilityClass
public final class CsvParserFactory {
    /**
     * This should be your default mechanism, it does not keep previous records as you stream the results, so
     * it is more memory efficient but the downside is that you cannot reset the parsing or restart it.  It reads
     * a line, parses it and returns a Record or the next entry in the DataSet.
     * @param reader the data source
     * @return a CSV Parser
     */
    public static Parser newForwardParser(Reader reader) {
        return BuffReaderParseFactory.getInstance().newDelimitedParser(reader, ',', '"');