net.sf.flatpack.brparse
Class BuffReaderParseFactory

java.lang.Object
  extended by net.sf.flatpack.brparse.BuffReaderParseFactory
All Implemented Interfaces:
ParserFactory

public class BuffReaderParseFactory
extends java.lang.Object
implements ParserFactory

Provides a PZParser which obtains records directly from a BufferedReader as an alternative to reading the entire file into memory. Database column mappings are not supported by this factory at the present time. This class is meant to mimic the LargeDataSet class of pre 3.0 versions, which did not support database mappings either. A RuntimeExcpetion will be thrown if trying to obtain a parser for a database map.

Author:
Paul Zepernick

Constructor Summary
BuffReaderParseFactory()
           
 
Method Summary
static ParserFactory getInstance()
           
 Parser newDelimitedParser(java.sql.Connection con, java.io.InputStream dataSourceStream, java.lang.String dataDefinition, char delimiter, char qualifier, boolean ignoreFirstRecord)
          Not supported at this time.
 Parser newDelimitedParser(java.sql.Connection con, java.io.Reader dataSource, java.lang.String dataDefinition, char delimiter, char qualifier, boolean ignoreFirstRecord)
          Not supported at this time.
 Parser newDelimitedParser(java.io.File dataSource, char delimiter, char qualifier)
          Constructs a new DataSet using the first line of data found in the text file as the column names.
 Parser newDelimitedParser(java.io.File pzmapXML, java.io.File dataSource, char delimiter, char qualifier, boolean ignoreFirstRecord)
          Constructs a new DataSet using the PZMAP XML file layout method.
 Parser newDelimitedParser(java.io.InputStream dataSourceStream, char delimiter, char qualifier)
          Constructs a new DataSet using the first line of data found in the text file as the column names.
 Parser newDelimitedParser(java.io.InputStream pzmapXMLStream, java.io.InputStream dataSourceStream, char delimiter, char qualifier, boolean ignoreFirstRecord)
          New constructor based on InputStream.
 Parser newDelimitedParser(java.io.Reader dataSource, char delimiter, char qualifier)
          Constructs a new DataSet using the first line of data found in the text file as the column names.
 Parser newDelimitedParser(java.io.Reader pzmapXML, java.io.Reader dataSource, char delimiter, char qualifier, boolean ignoreFirstRecord)
          Constructs a new DataSet using the PZMAP XML file layout method.
 Parser newFixedLengthParser(java.sql.Connection con, java.io.File dataSource, java.lang.String dataDefinition)
          Not supported at this time.
 Parser newFixedLengthParser(java.sql.Connection con, java.io.InputStream dataSourceStream, java.lang.String dataDefinition)
          Not supported at this time.
 Parser newFixedLengthParser(java.sql.Connection con, java.io.Reader dataSource, java.lang.String dataDefinition)
          Not supported at this time.
 Parser newFixedLengthParser(java.io.File pzmapXML, java.io.File dataSource)
          Constructs a new DataSet using the PZMAP XML file layout method.
 Parser newFixedLengthParser(java.io.InputStream pzmapXMLStream, java.io.InputStream dataSourceStream)
          New constructor based on InputStream.
 Parser newFixedLengthParser(java.io.Reader pzmapXMLStream, java.io.Reader dataSource)
          New constructor based on Reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuffReaderParseFactory

public BuffReaderParseFactory()
Method Detail

getInstance

public static ParserFactory getInstance()

newFixedLengthParser

public Parser newFixedLengthParser(java.sql.Connection con,
                                   java.io.File dataSource,
                                   java.lang.String dataDefinition)
Not supported at this time.

Specified by:
newFixedLengthParser in interface ParserFactory
Parameters:
con - - Connection to database with DATAFILE and DATASTRUCTURE tables, user is responsible for closing it.
dataSource - - Fixed length file to read from
dataDefinition - - Name of dataDefinition in the DATAFILE table DATAFILE_DESC column
Returns:
PZParser

newFixedLengthParser

public Parser newFixedLengthParser(java.sql.Connection con,
                                   java.io.InputStream dataSourceStream,
                                   java.lang.String dataDefinition)
Not supported at this time.

Specified by:
newFixedLengthParser in interface ParserFactory
Parameters:
con - - Connection to database with DATAFILE and DATASTRUCTURE tables, user is responsible for closing it.
dataSourceStream - - text file datasource InputStream to read from
dataDefinition - - Name of dataDefinition in the DATAFILE table DATAFILE_DESC column
Returns:
PZParser

newFixedLengthParser

public Parser newFixedLengthParser(java.io.File pzmapXML,
                                   java.io.File dataSource)
Description copied from interface: ParserFactory
Constructs a new DataSet using the PZMAP XML file layout method. This is used for a FIXED LENGTH text file.

Specified by:
newFixedLengthParser in interface ParserFactory
Parameters:
pzmapXML - - Reference to the xml file holding the pzmap
dataSource - - Delimited file to read from
Returns:
PZParser

newFixedLengthParser

public Parser newFixedLengthParser(java.sql.Connection con,
                                   java.io.Reader dataSource,
                                   java.lang.String dataDefinition)
Not supported at this time.

Specified by:
newFixedLengthParser in interface ParserFactory
Parameters:
con - - Connection to database with DATAFILE and DATASTRUCTURE tables, user is responsible for closing it.
dataSource - - Fixed length file to read from
dataDefinition - - Name of dataDefinition in the DATAFILE table DATAFILE_DESC column
Returns:
PZParser

newFixedLengthParser

public Parser newFixedLengthParser(java.io.Reader pzmapXMLStream,
                                   java.io.Reader dataSource)
Description copied from interface: ParserFactory
New constructor based on Reader. Constructs a new DataSet using the PZMAP XML file layout method. This is used for a FIXED LENGTH text file. The user is responsible for closing the Readers.

Specified by:
newFixedLengthParser in interface ParserFactory
Parameters:
pzmapXMLStream - - Reference to the xml Reader holding the pzmap, user must close them after use.
dataSource - - Delimited file Reader to read from, user must close them after use.
Returns:
PZParser

newFixedLengthParser

public Parser newFixedLengthParser(java.io.InputStream pzmapXMLStream,
                                   java.io.InputStream dataSourceStream)
Description copied from interface: ParserFactory
New constructor based on InputStream. Constructs a new DataSet using the PZMAP XML file layout method. This is used for a FIXED LENGTH text file. The user is responsible for closing the InputStreams.

Specified by:
newFixedLengthParser in interface ParserFactory
Parameters:
pzmapXMLStream - - Reference to the xml file InputStream holding the pzmap, user must close them after use.
dataSourceStream - - Delimited file InputStream to read from, user must close them after use.
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.sql.Connection con,
                                 java.io.InputStream dataSourceStream,
                                 java.lang.String dataDefinition,
                                 char delimiter,
                                 char qualifier,
                                 boolean ignoreFirstRecord)
Not supported at this time.

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
con - - Connection to database with DATAFILE and DATASTRUCTURE tables, user must close it when done.
dataSourceStream - - text file datasource InputStream to read from, user must close it when done.
dataDefinition - - Name of dataDefinition in the DATAFILE table DATAFILE_DESC column
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
ignoreFirstRecord - - skips the first line that contains data in the file
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.io.File pzmapXML,
                                 java.io.File dataSource,
                                 char delimiter,
                                 char qualifier,
                                 boolean ignoreFirstRecord)
Description copied from interface: ParserFactory
Constructs a new DataSet using the PZMAP XML file layout method. This is used for a DELIMITED text file. esacpe sequence reference: \n newline
\t tab
\b backspace
\r return
\f form feed
\\ backslash
\' single quote
\" double quote

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
pzmapXML - - Reference to the xml file holding the pzmap
dataSource - - text file datasource to read from
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
ignoreFirstRecord - - skips the first line that contains data in the file
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.io.InputStream pzmapXMLStream,
                                 java.io.InputStream dataSourceStream,
                                 char delimiter,
                                 char qualifier,
                                 boolean ignoreFirstRecord)
Description copied from interface: ParserFactory
New constructor based on InputStream. Constructs a new DataSet using the PZMAP XML file layout method. This is used for a DELIMITED text file. esacpe sequence reference: \n newline
\t tab
\b backspace
\r return
\f form feed
\\ backslash
\' single quote
\" double quote The user is responsible for closing the InputStreams.

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
pzmapXMLStream - - Reference to the xml file holding the pzmap, user must close it when done.
dataSourceStream - - text file datasource InputStream to read from, user must close it when done.
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
ignoreFirstRecord - - skips the first line that contains data in the file
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.io.File dataSource,
                                 char delimiter,
                                 char qualifier)
Description copied from interface: ParserFactory
Constructs a new DataSet using the first line of data found in the text file as the column names. This is used for a DELIMITED text file. esacpe sequence reference: \n newline
\t tab
\b backspace
\r return
\f form feed
\\ backslash
\' single quote
\" double quote

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
dataSource - - text file datasource to read from
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.io.InputStream dataSourceStream,
                                 char delimiter,
                                 char qualifier)
Description copied from interface: ParserFactory
Constructs a new DataSet using the first line of data found in the text file as the column names. This is used for a DELIMITED text file. esacpe sequence reference: \n newline
\t tab
\b backspace
\r return
\f form feed
\\ backslash
\' single quote
\" double quote The user must close the InputStream when done (after parsing).

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
dataSourceStream - - text file InputStream to read from, user must close it when done.
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.sql.Connection con,
                                 java.io.Reader dataSource,
                                 java.lang.String dataDefinition,
                                 char delimiter,
                                 char qualifier,
                                 boolean ignoreFirstRecord)
Not supported at this time.

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
con - - Connection to database with DATAFILE and DATASTRUCTURE tables, user must close it when done.
dataSource - - text file datasource InputStream to read from, user must close it when done.
dataDefinition - - Name of dataDefinition in the DATAFILE table DATAFILE_DESC column
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
ignoreFirstRecord - - skips the first line that contains data in the file
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.io.Reader dataSource,
                                 char delimiter,
                                 char qualifier)
Description copied from interface: ParserFactory
Constructs a new DataSet using the first line of data found in the text file as the column names. This is used for a DELIMITED text file. esacpe sequence reference: \n newline
\t tab
\b backspace
\r return
\f form feed
\\ backslash
\' single quote
\" double quote

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
dataSource - - text file datasource to read from
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
Returns:
PZParser

newDelimitedParser

public Parser newDelimitedParser(java.io.Reader pzmapXML,
                                 java.io.Reader dataSource,
                                 char delimiter,
                                 char qualifier,
                                 boolean ignoreFirstRecord)
Description copied from interface: ParserFactory
Constructs a new DataSet using the PZMAP XML file layout method. This is used for a DELIMITED text file. esacpe sequence reference: \n newline
\t tab
\b backspace
\r return
\f form feed
\\ backslash
\' single quote
\" double quote

Specified by:
newDelimitedParser in interface ParserFactory
Parameters:
pzmapXML - - Reference to the xml file holding the pzmap
dataSource - - text file datasource to read from
delimiter - - Char the file is delimited By
qualifier - - Char text is qualified by
ignoreFirstRecord - - skips the first line that contains data in the file
Returns:
PZParser


Copyright © 2006-2011 Appendium - Portfolio Financing Platform. All Rights Reserved.