|
From: <be...@us...> - 2006-10-26 14:04:53
|
Revision: 125
http://svn.sourceforge.net/pzfilereader/?rev=125&view=rev
Author: benoitx
Date: 2006-10-26 07:04:40 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
First cut at some interfaces. Paul, could you review and tell me if you think that they are well separated.
I think that PZParserFactory.java and PZParser.java are ok but have I put everything that is required for the manipulation
of a DataSet in IDataSet.java?
Modified Paths:
--------------
trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java
Added Paths:
-----------
trunk/PZFileReader/src/main/java/net/sf/pzfilereader/IDataSet.java
trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java
trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParserFactory.java
Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java
===================================================================
--- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java 2006-10-26 08:58:08 UTC (rev 124)
+++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java 2006-10-26 14:04:40 UTC (rev 125)
@@ -49,7 +49,7 @@
* @version 2.0.1
* @todo Ought to implement an interface for the access to data.
*/
-public class DataSet {
+public class DataSet implements IDataSet {
/** Array to hold the rows and their values in the text file */
private List rows = null;
@@ -906,27 +906,22 @@
// row.setValue(ParserUtils.findColumn(columnName, cmds), value);
}
- /**
- * Goes to the top of the data set. This will put the pointer one record
- * before the first in the set. Next() will have to be called to get the
- * first record after this call.
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#goTop()
*/
public void goTop() {
pointer = -1;
}
- /**
- * Goes to the last record in the dataset
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#goBottom()
*/
public void goBottom() {
pointer = rows.size() - 1;
}
- /**
- * Moves to the next record in the set. Returns true if move was a success,
- * false if not
- *
- * @return boolean
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#next()
*/
public boolean next() {
if (pointer < rows.size() && pointer + 1 != rows.size()) {
@@ -936,11 +931,8 @@
return false;
}
- /**
- * Moves back to the previous record in the set return true if move was a
- * success, false if not
- *
- * @return boolean
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#previous()
*/
public boolean previous() {
if (pointer <= 0) {
@@ -950,13 +942,8 @@
return true;
}
- /**
- * Returns the string value of a specified column
- *
- * @param column -
- * Name of the column
- * @exception NoSuchElementException
- * @return String
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getString(java.lang.String)
*/
public String getString(final String column) {
final Row row = (Row) rows.get(pointer);
@@ -983,14 +970,8 @@
return s;
}
- /**
- * Returns the double value of a specified column
- *
- * @param column -
- * Name of the column
- * @exception NoSuchElementException
- * @exception NumberFormatException
- * @return double
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getDouble(java.lang.String)
*/
public double getDouble(final String column) {
final StringBuffer newString = new StringBuffer();
@@ -1023,14 +1004,8 @@
return Double.parseDouble(newString.toString());
}
- /**
- * Returns the interger value of a specified column
- *
- * @param column -
- * Name of the column
- * @exception NoSuchElementException
- * @exception NumberFormatException
- * @return double
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getInt(java.lang.String)
*/
public int getInt(final String column) {
final StringBuffer newString = new StringBuffer();
@@ -1063,15 +1038,8 @@
return Integer.parseInt(newString.toString());
}
- /**
- * Returns the date value of a specified column. This assumes the date is in
- * yyyyMMdd. If your date is not in this format, see
- * getDate(String,SimpleDateFormat)
- *
- * @param column -
- * Name of the column
- * @exception ParseException
- * @return Date
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String)
*/
public Date getDate(final String column) throws ParseException {
final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@@ -1084,18 +1052,8 @@
return sdf.parse(s);
}
- /**
- * Returns the date value of a specified column. This should be used if the
- * date is NOT in yyyyMMdd format. The SimpleDateFormat object will specify
- * what kind of format the date is in.
- *
- * @param column -
- * Name of the column
- * @param sdf -
- * SimpleDateFormat of the date
- * @exception ParseException
- * @see java.text.SimpleDateFormat
- * @return Date
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String, java.text.SimpleDateFormat)
*/
public Date getDate(final String column, final SimpleDateFormat sdf) throws ParseException {
final Row row = (Row) rows.get(pointer);
@@ -1107,11 +1065,8 @@
return sdf.parse(s);
}
- /**
- * Returns a String array of column names in the DataSet. This will assume
- * 'detail' <RECORD> ID.
- *
- * @return String[]
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getColumns()
*/
public String[] getColumns() {
ColumnMetaData column = null;
@@ -1130,12 +1085,8 @@
return array;
}
- /**
- * Returns a String array of column names in the DataSet for a given
- * <RECORD> id
- *
- * @param recordID
- * @return String[]
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getColumns(java.lang.String)
*/
public String[] getColumns(final String recordID) {
String[] array = null;
@@ -1152,22 +1103,15 @@
return array;
}
- /**
- * Returns the line number the pointer is on. These are the actual line
- * numbers from the flat file, before any sorting.
- *
- * @exception NoSuchElementException
- * @exception NumberFormatException
- * @return int
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getRowNo()
*/
public int getRowNo() {
return ((Row) rows.get(pointer)).getRowNumber();
}
- /**
- * Returns A Collection Of DataErrors that happened during processing
- *
- * @return Vector
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getErrors()
*/
public List getErrors() {
return errors;
@@ -1192,19 +1136,16 @@
errors.add(de);
}
- /**
- * Removes a row from the dataset. Once the row is removed the pointer will
- * be sitting on the record previous to the deleted row.
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#remove()
*/
public void remove() {
rows.remove(pointer);
pointer--;
}
- /**
- * Returns the index the pointer is on for the array
- *
- * @return int
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getIndex()
*/
public int getIndex() {
return pointer;
@@ -1240,21 +1181,15 @@
return rowID.equals(recordID);
}
- /**
- * Returns the total number of rows parsed in from the file
- *
- *
- * @return int - Row Count
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getRowCount()
*/
public int getRowCount() {
return rows.size();
}
- /**
- * Returns total number of records which contained a parse error in the
- * file.
- *
- * @return int - Record Error Count
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getErrorCount()
*/
public int getErrorCount() {
if (getErrors() != null) {
@@ -1264,14 +1199,8 @@
return 0;
}
- /**
- * Returns true or false as to whether or not the line number contains an
- * error. The import will skip the line if it contains an error and it will
- * not be processed
- *
- * @param lineNo -
- * int line number
- * @return boolean
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#isAnError(int)
*/
public boolean isAnError(final int lineNo) {
for (int i = 0; i < errors.size(); i++) {
@@ -1282,17 +1211,8 @@
return false;
}
- /**
- * Orders the data by column(s) specified. This will reposition the cursor
- * to the top of the DataSet when executed. This is currently not supported
- * when specying <RECORD> elements in the mapping. An exception will be
- * thrown if this situation occurs
- *
- * @param ob -
- * OrderBy object
- * @exception Exception
- * @see net.sf.pzfilereader.ordering.OrderBy
- * @see net.sf.pzfilereader.ordering.OrderColumn
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#orderRows(net.sf.pzfilereader.ordering.OrderBy)
*/
public void orderRows(final OrderBy ob) throws Exception {
// PZ try to handle other <records> by sending them to
@@ -1404,6 +1324,9 @@
this.columnMD = columnMD;
}
+ /* (non-Javadoc)
+ * @see net.sf.pzfilereader.IDataSet#getRows()
+ */
public List getRows() {
return rows;
}
Added: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/IDataSet.java
===================================================================
--- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/IDataSet.java (rev 0)
+++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/IDataSet.java 2006-10-26 14:04:40 UTC (rev 125)
@@ -0,0 +1,222 @@
+/*
+ * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader.
+ *
+ * Based in London, we are world leaders in the design and development
+ * of bespoke applications for the securities financing markets.
+ *
+ * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
+ * ___ _ _ _ _ _
+ * / _ \| |__ (_) ___ ___| |_| | __ _| |__
+ * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \
+ * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) |
+ * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
+ * |__/
+ *
+ * www.ObjectLab.co.uk
+ *
+ * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $
+ *
+ * Copyright 2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package net.sf.pzfilereader;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import net.sf.pzfilereader.ordering.OrderBy;
+
+public interface IDataSet {
+
+ /**
+ * Goes to the top of the data set. This will put the pointer one record
+ * before the first in the set. Next() will have to be called to get the
+ * first record after this call.
+ */
+ void goTop();
+
+ /**
+ * Goes to the last record in the dataset
+ */
+ void goBottom();
+
+ /**
+ * Moves to the next record in the set. Returns true if move was a success,
+ * false if not
+ *
+ * @return boolean
+ */
+ boolean next();
+
+ /**
+ * Moves back to the previous record in the set return true if move was a
+ * success, false if not
+ *
+ * @return boolean
+ */
+ boolean previous();
+
+ /**
+ * Returns the string value of a specified column
+ *
+ * @param column -
+ * Name of the column
+ * @exception NoSuchElementException
+ * @return String
+ */
+ String getString(final String column);
+
+ /**
+ * Returns the double value of a specified column
+ *
+ * @param column -
+ * Name of the column
+ * @exception NoSuchElementException
+ * @exception NumberFormatException
+ * @return double
+ */
+ double getDouble(final String column);
+
+ /**
+ * Returns the interger value of a specified column
+ *
+ * @param column -
+ * Name of the column
+ * @exception NoSuchElementException
+ * @exception NumberFormatException
+ * @return double
+ */
+ int getInt(final String column);
+
+ /**
+ * Returns the date value of a specified column. This assumes the date is in
+ * yyyyMMdd. If your date is not in this format, see
+ * getDate(String,SimpleDateFormat)
+ *
+ * @param column -
+ * Name of the column
+ * @exception ParseException
+ * @return Date
+ */
+ Date getDate(final String column) throws ParseException;
+
+ /**
+ * Returns the date value of a specified column. This should be used if the
+ * date is NOT in yyyyMMdd format. The SimpleDateFormat object will specify
+ * what kind of format the date is in.
+ *
+ * @param column -
+ * Name of the column
+ * @param sdf -
+ * SimpleDateFormat of the date
+ * @exception ParseException
+ * @see java.text.SimpleDateFormat
+ * @return Date
+ */
+ Date getDate(final String column, final SimpleDateFormat sdf) throws ParseException;
+
+ /**
+ * Returns a String array of column names in the DataSet. This will assume
+ * 'detail' <RECORD> ID.
+ *
+ * @return String[]
+ */
+ String[] getColumns();
+
+ /**
+ * Returns a String array of column names in the DataSet for a given
+ * <RECORD> id
+ *
+ * @param recordID
+ * @return String[]
+ */
+ String[] getColumns(final String recordID);
+
+ /**
+ * Returns the line number the pointer is on. These are the actual line
+ * numbers from the flat file, before any sorting.
+ *
+ * @exception NoSuchElementException
+ * @exception NumberFormatException
+ * @return int
+ */
+ int getRowNo();
+
+ /**
+ * Returns A Collection Of DataErrors that happened during processing
+ *
+ * @return Vector
+ */
+ List getErrors();
+
+ /**
+ * Removes a row from the dataset. Once the row is removed the pointer will
+ * be sitting on the record previous to the deleted row.
+ */
+ void remove();
+
+ /**
+ * Returns the index the pointer is on for the array
+ *
+ * @return int
+ */
+ int getIndex();
+
+ /**
+ * Returns the total number of rows parsed in from the file
+ *
+ *
+ * @return int - Row Count
+ */
+ int getRowCount();
+
+ /**
+ * Returns total number of records which contained a parse error in the
+ * file.
+ *
+ * @return int - Record Error Count
+ */
+ int getErrorCount();
+
+ /**
+ * Returns true or false as to whether or not the line number contains an
+ * error. The import will skip the line if it contains an error and it will
+ * not be processed
+ *
+ * @param lineNo -
+ * int line number
+ * @return boolean
+ */
+ boolean isAnError(final int lineNo);
+
+ /**
+ * Orders the data by column(s) specified. This will reposition the cursor
+ * to the top of the DataSet when executed. This is currently not supported
+ * when specying <RECORD> elements in the mapping. An exception will be
+ * thrown if this situation occurs
+ *
+ * @param ob -
+ * OrderBy object
+ * @exception Exception
+ * @see net.sf.pzfilereader.ordering.OrderBy
+ * @see net.sf.pzfilereader.ordering.OrderColumn
+ */
+ void orderRows(final OrderBy ob) throws Exception;
+
+ List getRows();
+
+}
\ No newline at end of file
Added: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java
===================================================================
--- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java (rev 0)
+++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java 2006-10-26 14:04:40 UTC (rev 125)
@@ -0,0 +1,64 @@
+/*
+ * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader.
+ *
+ * Based in London, we are world leaders in the design and development
+ * of bespoke applications for the securities financing markets.
+ *
+ * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
+ * ___ _ _ _ _ _
+ * / _ \| |__ (_) ___ ___| |_| | __ _| |__
+ * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \
+ * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) |
+ * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
+ * |__/
+ *
+ * www.ObjectLab.co.uk
+ *
+ * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $
+ *
+ * Copyright 2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package net.sf.pzfilereader;
+
+/**
+ * PZParser is ready to parse the data and return an object that can then be traversed.
+ * The default parser should NOT handle short lines, the user can change it prior to calling
+ * parse.
+ *
+ * @author Benoit Xhenseval
+ */
+public interface PZParser {
+
+ /**
+ * Start the parsing
+ * @return the data set resulting from parsing
+ */
+ IDataSet parse();
+
+ /**
+ * @return true, lines with less columns then the amount
+ * of column headers will be added as empty's instead of
+ * producing an error
+ */
+ boolean isHandlingShortLines();
+
+ /**
+ * @param handleShortLines -
+ * when flaged as true, lines with less columns then the amount
+ * of column headers will be added as empty's instead of
+ * producing an error
+ */
+ void setHandlingShortLines(final boolean handleShortLines);
+}
Added: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParserFactory.java
===================================================================
--- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParserFactory.java (rev 0)
+++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParserFactory.java 2006-10-26 14:04:40 UTC (rev 125)
@@ -0,0 +1,231 @@
+/*
+ * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader.
+ *
+ * Based in London, we are world leaders in the design and development
+ * of bespoke applications for the securities financing markets.
+ *
+ * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
+ * ___ _ _ _ _ _
+ * / _ \| |__ (_) ___ ___| |_| | __ _| |__
+ * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \
+ * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) |
+ * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
+ * |__/
+ *
+ * www.ObjectLab.co.uk
+ *
+ * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $
+ *
+ * Copyright 2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package net.sf.pzfilereader;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.Connection;
+
+/**
+ * Factory definitions for creating a PZParser (delimiter or fixed length). The
+ * creation of a parser will not start the parsing. It should not fail either
+ * (unless DB issues etc).
+ *
+ * @author Benoit Xhenseval
+ */
+public interface PZParserFactory {
+ /**
+ * Constructs a new DataSet using the database table file layout method.
+ * This is used for a FIXED LENGTH text file.
+ *
+ * The user is responsible for closing the DB connection.
+ *
+ * @param con -
+ * Connection to database with DATAFILE and DATASTRUCTURE tables,
+ * user is responsible for closing it.
+ * @param dataSource -
+ * Fixed length file to read from
+ * @param dataDefinition -
+ * Name of dataDefinition in the DATAFILE table DATAFILE_DESC
+ * column
+ */
+ PZParser newParser(final Connection con, final File dataSource, final String dataDefinition);
+
+ /**
+ * Constructs a new DataSet using the database table file layout method.
+ * This is used for a FIXED LENGTH text file.
+ *
+ * The user is responsible for closing the DB connection and InputStream.
+ *
+ * @param con -
+ * Connection to database with DATAFILE and DATASTRUCTURE tables,
+ * user is responsible for closing it.
+ * @param dataSourceStream -
+ * text file datasource InputStream to read from
+ * @param dataDefinition -
+ * Name of dataDefinition in the DATAFILE table DATAFILE_DESC
+ * column
+ */
+ PZParser newParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition);
+
+ /**
+ * Constructs a new DataSet using the PZMAP XML file layout method. This is
+ * used for a FIXED LENGTH text file.
+ *
+ * @param pzmapXML -
+ * Reference to the xml file holding the pzmap
+ * @param dataSource -
+ * Delimited file to read from
+ */
+ PZParser newParser(final File pzmapXML, final File dataSource);
+
+ /**
+ * 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.
+ *
+ * @param pzmapXMLStream -
+ * Reference to the xml file InputStream holding the pzmap, user
+ * must close them after use.
+ * @param dataSourceStream -
+ * Delimited file InputStream to read from, user must close them
+ * after use.
+ */
+ PZParser newParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream);
+
+ //
+ //
+ // ------------------------------------------ DELIMITED -----------
+ //
+ //
+
+ /**
+ * New constructor based on InputStream. Constructs a new DataSet using the
+ * database table file layout method. This is used for a DELIMITED text
+ * file. esacpe sequence reference: \n newline <br>
+ * \t tab <br>
+ * \b backspace <br>
+ * \r return <br>
+ * \f form feed <br> \\ backslash <br> \' single quote <br> \" double quote
+ *
+ * The user is responsible for closing the DB connection and InputStream.
+ *
+ * @param con -
+ * Connection to database with DATAFILE and DATASTRUCTURE tables,
+ * user must close it when done.
+ * @param dataSourceStream -
+ * text file datasource InputStream to read from, user must close
+ * it when done.
+ * @param dataDefinition -
+ * Name of dataDefinition in the DATAFILE table DATAFILE_DESC
+ * column
+ * @param delimiter -
+ * Char the file is delimited By
+ * @param qualifier -
+ * Char text is qualified by
+ * @param ignoreFirstRecord -
+ * skips the first line that contains data in the file
+ */
+ PZParser newParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition,
+ final char delimiter, final char qualifier, final boolean ignoreFirstRecord);
+
+ /**
+ * Constructs a new DataSet using the PZMAP XML file layout method. This is
+ * used for a DELIMITED text file. esacpe sequence reference: \n newline
+ * <br>
+ * \t tab <br>
+ * \b backspace <br>
+ * \r return <br>
+ * \f form feed <br> \\ backslash <br> \' single quote <br> \" double quote
+ *
+ * @param pzmapXML -
+ * Reference to the xml file holding the pzmap
+ * @param dataSource -
+ * text file datasource to read from
+ * @param delimiter -
+ * Char the file is delimited By
+ * @param qualifier -
+ * Char text is qualified by
+ * @param ignoreFirstRecord -
+ * skips the first line that contains data in the file
+ */
+ PZParser newParser(final File pzmapXML, final File dataSource, final char delimiter, final char qualifier,
+ final boolean ignoreFirstRecord);
+
+ /**
+ * 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 <br>
+ * \t tab <br>
+ * \b backspace <br>
+ * \r return <br>
+ * \f form feed <br> \\ backslash <br> \' single quote <br> \" double quote
+ *
+ * The user is responsible for closing the InputStreams.
+ *
+ * @param pzmapXMLStream -
+ * Reference to the xml file holding the pzmap, user must close
+ * it when done.
+ * @param dataSourceStream -
+ * text file datasource InputStream to read from, user must close
+ * it when done.
+ * @param delimiter -
+ * Char the file is delimited By
+ * @param qualifier -
+ * Char text is qualified by
+ * @param ignoreFirstRecord -
+ * skips the first line that contains data in the file
+ */
+ PZParser newParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream, final char delimiter,
+ final char qualifier, final boolean ignoreFirstRecord);
+
+ /**
+ * 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 <br>
+ * \t tab <br>
+ * \b backspace <br>
+ * \r return <br>
+ * \f form feed <br> \\ backslash <br> \' single quote <br> \" double quote
+ *
+ * @param dataSource -
+ * text file datasource to read from
+ * @param delimiter -
+ * Char the file is delimited By
+ * @param qualifier -
+ * Char text is qualified by
+ */
+ PZParser newParser(final File dataSource, final char delimiter, final char qualifier);
+
+ /**
+ * 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 <br>
+ * \t tab <br>
+ * \b backspace <br>
+ * \r return <br>
+ * \f form feed <br> \\ backslash <br> \' single quote <br> \" double quote
+ *
+ * The user must close the InputStream when done (after parsing).
+ *
+ * @param dataSource -
+ * text file InputStream to read from, user must close it when
+ * done.
+ * @param delimiter -
+ * Char the file is delimited By
+ * @param qualifier -
+ * Char text is qualified by
+ */
+ PZParser newParser(final InputStream dataSource, final char delimiter, final char qualifier);
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|