You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(112) |
Nov
(44) |
Dec
(49) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(14) |
Feb
(12) |
Mar
(12) |
Apr
(12) |
May
(6) |
Jun
(11) |
Jul
(10) |
Aug
(6) |
Sep
(17) |
Oct
(3) |
Nov
(22) |
Dec
|
2008 |
Jan
(3) |
Feb
(7) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(2) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <be...@us...> - 2010-03-23 21:33:54
|
Revision: 418 http://flatpack.svn.sourceforge.net/flatpack/?rev=418&view=rev Author: benoitx Date: 2010-03-23 21:33:47 +0000 (Tue, 23 Mar 2010) Log Message: ----------- Fixing a lot of Sonar issues. (the easy ones!) Modified Paths: -------------- trunk/flatpack/pom.xml trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/InitialisationException.java trunk/flatpack/src/main/java/net/sf/flatpack/Version.java trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java trunk/flatpack/src/main/java/net/sf/flatpack/converter/ConvertInteger.java trunk/flatpack/src/main/java/net/sf/flatpack/converter/FPConvertException.java trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java trunk/flatpack/src/main/java/net/sf/flatpack/util/ExcelTransformer.java trunk/flatpack/src/main/java/net/sf/flatpack/util/FPException.java trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java trunk/flatpack/src/main/java/net/sf/flatpack/writer/AbstractWriter.java trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriter.java trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriterFactory.java trunk/flatpack/src/main/java/net/sf/flatpack/writer/FixedLengthWriter.java trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java trunk/flatpack/src/main/java/net/sf/flatpack/xml/XMLRecordElement.java trunk/src/site/changes.xml Modified: trunk/flatpack/pom.xml =================================================================== --- trunk/flatpack/pom.xml 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/pom.xml 2010-03-23 21:33:47 UTC (rev 418) @@ -93,7 +93,7 @@ <exclude>**/Abstract*.java</exclude> </excludes> <includes> - <include>**/*Test?.java</include> + <include>**/*Test.java</include> </includes> </configuration> </plugin> Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java 2010-03-23 21:33:47 UTC (rev 418) @@ -51,14 +51,11 @@ */ public abstract class AbstractDelimiterParser extends AbstractParser { private char delimiter = 0; - private char qualifier = 0; - private boolean ignoreFirstRecord = false; - private int lineCount = 0; - private final Logger logger = LoggerFactory.getLogger(AbstractDelimiterParser.class); + private final static Logger LOGGER = LoggerFactory.getLogger(AbstractDelimiterParser.class); public AbstractDelimiterParser(final Reader dataSourceReader, final String dataDefinition, final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { @@ -80,7 +77,7 @@ lineCount = 0; return doDelimitedFile(getDataSourceReader(), shouldCreateMDFromFile()); } catch (final IOException e) { - logger.error("error accessing/creating inputstream", e); + LOGGER.error("error accessing/creating inputstream", e); } return null; } @@ -124,7 +121,7 @@ */ private DataSet doDelimitedFile(final Reader dataSource, final boolean createMDFromFile) throws IOException { if (dataSource == null) { - throw new NullPointerException("dataSource is null"); + throw new IllegalArgumentException("dataSource is null"); } BufferedReader br = null; final DefaultDataSet ds = new DefaultDataSet(getPzMetaData(), this); Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java 2010-03-23 21:33:47 UTC (rev 418) @@ -51,7 +51,7 @@ * */ public abstract class AbstractFixedLengthParser extends AbstractParser { - private final Logger logger = LoggerFactory.getLogger(AbstractFixedLengthParser.class); + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractFixedLengthParser.class); protected AbstractFixedLengthParser(final Reader dataSourceReader, final String dataDefinition) { super(dataSourceReader, dataDefinition); @@ -65,7 +65,7 @@ try { return doFixedLengthFile(getDataSourceReader()); } catch (final IOException e) { - logger.error("error accessing/reading data", e); + LOGGER.error("error accessing/reading data", e); } return null; } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java 2010-03-23 21:33:47 UTC (rev 418) @@ -71,17 +71,16 @@ private List readersToClose = null; private boolean flagEmptyRows; - + private boolean storeRawDataToDataError; - + private boolean storeRawDataToDataSet; protected AbstractParser(final Reader dataSourceReader) { this.dataSourceReader = dataSourceReader; } - protected AbstractParser(final Reader dataSourceReader, - final String dataDefinition) { + protected AbstractParser(final Reader dataSourceReader, final String dataDefinition) { this.dataSourceReader = dataSourceReader; this.dataDefinition = dataDefinition; } @@ -123,9 +122,9 @@ protected abstract void init(); - /** - * @deprecated - */ + // /** + // * @deprecated + // */ // protected void setColumnMD(final Map map) { // columnMD = map; // } @@ -156,12 +155,10 @@ protected void addToMetaData(final List columns) { if (pzMetaData == null) { - pzMetaData = new MetaData(columns, ParserUtils.buidColumnIndexMap( - columns, this)); + pzMetaData = new MetaData(columns, ParserUtils.buidColumnIndexMap(columns, this)); } else { pzMetaData.setColumnsNames(columns); - pzMetaData.setColumnIndexMap(ParserUtils.buidColumnIndexMap( - columns, this)); + pzMetaData.setColumnIndexMap(ParserUtils.buidColumnIndexMap(columns, this)); } } @@ -192,11 +189,10 @@ * @param errorLevel * errorLevel 1,2,3 1=warning 2=error 3= severe error */ - protected void addError(final DefaultDataSet ds, final String errorDesc, - final int lineNo, final int errorLevel) { + protected void addError(final DefaultDataSet ds, final String errorDesc, final int lineNo, final int errorLevel) { addError(ds, errorDesc, lineNo, errorLevel, null); } - + /** * Adds a new error to this DataSet. These can be collected, and retrieved * after processing @@ -210,8 +206,7 @@ * @param lineData * Data of the line which failed the parse */ - protected void addError(final DefaultDataSet ds, final String errorDesc, - final int lineNo, final int errorLevel, final String lineData) { + protected void addError(final DefaultDataSet ds, final String errorDesc, final int lineNo, final int errorLevel, final String lineData) { if (errorLevel == 1 && isIgnoreParseWarnings()) { // user has selected to not log warnings in the parser return; @@ -239,8 +234,7 @@ return columnNamesCaseSensitive; } - public void setColumnNamesCaseSensitive( - final boolean columnNamesCaseSensitive) { + public void setColumnNamesCaseSensitive(final boolean columnNamesCaseSensitive) { this.columnNamesCaseSensitive = columnNamesCaseSensitive; } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2010-03-23 21:33:47 UTC (rev 418) @@ -59,6 +59,8 @@ * */ public class DefaultDataSet implements DataSet { + private static final String NEW_LINE = System.getProperty("line.separator"); + private final List rows = new ArrayList(); private final List errors = new ArrayList(); @@ -247,7 +249,7 @@ return Integer.parseInt(s); } - + public long getLong(final String column) { final String s = getStringValue(column); @@ -291,7 +293,7 @@ // return row.getValue(ParserUtils.findColumn(column, // cmds)).toUpperCase(Locale.getDefault()); s = s.toUpperCase(Locale.getDefault()); - }else if (lowerCase) { + } else if (lowerCase) { // convert data to lowercase before returning // return row.getValue(ParserUtils.findColumn(column, // cmds)).toLowerCase(Locale.getDefault()); @@ -367,7 +369,7 @@ // with <RECORD> mappings"); // } if (ob != null && rows != null) { - final List cmds = metaData.getColumnsNames(); + // final List cmds = metaData.getColumnsNames(); // final List cmds = ParserUtils.getColumnMetaData(PZConstants.DETAIL_ID, columnMD); //ob.setColumnMD(cmds); ob.setMetaData(getMetaData()); @@ -495,11 +497,11 @@ public String toString() { final StringBuffer buf = new StringBuffer(); - buf.append("Errors:").append(errors.size()).append(System.getProperty("line.separator")); - buf.append("Rows:").append(rows.size()).append(System.getProperty("line.separator")); - buf.append("Position:").append(pointer).append(System.getProperty("line.separator")); - buf.append("Conversion Props:").append(pzConvertProps).append(System.getProperty("line.separator")); - buf.append("MetaData:").append(metaData).append(System.getProperty("line.separator")); + buf.append("Errors:").append(errors.size()).append(NEW_LINE); + buf.append("Rows:").append(rows.size()).append(NEW_LINE); + buf.append("Position:").append(pointer).append(NEW_LINE); + buf.append("Conversion Props:").append(pzConvertProps).append(NEW_LINE); + buf.append("MetaData:").append(metaData).append(NEW_LINE); return buf.toString(); } @@ -519,7 +521,7 @@ return false; } - + /** * @throws FPInvalidUsageException Parser.isFlagEmptyRows() must be set to true before using this * @throws FPException if cursor is on an invalid row @@ -530,12 +532,12 @@ //throw an exception throw new FPInvalidUsageException("Parser.isFlagEmptyRows(true) must be set before using isRowEmpty()"); } - + if (pointer < 0) { throw new FPException("Cursor on invalid row.. Make sure next() is called and returns true"); } - - return ((Row)rows.get(pointer)).isEmpty(); + + return ((Row) rows.get(pointer)).isEmpty(); } /** @@ -548,11 +550,11 @@ //throw an exception throw new FPInvalidUsageException("Parser.isStoreRawDataToDataSet(true) must be set before using getRawData()"); } - + if (pointer < 0) { throw new FPException("Cursor on invalid row.. Make sure next() is called and returns true"); } - - return ((Row)rows.get(pointer)).getRawData(); + + return ((Row) rows.get(pointer)).getRawData(); } } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/InitialisationException.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/InitialisationException.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/InitialisationException.java 2010-03-23 21:33:47 UTC (rev 418) @@ -43,6 +43,7 @@ * */ public InitialisationException() { + super(); } /** Modified: trunk/flatpack/src/main/java/net/sf/flatpack/Version.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/Version.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/Version.java 2010-03-23 21:33:47 UTC (rev 418) @@ -18,6 +18,7 @@ * * Static class which stores the version of this FlatPack */ -public class Version { - public static final String VERSION = "3.2.0"; +public final class Version { + public static final String VERSION = "3.3.0"; + private Version() {} } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java 2010-03-23 21:33:47 UTC (rev 418) @@ -54,7 +54,7 @@ private boolean processedFirst = false; - private final Logger logger = LoggerFactory.getLogger(BuffReaderDelimParser.class); + private static final Logger LOGGER = LoggerFactory.getLogger(BuffReaderDelimParser.class); public BuffReaderDelimParser(final File pzmapXML, final File dataSource, final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { @@ -95,7 +95,7 @@ return ds; } catch (final IOException ex) { - logger.error("error accessing/creating inputstream", ex); + LOGGER.error("error accessing/creating inputstream", ex); } return null; @@ -211,7 +211,7 @@ try { close(); } catch (final IOException ex) { - logger.warn("Problem trying to auto close file handles...", ex); + LOGGER.warn("Problem trying to auto close file handles...", ex); } finally { super.finalize(); } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java 2010-03-23 21:33:47 UTC (rev 418) @@ -58,7 +58,7 @@ private Map recordLengths = null; - private final Logger logger = LoggerFactory.getLogger(BuffReaderFixedParser.class); + private static final Logger LOGGER = LoggerFactory.getLogger(BuffReaderFixedParser.class); public BuffReaderFixedParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream) { super(pzmapXMLStream, dataSourceStream); @@ -85,7 +85,7 @@ return ds; } catch (final IOException ex) { - logger.error("error accessing/creating inputstream", ex); + LOGGER.error("error accessing/creating inputstream", ex); } return null; @@ -181,7 +181,7 @@ try { close(); } catch (final IOException ex) { - logger.warn("Problem trying to auto close file handles...", ex); + LOGGER.warn("Problem trying to auto close file handles...", ex); } finally { super.finalize(); } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/converter/ConvertInteger.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/converter/ConvertInteger.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/converter/ConvertInteger.java 2010-03-23 21:33:47 UTC (rev 418) @@ -50,7 +50,7 @@ * @see net.sf.flatpack.converter#convertValue(java.lang.String) */ public Object convertValue(final String valueToConvert) { - return new Integer(ParserUtils.stripNonLongChars(valueToConvert)); + return Integer.valueOf(ParserUtils.stripNonLongChars(valueToConvert)); } } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/converter/FPConvertException.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/converter/FPConvertException.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/converter/FPConvertException.java 2010-03-23 21:33:47 UTC (rev 418) @@ -41,10 +41,8 @@ public class FPConvertException extends RuntimeException { private static final long serialVersionUID = 1L; - /** - * - */ public FPConvertException() { + super(); } /** Modified: trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java 2010-03-23 21:33:47 UTC (rev 418) @@ -62,9 +62,9 @@ /** collection of order elements to sort by */ private final List orderbys = new ArrayList(); - + private MetaData metaData; - + private Parser parser; /** @@ -88,7 +88,6 @@ final Row row0 = (Row) arg0; final Row row1 = (Row) arg1; int result = 0; - for (int i = 0; i < orderbys.size(); i++) { final OrderColumn oc = (OrderColumn) orderbys.get(i); @@ -113,29 +112,30 @@ String str0 = row0.getValue(ParserUtils.getColumnIndex(row0.getMdkey(), metaData, oc.getColumnName(), parser)).toLowerCase(Locale.getDefault()); String str1 = row1.getValue(ParserUtils.getColumnIndex(row1.getMdkey(), metaData, oc.getColumnName(), parser)).toLowerCase(Locale.getDefault()); switch (oc.getSelectedColType()) { - case OrderColumn.COLTYPE_STRING: - comp0 = str0; - comp1 = str1; - break; - case OrderColumn.COLTYPE_NUMERIC: - comp0 = Double.valueOf(ParserUtils.stripNonDoubleChars(str0)); - comp1 = Double.valueOf(ParserUtils.stripNonDoubleChars(str1)); - break; - case OrderColumn.COLTYPE_DATE: - final SimpleDateFormat sdf = new SimpleDateFormat(oc.getDateFormatPattern()); - try { - comp0 = sdf.parse(str0); - } catch(ParseException e) { - comp0 = getBadDateDefault(); - - } - - try { - comp1 = sdf.parse(str1); - } catch(ParseException e) { - comp1 = getBadDateDefault(); - } - break; + case OrderColumn.COLTYPE_STRING: + default: + comp0 = str0; + comp1 = str1; + break; + case OrderColumn.COLTYPE_NUMERIC: + comp0 = Double.valueOf(ParserUtils.stripNonDoubleChars(str0)); + comp1 = Double.valueOf(ParserUtils.stripNonDoubleChars(str1)); + break; + case OrderColumn.COLTYPE_DATE: + final SimpleDateFormat sdf = new SimpleDateFormat(oc.getDateFormatPattern()); + try { + comp0 = sdf.parse(str0); + } catch (ParseException e) { + comp0 = getBadDateDefault(); + + } + + try { + comp1 = sdf.parse(str1); + } catch (ParseException e) { + comp1 = getBadDateDefault(); + } + break; } // multiply by the sort indicator to get a ASC or DESC result @@ -158,8 +158,6 @@ defaultBadDt.set(Calendar.DAY_OF_MONTH, 1); return defaultBadDt.getTime(); } - - /** * @param metaData the metaData to set @@ -168,7 +166,6 @@ this.metaData = metaData; } - /** * @param parser the parser to set */ Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/ExcelTransformer.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/ExcelTransformer.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/ExcelTransformer.java 2010-03-23 21:33:47 UTC (rev 418) @@ -38,13 +38,9 @@ * @author Paul Zepernick */ public class ExcelTransformer { - - private DataSet ds; - - private File xlsFile; - + private final DataSet ds; + private final File xlsFile; private String[] exportOnlyColumns; - private String[] excludeFromExportColumns; /** @@ -148,7 +144,11 @@ * @param excludeFromExportColumns the excludeFromExportColumns to set */ public void setExcludeFromExportColumns(final String[] excludeFromExportColumns) { - this.excludeFromExportColumns = excludeFromExportColumns; + if (excludeFromExportColumns != null) { + this.excludeFromExportColumns = (String[]) excludeFromExportColumns.clone(); + } else { + this.excludeFromExportColumns = null; + } } /** @@ -158,7 +158,10 @@ * @param exportOnlyColumns the exportOnlyColumns to set */ public void setExportOnlyColumns(final String[] exportOnlyColumns) { - this.exportOnlyColumns = exportOnlyColumns; + if (exportOnlyColumns != null) { + this.exportOnlyColumns = (String[]) exportOnlyColumns.clone(); + } else { + this.exportOnlyColumns = null; + } } - } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/FPException.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/FPException.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/FPException.java 2010-03-23 21:33:47 UTC (rev 418) @@ -6,8 +6,30 @@ * @author Paul Zepernick */ public class FPException extends RuntimeException{ - - public FPException(final String msg) { - super(msg); + private static final long serialVersionUID = -4269317129024968528L; + + public FPException() { } + + /** + * @param message + */ + public FPException(String message) { + super(message); + } + + /** + * @param cause + */ + public FPException(Throwable cause) { + super(cause); + } + + /** + * @param message + * @param cause + */ + public FPException(String message, Throwable cause) { + super(message, cause); + } } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java 2010-03-23 21:33:47 UTC (rev 418) @@ -35,7 +35,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Map.Entry; import net.sf.flatpack.structure.ColumnMetaData; @@ -75,53 +74,53 @@ return splitResult; } - /** - * Returns the key to the list of ColumnMetaData objects. Returns the - * correct MetaData per the mapping file and the data contained on the line - * - * - * @param columnMD - * @param line - * @return List - ColumMetaData - * @deprecated use the PZMetaData - */ - public static String getCMDKey(final Map columnMD, final String line) { - if (columnMD.size() == 1) { - // no <RECORD> elements were specified for this parse, just return the - // detail id - return FPConstants.DETAIL_ID; - } - final Iterator mapEntries = columnMD.entrySet().iterator(); - // loop through the XMLRecordElement objects and see if we need a - // different MD object - while (mapEntries.hasNext()) { - final Entry entry = (Entry) mapEntries.next(); - if (entry.getKey().equals(FPConstants.DETAIL_ID) || entry.getKey().equals(FPConstants.COL_IDX)) { - continue; // skip this key will be assumed if none of the - // others match - } - final XMLRecordElement recordXMLElement = (XMLRecordElement) entry.getValue(); +// /** +// * Returns the key to the list of ColumnMetaData objects. Returns the +// * correct MetaData per the mapping file and the data contained on the line +// * +// * +// * @param columnMD +// * @param line +// * @return List - ColumMetaData +// * @deprecated use the PZMetaData +// */ +// public static String getCMDKey(final Map columnMD, final String line) { +// if (columnMD.size() == 1) { +// // no <RECORD> elements were specified for this parse, just return the +// // detail id +// return FPConstants.DETAIL_ID; +// } +// final Iterator mapEntries = columnMD.entrySet().iterator(); +// // loop through the XMLRecordElement objects and see if we need a +// // different MD object +// while (mapEntries.hasNext()) { +// final Entry entry = (Entry) mapEntries.next(); +// if (entry.getKey().equals(FPConstants.DETAIL_ID) || entry.getKey().equals(FPConstants.COL_IDX)) { +// continue; // skip this key will be assumed if none of the +// // others match +// } +// final XMLRecordElement recordXMLElement = (XMLRecordElement) entry.getValue(); +// +// if (recordXMLElement.getEndPositition() > line.length()) { +// // make sure our substring is not going to fail +// continue; +// } +// final int subfrm = recordXMLElement.getStartPosition() - 1; // convert +// // to 0 +// // based +// final int subto = recordXMLElement.getEndPositition(); +// if (line.substring(subfrm, subto).equals(recordXMLElement.getIndicator())) { +// // we found the MD object we want to return +// return (String) entry.getKey(); +// } +// +// } +// +// // must be a detail line +// return FPConstants.DETAIL_ID; +// +// } - if (recordXMLElement.getEndPositition() > line.length()) { - // make sure our substring is not going to fail - continue; - } - final int subfrm = recordXMLElement.getStartPosition() - 1; // convert - // to 0 - // based - final int subto = recordXMLElement.getEndPositition(); - if (line.substring(subfrm, subto).equals(recordXMLElement.getIndicator())) { - // we found the MD object we want to return - return (String) entry.getKey(); - } - - } - - // must be a detail line - return FPConstants.DETAIL_ID; - - } - /** * Returns the key to the list of ColumnMetaData objects. Returns the * correct MetaData per the mapping file and the data contained on the line Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java 2010-03-23 21:33:47 UTC (rev 418) @@ -49,7 +49,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Map; @@ -59,8 +58,8 @@ import java.util.Map.Entry; import net.sf.flatpack.Parser; -import net.sf.flatpack.converter.FPConvertException; import net.sf.flatpack.converter.Converter; +import net.sf.flatpack.converter.FPConvertException; import net.sf.flatpack.structure.ColumnMetaData; import net.sf.flatpack.xml.MetaData; import net.sf.flatpack.xml.XMLRecordElement; @@ -131,7 +130,7 @@ int endBlock = 0; boolean blockWasInQualifier = false; - final String doubleQualifier = String.valueOf(qualifier) + String.valueOf(qualifier); + final String doubleQualifier = "" + qualifier + qualifier; for (int i = 0; i < size; i++) { final char currentChar = trimmedLine.charAt(i); @@ -267,7 +266,6 @@ return trimmed; } - /** * Removes empty space from the beginning of a string, except for tabs @@ -294,7 +292,7 @@ return trimmed; } - + /** * Removes empty space from the end of a string * @@ -314,7 +312,7 @@ } if (offset < value.length() - 1) { - trimmed = value.substring(0,offset + 1); + trimmed = value.substring(0, offset + 1); } return trimmed; @@ -360,53 +358,53 @@ return s.toString(); } - /** - * Returns a list of ColumnMetaData objects. This is for use with delimited - * files. The first line of the file which contains data will be used as the - * column names - * - * @param line - * @param delimiter - * @param qualifier - * @exception Exception - * @return ArrayList - ColumnMetaData - * @deprecated Use getColumnMDFromFile(String, char, char, PZParser) - */ - public static Map getColumnMDFromFile(final String line, final char delimiter, final char qualifier) { - return getColumnMDFromFile(line, delimiter, qualifier, null); - } + // /** + // * Returns a list of ColumnMetaData objects. This is for use with delimited + // * files. The first line of the file which contains data will be used as the + // * column names + // * + // * @param line + // * @param delimiter + // * @param qualifier + // * @exception Exception + // * @return ArrayList - ColumnMetaData + // * @deprecated Use getColumnMDFromFile(String, char, char, PZParser) + // */ + // public static Map getColumnMDFromFile(final String line, final char delimiter, final char qualifier) { + // return getColumnMDFromFile(line, delimiter, qualifier, null); + // } - /** - * Returns a list of ColumnMetaData objects. This is for use with delimited - * files. The first line of the file which contains data will be used as the - * column names - * - * @param line - * @param delimiter - * @param qualifier - * @param p - * PZParser used to specify additional option when working with the ColumnMetaData. Can be null - * @return ArrayList - ColumnMetaData - * @deprecated use the getPZMetaDataFromFile - */ - public static Map getColumnMDFromFile(final String line, final char delimiter, final char qualifier, final Parser p) { - List lineData = null; - final List results = new ArrayList(); - final Map columnMD = new LinkedHashMap(); + // /** + // * Returns a list of ColumnMetaData objects. This is for use with delimited + // * files. The first line of the file which contains data will be used as the + // * column names + // * + // * @param line + // * @param delimiter + // * @param qualifier + // * @param p + // * PZParser used to specify additional option when working with the ColumnMetaData. Can be null + // * @return ArrayList - ColumnMetaData + // * @deprecated use the getPZMetaDataFromFile + // */ + // public static Map getColumnMDFromFile(final String line, final char delimiter, final char qualifier, final Parser p) { + // List lineData = null; + // final List results = new ArrayList(); + // final Map columnMD = new LinkedHashMap(); + // + // lineData = splitLine(line, delimiter, qualifier, FPConstants.SPLITLINE_SIZE_INIT); + // for (int i = 0; i < lineData.size(); i++) { + // final ColumnMetaData cmd = new ColumnMetaData(); + // cmd.setColName((String) lineData.get(i)); + // results.add(cmd); + // } + // + // columnMD.put(FPConstants.DETAIL_ID, results); + // columnMD.put(FPConstants.COL_IDX, buidColumnIndexMap(results, p)); + // + // return columnMD; + // } - lineData = splitLine(line, delimiter, qualifier, FPConstants.SPLITLINE_SIZE_INIT); - for (int i = 0; i < lineData.size(); i++) { - final ColumnMetaData cmd = new ColumnMetaData(); - cmd.setColName((String) lineData.get(i)); - results.add(cmd); - } - - columnMD.put(FPConstants.DETAIL_ID, results); - columnMD.put(FPConstants.COL_IDX, buidColumnIndexMap(results, p)); - - return columnMD; - } - /** * Returns a list of ColumnMetaData objects. This is for use with delimited * files. The first line of the file which contains data will be used as the @@ -429,7 +427,7 @@ final ColumnMetaData cmd = new ColumnMetaData(); cmd.setColName((String) lineData.get(i)); if (dupCheck.contains(cmd.getColName())) { - throw new FPException("Duplicate Column Name In File: " + cmd.getColName()); + throw new FPException("Duplicate Column Name In File: " + cmd.getColName()); } results.add(cmd); dupCheck.add(cmd.getColName()); @@ -488,25 +486,25 @@ return results; } - /** - * @param columnName - * @param columnMD - - * vector of ColumnMetaData objects - * @return int - position of the column in the file - * @throws NoSuchElementException - * @deprecated surely not... - */ - public static int findColumn(final String columnName, final List columnMD) { - for (int i = 0; i < columnMD.size(); i++) { - final ColumnMetaData cmd = (ColumnMetaData) columnMD.get(i); - if (cmd.getColName().equalsIgnoreCase(columnName)) { - return i; - } - } + // /** + // * @param columnName + // * @param columnMD - + // * vector of ColumnMetaData objects + // * @return int - position of the column in the file + // * @throws NoSuchElementException + // * @deprecated surely not... + // */ + // public static int findColumn(final String columnName, final List columnMD) { + // for (int i = 0; i < columnMD.size(); i++) { + // final ColumnMetaData cmd = (ColumnMetaData) columnMD.get(i); + // if (cmd.getColName().equalsIgnoreCase(columnName)) { + // return i; + // } + // } + // + // throw new NoSuchElementException("Column Name: " + columnName + " does not exist"); + // } - throw new NoSuchElementException("Column Name: " + columnName + " does not exist"); - } - /** * Determines if the given line is the first part of a multiline record * @@ -583,40 +581,40 @@ return false; } - /** - * Returns a map with the MD id's and their record lengths. This is used for - * fixed length parsing - * - * @param columnMD - * @return Map - * @deprecated use PZMetaData - */ - public static Map calculateRecordLengths(final Map columnMD) { - final Map recordLengths = new HashMap(); - List cmds = null; + // /** + // * Returns a map with the MD id's and their record lengths. This is used for + // * fixed length parsing + // * + // * @param columnMD + // * @return Map + // * @deprecated use PZMetaData + // */ + // public static Map calculateRecordLengths(final Map columnMD) { + // final Map recordLengths = new HashMap(); + // List cmds = null; + // + // final Iterator columnMDIt = columnMD.entrySet().iterator(); + // while (columnMDIt.hasNext()) { + // final Entry entry = (Entry) columnMDIt.next(); + // if (entry.getKey().equals(FPConstants.DETAIL_ID) || entry.getKey().equals(FPConstants.COL_IDX)) { + // cmds = (List) columnMD.get(FPConstants.DETAIL_ID); + // } else { + // cmds = ((XMLRecordElement) entry.getValue()).getColumns(); + // } + // + // int recordLength = 0; + // for (int i = 0; i < cmds.size(); i++) { + // recordLength += ((ColumnMetaData) cmds.get(i)).getColLength(); + // } + // + // recordLengths.put(entry.getKey(), new Integer(recordLength)); + // + // } + // + // return recordLengths; + // + // } - final Iterator columnMDIt = columnMD.entrySet().iterator(); - while (columnMDIt.hasNext()) { - final Entry entry = (Entry) columnMDIt.next(); - if (entry.getKey().equals(FPConstants.DETAIL_ID) || entry.getKey().equals(FPConstants.COL_IDX)) { - cmds = (List) columnMD.get(FPConstants.DETAIL_ID); - } else { - cmds = ((XMLRecordElement) entry.getValue()).getColumns(); - } - - int recordLength = 0; - for (int i = 0; i < cmds.size(); i++) { - recordLength += ((ColumnMetaData) cmds.get(i)).getColLength(); - } - - recordLengths.put(entry.getKey(), new Integer(recordLength)); - - } - - return recordLengths; - - } - public static Map calculateRecordLengths(final MetaData columnMD) { final Map recordLengths = new HashMap(); List cmds = null; @@ -627,23 +625,19 @@ recordLength += ((ColumnMetaData) i.next()).getColLength(); } - recordLengths.put(FPConstants.DETAIL_ID, new Integer(recordLength)); + recordLengths.put(FPConstants.DETAIL_ID, Integer.valueOf(recordLength)); final Iterator columnMDIt = columnMD.xmlRecordIterator(); while (columnMDIt.hasNext()) { final Entry entry = (Entry) columnMDIt.next(); - // if (entry.getKey().equals(PZConstants.DETAIL_ID) || entry.getKey().equals(PZConstants.COL_IDX)) { - // cmds = (List) columnMD.get(PZConstants.DETAIL_ID); - // } else { cmds = ((XMLRecordElement) entry.getValue()).getColumns(); - // } recordLength = 0; for (int i = 0; i < cmds.size(); i++) { recordLength += ((ColumnMetaData) cmds.get(i)).getColLength(); } - recordLengths.put(entry.getKey(), new Integer(recordLength)); + recordLengths.put(entry.getKey(), Integer.valueOf(recordLength)); } @@ -651,54 +645,54 @@ } - /** - * Returns the key to the list of ColumnMetaData objects. Returns the - * correct MetaData per the mapping file and the data contained on the line - * - * - * @param columnMD - * @param lineElements - * @return List - ColumMetaData - * @deprecated use the PZMetaData - */ - public static String getCMDKeyForDelimitedFile(final Map columnMD, final List lineElements) { - if (columnMD.size() == 1) { - // no <RECORD> elments were specifed for this parse, just return the - // detail id - return FPConstants.DETAIL_ID; - } - final Iterator mapEntries = columnMD.entrySet().iterator(); - // loop through the XMLRecordElement objects and see if we need a - // different MD object - while (mapEntries.hasNext()) { - final Entry entry = (Entry) mapEntries.next(); - if (entry.getKey().equals(FPConstants.DETAIL_ID) || entry.getKey().equals(FPConstants.COL_IDX)) { - continue; // skip this key will be assumed if none of the - // others match - } - final XMLRecordElement recordXMLElement = (XMLRecordElement) entry.getValue(); + // /** + // * Returns the key to the list of ColumnMetaData objects. Returns the + // * correct MetaData per the mapping file and the data contained on the line + // * + // * + // * @param columnMD + // * @param lineElements + // * @return List - ColumMetaData + // * @deprecated use the PZMetaData + // */ + // public static String getCMDKeyForDelimitedFile(final Map columnMD, final List lineElements) { + // if (columnMD.size() == 1) { + // // no <RECORD> elments were specifed for this parse, just return the + // // detail id + // return FPConstants.DETAIL_ID; + // } + // final Iterator mapEntries = columnMD.entrySet().iterator(); + // // loop through the XMLRecordElement objects and see if we need a + // // different MD object + // while (mapEntries.hasNext()) { + // final Entry entry = (Entry) mapEntries.next(); + // if (entry.getKey().equals(FPConstants.DETAIL_ID) || entry.getKey().equals(FPConstants.COL_IDX)) { + // continue; // skip this key will be assumed if none of the + // // others match + // } + // final XMLRecordElement recordXMLElement = (XMLRecordElement) entry.getValue(); + // + // if (recordXMLElement.getElementCount() > 0 && recordXMLElement.getElementCount() == lineElements.size()) { + // //determing which <record> mapping to use by the number of elements + // //contained on the line + // return (String) entry.getKey(); + // } else if (recordXMLElement.getElementNumber() > lineElements.size()) { + // // make sure the element referenced in the mapping exists + // continue; + // } + // + // final String lineElement = (String) lineElements.get(recordXMLElement.getElementNumber() - 1); + // if (lineElement.equals(recordXMLElement.getIndicator())) { + // // we found the MD object we want to return + // return (String) entry.getKey(); + // } + // + // } + // + // // must be a detail line + // return FPConstants.DETAIL_ID; + // } - if (recordXMLElement.getElementCount() > 0 && recordXMLElement.getElementCount() == lineElements.size()) { - //determing which <record> mapping to use by the number of elements - //contained on the line - return (String) entry.getKey(); - } else if (recordXMLElement.getElementNumber() > lineElements.size()) { - // make sure the element referenced in the mapping exists - continue; - } - - final String lineElement = (String) lineElements.get(recordXMLElement.getElementNumber() - 1); - if (lineElement.equals(recordXMLElement.getIndicator())) { - // we found the MD object we want to return - return (String) entry.getKey(); - } - - } - - // must be a detail line - return FPConstants.DETAIL_ID; - } - public static String getCMDKeyForDelimitedFile(final MetaData columnMD, final List lineElements) { if (!columnMD.isAnyRecordFormatSpecified()) { // no <RECORD> elments were specifed for this parse, just return the @@ -737,22 +731,22 @@ return FPConstants.DETAIL_ID; } - /** - * Returns a list of ColumMetaData objects for the given key - * - * @param key - * @param columnMD - * @return List - * @deprecated use the PZMetaData - */ - public static List getColumnMetaData(final String key, final Map columnMD) { - if (key == null || key.equals(FPConstants.DETAIL_ID) || key.equals(FPConstants.COL_IDX)) { - return (List) columnMD.get(FPConstants.DETAIL_ID); - } + // /** + // * Returns a list of ColumMetaData objects for the given key + // * + // * @param key + // * @param columnMD + // * @return List + // * @deprecated use the PZMetaData + // */ + // public static List getColumnMetaData(final String key, final Map columnMD) { + // if (key == null || key.equals(FPConstants.DETAIL_ID) || key.equals(FPConstants.COL_IDX)) { + // return (List) columnMD.get(FPConstants.DETAIL_ID); + // } + // + // return ((XMLRecordElement) columnMD.get(key)).getColumns(); + // } - return ((XMLRecordElement) columnMD.get(key)).getColumns(); - } - public static List getColumnMetaData(final String key, final MetaData columnMD) { if (key == null || key.equals(FPConstants.DETAIL_ID) || key.equals(FPConstants.COL_IDX)) { return columnMD.getColumnsNames(); @@ -761,41 +755,41 @@ return columnMD.getListColumnsForRecord(key); } - /** - * Use this method to find the index of a column. - * - * @author Benoit Xhenseval - * @author Paul Zepernick - * @param key - * @param columnMD - * @param colName - * @param p - * Can be null. Used to specify potential options on how the column should be retrieved - * @return -1 if it does not find it - * @deprecated use PZMetaData - */ - public static int getColumnIndex(final String key, final Map columnMD, final String colName, final Parser p) { - int idx = -1; - String column = colName; - if (p != null && !p.isColumnNamesCaseSensitive()) { - column = colName.toLowerCase(Locale.getDefault()); - } - if (key != null && !key.equals(FPConstants.DETAIL_ID) && !key.equals(FPConstants.COL_IDX)) { - idx = ((XMLRecordElement) columnMD.get(key)).getColumnIndex(column); - } else if (key == null || key.equals(FPConstants.DETAIL_ID)) { - final Map map = (Map) columnMD.get(FPConstants.COL_IDX); - final Integer i = (Integer) map.get(column); - if (i != null) { //happens when the col name does not exist in the mapping - idx = i.intValue(); - } - } + // /** + // * Use this method to find the index of a column. + // * + // * @author Benoit Xhenseval + // * @author Paul Zepernick + // * @param key + // * @param columnMD + // * @param colName + // * @param p + // * Can be null. Used to specify potential options on how the column should be retrieved + // * @return -1 if it does not find it + // * @deprecated use PZMetaData + // */ + // public static int getColumnIndex(final String key, final Map columnMD, final String colName, final Parser p) { + // int idx = -1; + // String column = colName; + // if (p != null && !p.isColumnNamesCaseSensitive()) { + // column = colName.toLowerCase(Locale.getDefault()); + // } + // if (key != null && !key.equals(FPConstants.DETAIL_ID) && !key.equals(FPConstants.COL_IDX)) { + // idx = ((XMLRecordElement) columnMD.get(key)).getColumnIndex(column); + // } else if (key == null || key.equals(FPConstants.DETAIL_ID)) { + // final Map map = (Map) columnMD.get(FPConstants.COL_IDX); + // final Integer i = (Integer) map.get(column); + // if (i != null) { //happens when the col name does not exist in the mapping + // idx = i.intValue(); + // } + // } + // + // if (idx < 0) { + // throw new NoSuchElementException("Column " + colName + " does not exist, check case/spelling. key:" + key); + // } + // return idx; + // } - if (idx < 0) { - throw new NoSuchElementException("Column " + colName + " does not exist, check case/spelling. key:" + key); - } - return idx; - } - public static int getColumnIndex(final String key, final MetaData columnMD, final String colName, final Parser p) { int idx = -1; String column = colName; @@ -830,9 +824,9 @@ * @return -1 if it does not find it * @deprecated use getColumnIndex(String, Map, String, PZParser) */ - public static int getColumnIndex(final String key, final Map columnMD, final String colName) { - return getColumnIndex(key, columnMD, colName, null); - } + // public static int getColumnIndex(final String key, final Map columnMD, final String colName) { + // return getColumnIndex(key, columnMD, colName, null); + // } /** * Create an InputStream based on a File. @@ -861,7 +855,7 @@ reader.close(); } } catch (final IOException ex) { - throw new RuntimeException(ex); + throw new FPException(ex); } } @@ -877,7 +871,7 @@ reader.close(); } } catch (final IOException ex) { - throw new RuntimeException(ex); + throw new FPException(ex); } } @@ -944,7 +938,7 @@ //on lookups colName = colName.toLowerCase(Locale.getDefault()); } - map.put(colName, new Integer(idx)); + map.put(colName, Integer.valueOf(idx)); } } return map; @@ -958,9 +952,9 @@ * @return a new Map * @deprecated Please use buildColumnIndexMap(List, PZParser) */ - public static Map buidColumnIndexMap(final List columns) { - return buidColumnIndexMap(columns, null); - } + // public static Map buidColumnIndexMap(final List columns) { + // return buidColumnIndexMap(columns, null); + // } /** * Removes chars from the String that could not @@ -990,7 +984,7 @@ // just a minus sign final int sLen = newString.length(); final String s = newString.toString(); - if (sLen == 0 || (sLen == 1 && s.equals("-"))) { + if (sLen == 0 || (sLen == 1 && "-".equals(s))) { return "0"; } @@ -1015,7 +1009,7 @@ } final int sLen = newString.length(); final String s = newString.toString(); - if (sLen == 0 || (sLen == 1 && s.equals(".")) || (sLen == 1 && s.equals("-"))) { + if (sLen == 0 || (sLen == 1 && (".".equals(s) || "-".equals(s)))) { return "0"; } @@ -1037,7 +1031,7 @@ return pzConvertProps; } - + /** * Checks a list of <String> elements to see if every element * in the list is empty. @@ -1050,11 +1044,11 @@ public static boolean isListElementsEmpty(final List l) { final Iterator it = l.iterator(); while (it.hasNext()) { - final String s = (String)it.next(); + final String s = (String) it.next(); if (s != null && s.trim().length() > 0) { return false; } - } + } return true; } @@ -1105,9 +1099,8 @@ ResultSet rs = null; final List cmds = new ArrayList(); try { - final String sql = - "SELECT * FROM DATAFILE INNER JOIN DATASTRUCTURE ON " + "DATAFILE.DATAFILE_NO = DATASTRUCTURE.DATAFILE_NO " - + "WHERE DATAFILE.DATAFILE_DESC = ? " + "ORDER BY DATASTRUCTURE_COL_ORDER"; + final String sql = "SELECT * FROM DATAFILE INNER JOIN DATASTRUCTURE ON " + "DATAFILE.DATAFILE_NO = DATASTRUCTURE.DATAFILE_NO " + + "WHERE DATAFILE.DATAFILE_DESC = ? " + "ORDER BY DATASTRUCTURE_COL_ORDER"; stmt = con.prepareStatement(sql); // always use PreparedStatement // as the DB can do clever things. Modified: trunk/flatpack/src/main/java/net/sf/flatpack/writer/AbstractWriter.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/writer/AbstractWriter.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/writer/AbstractWriter.java 2010-03-23 21:33:47 UTC (rev 418) @@ -10,7 +10,7 @@ * @author Dirk Holmes and Holger Holger Hoffstatte */ public abstract class AbstractWriter extends Object implements Writer { - private BufferedWriter writer; + private final BufferedWriter writer; private Map rowMap; public AbstractWriter(final java.io.Writer output) { @@ -53,7 +53,8 @@ writer.newLine(); } - protected void write(Object value) throws IOException { + protected void write(final Object val) throws IOException { + Object value = val; if (value == null) { value = ""; } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriter.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriter.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriter.java 2010-03-23 21:33:47 UTC (rev 418) @@ -93,7 +93,7 @@ } } - public void nextRecord() throws IOException { + public final void nextRecord() throws IOException { if (!columnTitlesWritten) { this.writeColumnTitles(); columnTitlesWritten = true; Modified: trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriterFactory.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriterFactory.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/writer/DelimiterWriterFactory.java 2010-03-23 21:33:47 UTC (rev 418) @@ -77,7 +77,7 @@ metaData.setColName(columnTitle); columnMetaDatas.add(metaData); - final Integer columnIndex = new Integer(columnMetaDatas.indexOf(metaData)); + final Integer columnIndex = Integer.valueOf(columnMetaDatas.indexOf(metaData)); columnIndices.put(columnIndex, columnTitle); } } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/writer/FixedLengthWriter.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/writer/FixedLengthWriter.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/writer/FixedLengthWriter.java 2010-03-23 21:33:47 UTC (rev 418) @@ -48,7 +48,8 @@ super.nextRecord(); } - protected char[] formattedValue(Object value, final ColumnMetaData element) { + protected char[] formattedValue(final Object val, final ColumnMetaData element) { + Object value = val; if (value == null) { // TODO DO: maybe have a way to substitute default values here? value = ""; Modified: trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java 2010-03-23 21:33:47 UTC (rev 418) @@ -177,7 +177,7 @@ } if (showDebug) { - showDebug(mdIndex); + setShowDebug(mdIndex); } return mdIndex; @@ -226,7 +226,7 @@ cmd.setColLength(Integer.parseInt(xmlColumn.getAttributeValue("length"))); } catch (final Exception ex) { throw new IllegalArgumentException("LENGTH ATTRIBUTE ON COLUMN ELEMENT MUST BE AN INTEGER. GOT: " - + xmlColumn.getAttributeValue("length")); + + xmlColumn.getAttributeValue("length"), ex); } } columnResults.add(cmd); @@ -245,7 +245,7 @@ showDebug = b; } - private static void showDebug(final Map xmlResults) { + private static void setShowDebug(final Map xmlResults) { final Iterator mapIt = xmlResults.entrySet().iterator(); while (mapIt.hasNext()) { XMLRecordElement xmlrecEle = null; Modified: trunk/flatpack/src/main/java/net/sf/flatpack/xml/XMLRecordElement.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/xml/XMLRecordElement.java 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/flatpack/src/main/java/net/sf/flatpack/xml/XMLRecordElement.java 2010-03-23 21:33:47 UTC (rev 418) @@ -102,15 +102,15 @@ return columns; } - /** - * @param columns - * The columns to set. - * @deprecated Please use setColumns(List, PZParser) - */ - public void setColumns(final List columns) { - this.columns = columns; - this.columnIndex = ParserUtils.buidColumnIndexMap(columns, null); - } +// /** +// * @param columns +// * The columns to set. +// * @deprecated Please use setColumns(List, PZParser) +// */ +// public void setColumns(final List columns) { +// this.columns = columns; +// this.columnIndex = ParserUtils.buidColumnIndexMap(columns, null); +// } /** * @param columnsToUse Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2010-03-15 20:30:16 UTC (rev 417) +++ trunk/src/site/changes.xml 2010-03-23 21:33:47 UTC (rev 418) @@ -7,6 +7,9 @@ <title>Changes</title> </properties> <body> + <release version="3.3.0" date="in svn" description="Maintenance"> + <action dev="benoitx" type="fix">Use JDK 1.5.</action> + </release> <release version="3.2.0" date="2010-03-03" description="New parse options"> <action dev="benoitx" type="add">Added a getBigDecimal method on DataSet.</action> <action dev="zepernick" type="fix">Fixed SF Bug 1869636. The parameters for the XML Map and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2010-03-15 20:30:23
|
Revision: 417 http://flatpack.svn.sourceforge.net/flatpack/?rev=417&view=rev Author: benoitx Date: 2010-03-15 20:30:16 +0000 (Mon, 15 Mar 2010) Log Message: ----------- maven 2 build. Added Paths: ----------- trunk/flatpack/pom.xml trunk/flatpack-samples/pom.xml trunk/pom.xml Added: trunk/flatpack/pom.xml =================================================================== --- trunk/flatpack/pom.xml (rev 0) +++ trunk/flatpack/pom.xml 2010-03-15 20:30:16 UTC (rev 417) @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>net.sf.flatpack</groupId> + <artifactId>flatpack-parent</artifactId> + <version>3.3.0-SNAPSHOT</version> + </parent> + + + <artifactId>flatpack</artifactId> + <name>FlatPack</name> + <packaging>bundle</packaging> <!-- (1) OSGi --> + + <description>Simple Java delimited and fixed width file parser. Handles CSV, Excel CSV, Tab, Pipe delimiters, just to name a few. + Maps column positions in the file to user friendly names via XML. See FlatPack Feature List under News for complete feature list.</description> + <!-- + <scm> <connection>scm:svn:https://flatpack.svn.sourceforge.net/svnroot/flatpack/trunk/flatpack</connection> + <developerConnection>scm:svn:https://flatpack.svn.sourceforge.net/svnroot/flatpack/trunk/flatpack</developerConnection> </scm> + --> + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + <resources> + <resource> + <directory>src/main/java</directory> + <includes> + <include>**/*.dtd</include> + <include>**/*.properties</include> + </includes> + </resource> + </resources> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <includes> + <include>**/*.xml</include> + </includes> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Export-Package>net.sf.flatpack.*;version="${pom.version}"</Export-Package> + <Private-Package/> + <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> + <Bundle-Version>${pom.version}</Bundle-Version> + <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment> + </instructions> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <showDeprecation>true</showDeprecation> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <additionalparam>"-breakiterator"</additionalparam> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <argLine>-ea</argLine> + <printSummary>false</printSummary> + <reportFormat>plain</reportFormat> + <testFailureIgnore>true</testFailureIgnore> + <useFile>false</useFile> + <excludes> + <exclude>**/Abstract*.java</exclude> + </excludes> + <includes> + <include>**/*Test?.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>jexcelapi</groupId> + <artifactId>jxl</artifactId> + <version>2.4.2</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.1.0-RC1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>1.1.0-RC1</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + </dependencies> + <reporting> + <plugins> + <plugin> + <artifactId>maven-changes-plugin</artifactId> + <configuration> + <issueLinkTemplate>http://sourceforge.net/support/tracker.php?aid=%ISSUE%</issueLinkTemplate> + <xmlPath>${basedir}/xdocs/changes.xml</xmlPath> + </configuration> + </plugin> + <!-- + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <configLocation>${basedir}/../common-build/objectlab_checks.xml</configLocation> + <headerLocation>${basedir}/../checkstyle-license.txt</headerLocation> + </configuration> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.4</targetJdk> + </configuration> + </plugin> + --> + </plugins> + </reporting> +</project> Added: trunk/flatpack-samples/pom.xml =================================================================== --- trunk/flatpack-samples/pom.xml (rev 0) +++ trunk/flatpack-samples/pom.xml 2010-03-15 20:30:16 UTC (rev 417) @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>net.sf.flatpack</groupId> + <artifactId>flatpack-parent</artifactId> + <version>3.3.0-SNAPSHOT</version> + </parent> + + + <artifactId>flatpack-examples</artifactId> + <name>FlatPack Examples</name> + <packaging>bundle</packaging> <!-- (1) OSGi --> + + <description>Simple Java delimited and fixed width file parser. Handles CSV, Excel CSV, Tab, Pipe delimiters, just to name a few. + Maps column positions in the file to user friendly names via XML. See FlatPack Feature List under News for complete feature list.</description> + <scm> + <connection>scm:svn:https://flatpack.svn.sourceforge.net/svnroot/flatpack/trunk/flatpack-samples</connection> + <developerConnection>scm:svn:https://flatpack.svn.sourceforge.net/svnroot/flatpack/trunk/flatpack-samples</developerConnection> + </scm> + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + <resources> + <resource> + <directory>src/main/java</directory> + <includes> + <include>**/*.txt</include> + <include>**/*.xml</include> + <include>**/*.csv</include> + </includes> + </resource> + <resource> + <directory>${basedir}/../common-build/lib</directory> + <includes> + <include>**/*.jar</include> + </includes> + </resource> + <resource> + <directory>${basedir}/common-build/lib</directory> + <includes> + <include>**/*.jar</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Export-Package>net.sf.flatpack.*;version="${pom.version}"</Export-Package> + <Private-Package/> + <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> + <Bundle-Version>${pom.version}</Bundle-Version> + <Bundle-RequiredExecutionEnvironment>J2SE-1.4</Bundle-RequiredExecutionEnvironment> + </instructions> + </configuration> + </plugin><!-- + + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <showDeprecation>true</showDeprecation> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + --><plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <additionalparam>"-breakiterator"</additionalparam> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <argLine>-ea</argLine> + <printSummary>false</printSummary> + <reportFormat>plain</reportFormat> + <testFailureIgnore>true</testFailureIgnore> + <useFile>false</useFile> + <excludes> + <exclude>**/Abstract*.java</exclude> + </excludes> + <includes> + <include>**/*NOTest.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>net.sf.flatpack</groupId> + <artifactId>flatpack</artifactId> + <version>3.3.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>jexcelapi</groupId> + <artifactId>jxl</artifactId> + <version>2.4.2</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.1.0-RC1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>1.1.0-RC1</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + </dependencies> + <reporting> + <plugins> + <plugin> + <artifactId>maven-changes-plugin</artifactId> + <configuration> + <issueLinkTemplate>http://sourceforge.net/support/tracker.php?aid=%ISSUE%</issueLinkTemplate> + <xmlPath>${basedir}/xdocs/changes.xml</xmlPath> + </configuration> + </plugin> + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <configLocation>${basedir}/../common-build/objectlab_checks.xml</configLocation> + <headerLocation>${basedir}/../checkstyle-license.txt</headerLocation> + </configuration> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.4</targetJdk> + </configuration> + </plugin> + </plugins> + </reporting> +</project> Added: trunk/pom.xml =================================================================== --- trunk/pom.xml (rev 0) +++ trunk/pom.xml 2010-03-15 20:30:16 UTC (rev 417) @@ -0,0 +1,188 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>net.sf.flatpack</groupId> + <artifactId>flatpack-parent</artifactId> + <name>FlatPack</name> + <version>3.3.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <description>Simple Java delimited and fixed width file parser. Handles CSV, Excel CSV, Tab, Pipe delimiters. + Bind delimited or fixed width text to column names via XML mappings. Support for header and trailer records. Optionally, column names can be retrieved from the first record of a delimited file.</description> + + + <modules> + <module>flatpack</module> + <module>flatpack-samples</module> + </modules> + + <inceptionYear>2006</inceptionYear> + <url>http://flatpack.sourceforge.net/</url> + + <organization> + <name>Appendium - Portfolio Financing Platform</name> + <url>http://www.appendium.com/</url> + </organization> + + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + <distribution>repo</distribution> + </license> + </licenses> + + <developers> + <developer> + <name>Paul Zepernick</name> + <id>zepernick</id> + <email>zepernick at users.sourceforge.net</email> + <organization>Paul Zepernick</organization> + <url>http://www.mysite.com</url> + <timezone>0</timezone> + <roles> + <role>Founder</role> + <role>Java Developer</role> + </roles> + </developer> + <developer> + <name>Benoit Xhenseval</name> + <id>benoitx</id> + <email>kit AT objectlab DOT co dOt uk</email> + <organization>ObjectLab Financial Ltd</organization> + <roles> + <role>Developer</role> + </roles> + <url>http://www.xhenseval.com</url> + <timezone>+0</timezone> + </developer> + <developer> + <name>Marcin Jekot</name> + <id>marchy</id> + <email>marcin at jekot DOt net</email> + <organization>ObjectLab Financial Ltd</organization> + <roles> + <role>Subversion mig</role> + </roles> + <timezone>+0</timezone> + </developer> + </developers> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>1.0.0</version> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>code-sign</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <executions> + <execution> + <id>sign-artifacts</id> + <phase>verify</phase> + <goals> + <goal>sign</goal> + </goals> + </execution> + </executions> + <configuration> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <!-- + + + <build> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> </manifest> </archive> + </configuration> </plugin> </plugins> </build> + --> + + <scm> + <connection>scm:svn:https://flatpack.svn.sourceforge.net/svnroot/flatpack/trunk/</connection> + <developerConnection>scm:svn:https://flatpack.svn.sourceforge.net/svnroot/flatpack/trunk/</developerConnection> + <url>http://flatpack.svn.sourceforge.net/viewvc/flatpack/</url> + </scm> + <!-- + + <reporting> <plugins> <plugin> <artifactId>maven-changelog-plugin</artifactId> </plugin> <plugin> <artifactId>maven-changes-plugin</artifactId> <configuration> + <xmlPath>${basedir}/xdocs/changes.xml</xmlPath> </configuration> </plugin> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> + <configLocation>${basedir}/../checkstyle_checks.xml</configLocation> <headerLocation>${basedir}/../checkstyle-license.txt</headerLocation> </configuration> + </plugin> <plugin> <artifactId>maven-dashboard-plugin</artifactId> </plugin> </plugins> </reporting> + --> + + <reporting> + <plugins> + <!-- + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> + <configLocation>/common_build/checkstyle_checks.xml</configLocation> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> + </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> </plugin> <plugin> <artifactId>maven-clover-plugin</artifactId> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-pmd-plugin</artifactId> + <configuration> <targetJdk>1.5</targetJdk> <rulesets> <ruleset>/rulesets/basic.xml</ruleset> <ruleset>/rulesets/controversial.xml</ruleset> </rulesets> + <linkXref>true</linkXref> <minimumTokens>100</minimumTokens> </configuration> </plugin> + --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <code>javadoc:aggregate</code> + <source>1.5</source> + </configuration> + </plugin> + <plugin> + <artifactId>maven-changes-plugin</artifactId> + <configuration> + <issueLinkTemplatePerSystem> + <default>%URL%/?func=detail&group_id=175139&%ISSUE%</default> + </issueLinkTemplatePerSystem> + </configuration> + </plugin> + <plugin> + <artifactId>maven-changelog-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>dashboard-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>net.sf</groupId> + <artifactId>stat-scm</artifactId> + </plugin> + </plugins> + </reporting> + +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2010-03-11 20:11:02
|
Revision: 416 http://flatpack.svn.sourceforge.net/flatpack/?rev=416&view=rev Author: benoitx Date: 2010-03-11 20:10:56 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Release 3.2.0 Added Paths: ----------- tags/3.2.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2010-03-11 19:46:43
|
Revision: 415 http://flatpack.svn.sourceforge.net/flatpack/?rev=415&view=rev Author: benoitx Date: 2010-03-11 19:46:37 +0000 (Thu, 11 Mar 2010) Log Message: ----------- ready for 3.2.0 Property Changed: ---------------- trunk/flatpack/ Property changes on: trunk/flatpack ___________________________________________________________________ Modified: svn:ignore - target ydocErr.log + target ydocErr.log target.m1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2010-03-09 20:17:33
|
Revision: 414 http://flatpack.svn.sourceforge.net/flatpack/?rev=414&view=rev Author: benoitx Date: 2010-03-09 20:17:26 +0000 (Tue, 09 Mar 2010) Log Message: ----------- last few items for release. Modified Paths: -------------- trunk/flatpack/qalab.xml trunk/flatpack/src/site/navigation.xml trunk/flatpack-samples/qalab.xml trunk/flatpack-samples/src/site/navigation.xml trunk/project.properties trunk/src/site/index.xml Modified: trunk/flatpack/qalab.xml =================================================================== --- trunk/flatpack/qalab.xml 2010-03-01 21:02:52 UTC (rev 413) +++ trunk/flatpack/qalab.xml 2010-03-09 20:17:26 UTC (rev 414) @@ -325,6 +325,34 @@ project="default" statvalue="31" type="cobertura-line"/> <summaryresult date="2007-11-06" filecount="45" module="default" project="default" statvalue="23" type="cobertura-branch"/> + <summaryresult date="2010-03-01" filecount="55" module="default" + project="default" statvalue="23" type="checkstyle"/> + <summaryresult date="2010-03-01" filecount="3" module="default" + project="default" statvalue="5" type="findbugs"/> + <summaryresult date="2010-03-01" filecount="6" module="default" + project="default" statvalue="130" type="simian"/> + <summaryresult date="2010-03-01" filecount="47" module="default" + project="default" statvalue="48" type="cobertura-line"/> + <summaryresult date="2010-03-01" filecount="47" module="default" + project="default" statvalue="44" type="cobertura-branch"/> + <summaryresult date="2010-03-01" filecount="2" module="default" + project="default" statvalue="2" type="pmd"/> + <summaryresult date="2010-03-02" filecount="55" module="default" + project="default" statvalue="23" type="checkstyle"/> + <summaryresult date="2010-03-02" filecount="2" module="default" + project="default" statvalue="4" type="findbugs"/> + <summaryresult date="2010-03-02" filecount="6" module="default" + project="default" statvalue="130" type="simian"/> + <summaryresult date="2010-03-02" filecount="2" module="default" + project="default" statvalue="2" type="pmd"/> + <summaryresult date="2010-03-03" filecount="55" module="default" + project="default" statvalue="23" type="checkstyle"/> + <summaryresult date="2010-03-03" filecount="2" module="default" + project="default" statvalue="4" type="findbugs"/> + <summaryresult date="2010-03-03" filecount="6" module="default" + project="default" statvalue="130" type="simian"/> + <summaryresult date="2010-03-03" filecount="2" module="default" + project="default" statvalue="2" type="pmd"/> </summary> <file id="default-default-com_pz_reader_ordering_package.html" module="default" path="com/pz/reader/ordering/package.html" project="default"> @@ -665,6 +693,10 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="43" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_DataSet.java" module="default" path="net/sf/flatpack/DataSet.java" project="default"> @@ -740,6 +772,18 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="1" type="pmd"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="100" type="cobertura-line"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="1" type="pmd"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="100" type="cobertura-line"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="1" type="pmd"/> </file> <file id="default-default-net_sf_flatpack_LargeDataSet.java" module="default" path="net/sf/flatpack/LargeDataSet.java" project="default"> @@ -766,6 +810,14 @@ <result date="2006-11-22" statvalue="2" type="findbugs"/> <result date="2006-12-15" statvalue="1" type="checkstyle"/> <result date="2006-12-15" statvalue="2" type="findbugs"/> + <result date="2010-03-01" statvalue="4" type="checkstyle"/> + <result date="2010-03-01" statvalue="3" type="findbugs"/> + <result date="2010-03-01" statvalue="91" type="cobertura-line"/> + <result date="2010-03-01" statvalue="50" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="4" type="checkstyle"/> + <result date="2010-03-02" statvalue="3" type="findbugs"/> + <result date="2010-03-03" statvalue="4" type="checkstyle"/> + <result date="2010-03-03" statvalue="3" type="findbugs"/> </file> <file id="default-default-net_sf_flatpack_util_ParserUtils.java" module="default" path="net/sf/flatpack/util/ParserUtils.java" project="default"> @@ -852,6 +904,12 @@ <result date="2007-11-06" statvalue="6" type="checkstyle"/> <result date="2007-11-06" statvalue="28" type="cobertura-line"/> <result date="2007-11-06" statvalue="25" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="7" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="findbugs"/> + <result date="2010-03-01" statvalue="47" type="cobertura-line"/> + <result date="2010-03-01" statvalue="52" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="7" type="checkstyle"/> + <result date="2010-03-03" statvalue="7" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_xml_PZMapParser.java" module="default" path="net/sf/flatpack/xml/PZMapParser.java" project="default"> @@ -898,6 +956,8 @@ <result date="2007-09-30" statvalue="50" type="cobertura-branch"/> <result date="2007-11-06" statvalue="71" type="cobertura-line"/> <result date="2007-11-06" statvalue="50" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="71" type="cobertura-line"/> + <result date="2010-03-01" statvalue="50" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_structure_Row.java" module="default" path="net/sf/flatpack/structure/Row.java" project="default"> @@ -932,6 +992,7 @@ <result date="2007-09-29" statvalue="45" type="cobertura-line"/> <result date="2007-09-30" statvalue="45" type="cobertura-line"/> <result date="2007-11-06" statvalue="45" type="cobertura-line"/> + <result date="2010-03-01" statvalue="62" type="cobertura-line"/> </file> <file id="default-default-net_sf_flatpack_structure_ColumnMetaData.java" @@ -983,6 +1044,10 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="54" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="54" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_Version.java" module="default" path="net/sf/flatpack/Version.java" project="default"> @@ -1009,6 +1074,9 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_xml_XMLRecordElement.java" module="default" @@ -1025,6 +1093,7 @@ <result date="2007-09-29" statvalue="54" type="cobertura-line"/> <result date="2007-09-30" statvalue="54" type="cobertura-line"/> <result date="2007-11-06" statvalue="54" type="cobertura-line"/> + <result date="2010-03-01" statvalue="54" type="cobertura-line"/> </file> <file id="default-default-net_sf_flatpack_util_PZConstants.java" module="default" path="net/sf/flatpack/util/PZConstants.java" project="default"> @@ -1149,6 +1218,9 @@ <result date="2007-09-29" statvalue="2" type="checkstyle"/> <result date="2007-09-30" statvalue="2" type="checkstyle"/> <result date="2007-11-06" statvalue="2" type="checkstyle"/> + <result date="2010-03-01" statvalue="2" type="checkstyle"/> + <result date="2010-03-02" statvalue="2" type="checkstyle"/> + <result date="2010-03-03" statvalue="2" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_util_FixedWidthParserUtils.java" @@ -1185,6 +1257,8 @@ <result date="2007-08-21" statvalue="9" type="cobertura-branch"/> <result date="2007-08-30" statvalue="20" type="cobertura-line"/> <result date="2007-08-30" statvalue="9" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="21" type="cobertura-line"/> + <result date="2010-03-01" statvalue="9" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_util_RegExParser.java" module="default" path="net/sf/flatpack/util/RegExParser.java" project="default"> @@ -1278,6 +1352,14 @@ <result date="2007-09-30" statvalue="5" type="cobertura-branch"/> <result date="2007-11-06" statvalue="19" type="cobertura-line"/> <result date="2007-11-06" statvalue="5" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="1" type="findbugs"/> + <result date="2010-03-01" statvalue="40" type="cobertura-line"/> + <result date="2010-03-01" statvalue="29" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="1" type="pmd"/> + <result date="2010-03-02" statvalue="1" type="findbugs"/> + <result date="2010-03-02" statvalue="1" type="pmd"/> + <result date="2010-03-03" statvalue="1" type="findbugs"/> + <result date="2010-03-03" statvalue="1" type="pmd"/> </file> <file id="default-default-net_sf_flatpack_DefaultPZParserFactory.java" @@ -1367,6 +1449,10 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="25" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="25" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_converter_package.html" module="default" path="net/sf/flatpack/converter/package.html" project="default"> @@ -1424,6 +1510,10 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_converter_PZConvertException.java" @@ -1497,6 +1587,10 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_converter_ConvertInteger.java" @@ -1530,6 +1624,10 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_brparse_BuffReaderPZParseFactory.java" @@ -1609,6 +1707,11 @@ <result date="2007-11-06" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="57" type="cobertura-line"/> <result date="2007-11-06" statvalue="39" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="3" type="checkstyle"/> + <result date="2010-03-01" statvalue="66" type="cobertura-line"/> + <result date="2010-03-01" statvalue="52" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="3" type="checkstyle"/> + <result date="2010-03-03" statvalue="3" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_util_FPStringUtils.java" module="default" path="net/sf/flatpack/util/FPStringUtils.java" project="default"> @@ -1630,6 +1733,8 @@ <result date="2007-09-04" statvalue="2" type="checkstyle"/> <result date="2007-09-05" statvalue="1" type="checkstyle"/> <result date="2007-09-09" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="30" type="cobertura-line"/> + <result date="2010-03-01" statvalue="20" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_xml_MetaData.java" module="default" path="net/sf/flatpack/xml/MetaData.java" project="default"> @@ -1659,6 +1764,8 @@ <result date="2007-09-30" statvalue="6" type="cobertura-branch"/> <result date="2007-11-06" statvalue="16" type="cobertura-line"/> <result date="2007-11-06" statvalue="6" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="51" type="cobertura-line"/> + <result date="2010-03-01" statvalue="37" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_AbstractParser.java" module="default" path="net/sf/flatpack/AbstractParser.java" project="default"> @@ -1684,6 +1791,8 @@ <result date="2007-09-30" statvalue="35" type="cobertura-branch"/> <result date="2007-11-06" statvalue="55" type="cobertura-line"/> <result date="2007-11-06" statvalue="35" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="81" type="cobertura-line"/> + <result date="2010-03-01" statvalue="71" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_DefaultParserFactory.java" module="default" @@ -1710,6 +1819,10 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="23" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="29" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_DelimiterParser.java" module="default" path="net/sf/flatpack/DelimiterParser.java" project="default"> @@ -1735,6 +1848,8 @@ <result date="2007-09-30" statvalue="42" type="cobertura-branch"/> <result date="2007-11-06" statvalue="38" type="cobertura-line"/> <result date="2007-11-06" statvalue="42" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="50" type="cobertura-line"/> + <result date="2010-03-01" statvalue="71" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_Parser.java" module="default" path="net/sf/flatpack/Parser.java" project="default"> @@ -1760,6 +1875,12 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-line"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-line"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_ParserFactory.java" module="default" path="net/sf/flatpack/ParserFactory.java" project="default"> @@ -1787,6 +1908,12 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-line"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-line"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_converter_Converter.java" module="default" path="net/sf/flatpack/converter/Converter.java" project="default"> @@ -1812,6 +1939,12 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-line"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-line"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_brparse_BuffReaderParseFactory.java" @@ -1828,6 +1961,10 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="29" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_converter_FPConvertException.java" @@ -1844,6 +1981,9 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_util_FPConstants.java" module="default" path="net/sf/flatpack/util/FPConstants.java" project="default"> @@ -1858,6 +1998,9 @@ <result date="2007-09-29" statvalue="100" type="cobertura-branch"/> <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-C:_project_flatpack_flatpack_src_test_java_net_sf_flatpack_columninfile_DelimitedColumnNamesInFileTest.java" @@ -1892,6 +2035,8 @@ <result date="2007-09-30" statvalue="83" type="cobertura-branch"/> <result date="2007-11-06" statvalue="84" type="cobertura-line"/> <result date="2007-11-06" statvalue="83" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="84" type="cobertura-line"/> + <result date="2010-03-01" statvalue="83" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_AbstractWriterFactory.java" @@ -1910,6 +2055,10 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_DelimiterWriter.java" @@ -1928,6 +2077,8 @@ <result date="2007-09-30" statvalue="90" type="cobertura-branch"/> <result date="2007-11-06" statvalue="89" type="cobertura-line"/> <result date="2007-11-06" statvalue="90" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="88" type="cobertura-line"/> + <result date="2010-03-01" statvalue="90" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_DelimiterWriterFactory.java" @@ -1946,6 +2097,10 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="75" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="75" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_FixedLengthWriter.java" @@ -1964,6 +2119,8 @@ <result date="2007-09-30" statvalue="94" type="cobertura-branch"/> <result date="2007-11-06" statvalue="93" type="cobertura-line"/> <result date="2007-11-06" statvalue="94" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="93" type="cobertura-line"/> + <result date="2010-03-01" statvalue="94" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_FixedWriterFactory.java" @@ -1982,6 +2139,10 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="66" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="66" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_Writer.java" module="default" path="net/sf/flatpack/writer/Writer.java" project="default"> @@ -2003,6 +2164,15 @@ <result date="2007-11-06" statvalue="2" type="checkstyle"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="2" type="checkstyle"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="2" type="checkstyle"/> + <result date="2010-03-02" statvalue="100" type="cobertura-line"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="2" type="checkstyle"/> + <result date="2010-03-03" statvalue="100" type="cobertura-line"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_writer_WriterFactory.java" module="default" @@ -2020,6 +2190,12 @@ <result date="2007-09-30" statvalue="100" type="cobertura-branch"/> <result date="2007-11-06" statvalue="100" type="cobertura-line"/> <result date="2007-11-06" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-line"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-line"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> </file> <file id="default-default-net_sf_flatpack_xml_MapParser.java" module="default" path="net/sf/flatpack/xml/MapParser.java" project="default"> @@ -2035,5 +2211,64 @@ <result date="2007-09-30" statvalue="38" type="cobertura-branch"/> <result date="2007-11-06" statvalue="50" type="cobertura-line"/> <result date="2007-11-06" statvalue="38" type="cobertura-branch"/> + <result date="2010-03-01" statvalue="56" type="cobertura-line"/> + <result date="2010-03-01" statvalue="39" type="cobertura-branch"/> </file> + <file + id="default-default-net_sf_flatpack_AbstractFixedLengthParser.java" + module="default" + path="net/sf/flatpack/AbstractFixedLengthParser.java" project="default"> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> + </file> + <file + id="default-default-net_sf_flatpack_brparse_BuffReaderDataSet.java" + module="default" + path="net/sf/flatpack/brparse/BuffReaderDataSet.java" project="default"> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="43" type="cobertura-line"/> + <result date="2010-03-01" statvalue="50" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> + </file> + <file + id="default-default-net_sf_flatpack_brparse_BuffReaderDelimParser.java" + module="default" + path="net/sf/flatpack/brparse/BuffReaderDelimParser.java" project="default"> + <result date="2010-03-01" statvalue="2" type="checkstyle"/> + <result date="2010-03-01" statvalue="62" type="cobertura-line"/> + <result date="2010-03-01" statvalue="64" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="2" type="checkstyle"/> + <result date="2010-03-03" statvalue="2" type="checkstyle"/> + </file> + <file id="default-default-net_sf_flatpack_util_FPException.java" + module="default" path="net/sf/flatpack/util/FPException.java" project="default"> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> + </file> + <file + id="default-default-net_sf_flatpack_util_FPInvalidUsageException.java" + module="default" + path="net/sf/flatpack/util/FPInvalidUsageException.java" project="default"> + <result date="2010-03-01" statvalue="100" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-02" statvalue="100" type="cobertura-branch"/> + <result date="2010-03-03" statvalue="100" type="cobertura-branch"/> + </file> + <file id="default-default-net_sf_flatpack_ordering_OrderColumn.java" + module="default" + path="net/sf/flatpack/ordering/OrderColumn.java" project="default"> + <result date="2010-03-01" statvalue="80" type="cobertura-line"/> + <result date="2010-03-01" statvalue="100" type="cobertura-branch"/> + </file> + <file + id="default-default-C:_project_flatpack_flatpack_src_test_java_net_sf_flatpack_writer_DelimiterWriterTestCase.java" + module="default" + path="C:/project/flatpack/flatpack/src/test/java/net/sf/flatpack/writer/DelimiterWriterTestCase.java" project="default"/> + <file + id="default-default-C:_project_flatpack_flatpack_src_test_java_net_sf_flatpack_writer_FixedLengthWriterTestCase.java" + module="default" + path="C:/project/flatpack/flatpack/src/test/java/net/sf/flatpack/writer/FixedLengthWriterTestCase.java" project="default"/> </qalab> Modified: trunk/flatpack/src/site/navigation.xml =================================================================== --- trunk/flatpack/src/site/navigation.xml 2010-03-01 21:02:52 UTC (rev 413) +++ trunk/flatpack/src/site/navigation.xml 2010-03-09 20:17:26 UTC (rev 414) @@ -27,7 +27,7 @@ </menu> <footer> <div style="vertical-align:middle"> - <a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> + <a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a href="http://digg.com/submit?phase=2&url=objectlabkit.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming"> <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a> </div> Modified: trunk/flatpack-samples/qalab.xml =================================================================== --- trunk/flatpack-samples/qalab.xml 2010-03-01 21:02:52 UTC (rev 413) +++ trunk/flatpack-samples/qalab.xml 2010-03-09 20:17:26 UTC (rev 414) @@ -197,6 +197,30 @@ project="default" statvalue="92" type="simian"/> <summaryresult date="2007-11-06" filecount="2" module="default" project="default" statvalue="2" type="pmd"/> + <summaryresult date="2010-03-01" filecount="34" module="default" + project="default" statvalue="155" type="checkstyle"/> + <summaryresult date="2010-03-01" filecount="6" module="default" + project="default" statvalue="9" type="findbugs"/> + <summaryresult date="2010-03-01" filecount="6" module="default" + project="default" statvalue="92" type="simian"/> + <summaryresult date="2010-03-01" filecount="2" module="default" + project="default" statvalue="2" type="pmd"/> + <summaryresult date="2010-03-02" filecount="34" module="default" + project="default" statvalue="155" type="checkstyle"/> + <summaryresult date="2010-03-02" filecount="6" module="default" + project="default" statvalue="9" type="findbugs"/> + <summaryresult date="2010-03-02" filecount="6" module="default" + project="default" statvalue="92" type="simian"/> + <summaryresult date="2010-03-02" filecount="2" module="default" + project="default" statvalue="2" type="pmd"/> + <summaryresult date="2010-03-03" filecount="34" module="default" + project="default" statvalue="155" type="checkstyle"/> + <summaryresult date="2010-03-03" filecount="6" module="default" + project="default" statvalue="9" type="findbugs"/> + <summaryresult date="2010-03-03" filecount="6" module="default" + project="default" statvalue="92" type="simian"/> + <summaryresult date="2010-03-03" filecount="2" module="default" + project="default" statvalue="2" type="pmd"/> </summary> <file id="default-default-com_pz_reader_examples_numericsanddates_package.html" @@ -422,6 +446,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_largedataset_largecsvperformancetest_package.html" @@ -448,6 +475,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_multilinedelimitedrecord_package.html" @@ -474,6 +504,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_numericsanddates_package.html" @@ -500,6 +533,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_delimitedcolumnnamesinfile_package.html" @@ -526,6 +562,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_delimiteddynamiccolumns_package.html" @@ -552,6 +591,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_exporttoexcel_package.html" @@ -578,6 +620,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_largedataset_fixedlengthdynamiccolumns_package.html" @@ -604,6 +649,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_createsamplecsv_package.html" @@ -630,6 +678,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_fixedlengthdynamiccolumns_package.html" @@ -656,6 +707,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_largedataset_delimiteddynamiccolumns_package.html" @@ -682,6 +736,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_csvperformancetest_package.html" @@ -708,6 +765,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_lowlevelparse_package.html" @@ -734,6 +794,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_delimiteddynamiccolumnswitherrors_package.html" @@ -760,6 +823,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_fixedlengthheaderandtrailer_package.html" @@ -786,6 +852,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_csvheaderandtrailer_package.html" @@ -812,6 +881,9 @@ <result date="2007-09-29" statvalue="1" type="checkstyle"/> <result date="2007-09-30" statvalue="1" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_Examples.java" module="default" @@ -857,6 +929,12 @@ <result date="2007-09-30" statvalue="1" type="findbugs"/> <result date="2007-11-06" statvalue="14" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="findbugs"/> + <result date="2010-03-01" statvalue="14" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="findbugs"/> + <result date="2010-03-02" statvalue="14" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="findbugs"/> + <result date="2010-03-03" statvalue="14" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="findbugs"/> </file> <file id="default-default-net_sf_flatpack_examples_createsamplecsv_CSVTestFileCreator.java" @@ -925,6 +1003,15 @@ <result date="2007-11-06" statvalue="7" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="findbugs"/> <result date="2007-11-06" statvalue="1" type="pmd"/> + <result date="2010-03-01" statvalue="7" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="findbugs"/> + <result date="2010-03-01" statvalue="1" type="pmd"/> + <result date="2010-03-02" statvalue="7" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="findbugs"/> + <result date="2010-03-02" statvalue="1" type="pmd"/> + <result date="2010-03-03" statvalue="7" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="findbugs"/> + <result date="2010-03-03" statvalue="1" type="pmd"/> </file> <file id="default-default-net_sf_flatpack_examples_csvheaderandtrailer_CSVHeaderAndTrailer.java" @@ -951,6 +1038,9 @@ <result date="2007-09-29" statvalue="17" type="checkstyle"/> <result date="2007-09-30" statvalue="17" type="checkstyle"/> <result date="2007-11-06" statvalue="17" type="checkstyle"/> + <result date="2010-03-01" statvalue="17" type="checkstyle"/> + <result date="2010-03-02" statvalue="17" type="checkstyle"/> + <result date="2010-03-03" statvalue="17" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_csvperformancetest_CSVPerformanceTest.java" @@ -1005,6 +1095,12 @@ <result date="2007-09-30" statvalue="1" type="findbugs"/> <result date="2007-11-06" statvalue="16" type="checkstyle"/> <result date="2007-11-06" statvalue="1" type="findbugs"/> + <result date="2010-03-01" statvalue="16" type="checkstyle"/> + <result date="2010-03-01" statvalue="1" type="findbugs"/> + <result date="2010-03-02" statvalue="16" type="checkstyle"/> + <result date="2010-03-02" statvalue="1" type="findbugs"/> + <result date="2010-03-03" statvalue="16" type="checkstyle"/> + <result date="2010-03-03" statvalue="1" type="findbugs"/> </file> <file id="default-default-net_sf_flatpack_examples_delimitedcolumnnamesinfile_DelimitedColumnNamesInFile.java" @@ -1036,6 +1132,9 @@ <result date="2007-09-29" statvalue="5" type="checkstyle"/> <result date="2007-09-30" statvalue="5" type="checkstyle"/> <result date="2007-11-06" statvalue="5" type="checkstyle"/> + <result date="2010-03-01" statvalue="5" type="checkstyle"/> + <result date="2010-03-02" statvalue="5" type="checkstyle"/> + <result date="2010-03-03" statvalue="5" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_delimiteddynamiccolumns_DelimitedWithPZMap.java" @@ -1069,6 +1168,9 @@ <result date="2007-09-29" statvalue="13" type="checkstyle"/> <result date="2007-09-30" statvalue="13" type="checkstyle"/> <result date="2007-11-06" statvalue="13" type="checkstyle"/> + <result date="2010-03-01" statvalue="13" type="checkstyle"/> + <result date="2010-03-02" statvalue="13" type="checkstyle"/> + <result date="2010-03-03" statvalue="13" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_delimiteddynamiccolumnswitherrors_DelimitedWithPZMapErrors.java" @@ -1102,6 +1204,9 @@ <result date="2007-09-29" statvalue="13" type="checkstyle"/> <result date="2007-09-30" statvalue="13" type="checkstyle"/> <result date="2007-11-06" statvalue="13" type="checkstyle"/> + <result date="2010-03-01" statvalue="13" type="checkstyle"/> + <result date="2010-03-02" statvalue="13" type="checkstyle"/> + <result date="2010-03-03" statvalue="13" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_exporttoexcel_DelimitedFileExportToExcel.java" @@ -1135,6 +1240,9 @@ <result date="2007-09-29" statvalue="3" type="checkstyle"/> <result date="2007-09-30" statvalue="3" type="checkstyle"/> <result date="2007-11-06" statvalue="3" type="checkstyle"/> + <result date="2010-03-01" statvalue="3" type="checkstyle"/> + <result date="2010-03-02" statvalue="3" type="checkstyle"/> + <result date="2010-03-03" statvalue="3" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_fixedlengthdynamiccolumns_FixedLengthWithPZMap.java" @@ -1168,6 +1276,9 @@ <result date="2007-09-29" statvalue="3" type="checkstyle"/> <result date="2007-09-30" statvalue="3" type="checkstyle"/> <result date="2007-11-06" statvalue="3" type="checkstyle"/> + <result date="2010-03-01" statvalue="3" type="checkstyle"/> + <result date="2010-03-02" statvalue="3" type="checkstyle"/> + <result date="2010-03-03" statvalue="3" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_fixedlengthheaderandtrailer_FixedLengthHeaderAndTrailer.java" @@ -1201,6 +1312,9 @@ <result date="2007-09-29" statvalue="17" type="checkstyle"/> <result date="2007-09-30" statvalue="17" type="checkstyle"/> <result date="2007-11-06" statvalue="17" type="checkstyle"/> + <result date="2010-03-01" statvalue="17" type="checkstyle"/> + <result date="2010-03-02" statvalue="17" type="checkstyle"/> + <result date="2010-03-03" statvalue="17" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_largedataset_delimiteddynamiccolumns_LargeDelimitedWithPZMap.java" @@ -1237,6 +1351,9 @@ <result date="2007-09-29" statvalue="4" type="checkstyle"/> <result date="2007-09-30" statvalue="4" type="checkstyle"/> <result date="2007-11-06" statvalue="4" type="checkstyle"/> + <result date="2010-03-01" statvalue="4" type="checkstyle"/> + <result date="2010-03-02" statvalue="4" type="checkstyle"/> + <result date="2010-03-03" statvalue="4" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_largedataset_fixedlengthdynamiccolumns_LargeFixedLengthWithPZMap.java" @@ -1273,6 +1390,9 @@ <result date="2007-09-29" statvalue="3" type="checkstyle"/> <result date="2007-09-30" statvalue="3" type="checkstyle"/> <result date="2007-11-06" statvalue="3" type="checkstyle"/> + <result date="2010-03-01" statvalue="3" type="checkstyle"/> + <result date="2010-03-02" statvalue="3" type="checkstyle"/> + <result date="2010-03-03" statvalue="3" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_largedataset_largecsvperformancetest_CSVLarge.java" @@ -1320,6 +1440,12 @@ <result date="2007-09-30" statvalue="2" type="findbugs"/> <result date="2007-11-06" statvalue="9" type="checkstyle"/> <result date="2007-11-06" statvalue="2" type="findbugs"/> + <result date="2010-03-01" statvalue="9" type="checkstyle"/> + <result date="2010-03-01" statvalue="2" type="findbugs"/> + <result date="2010-03-02" statvalue="9" type="checkstyle"/> + <result date="2010-03-02" statvalue="2" type="findbugs"/> + <result date="2010-03-03" statvalue="9" type="checkstyle"/> + <result date="2010-03-03" statvalue="2" type="findbugs"/> </file> <file id="default-default-net_sf_flatpack_examples_lowlevelparse_LowLevelParse.java" @@ -1388,6 +1514,15 @@ <result date="2007-11-06" statvalue="5" type="checkstyle"/> <result date="2007-11-06" statvalue="2" type="findbugs"/> <result date="2007-11-06" statvalue="1" type="pmd"/> + <result date="2010-03-01" statvalue="5" type="checkstyle"/> + <result date="2010-03-01" statvalue="2" type="findbugs"/> + <result date="2010-03-01" statvalue="1" type="pmd"/> + <result date="2010-03-02" statvalue="5" type="checkstyle"/> + <result date="2010-03-02" statvalue="2" type="findbugs"/> + <result date="2010-03-02" statvalue="1" type="pmd"/> + <result date="2010-03-03" statvalue="5" type="checkstyle"/> + <result date="2010-03-03" statvalue="2" type="findbugs"/> + <result date="2010-03-03" statvalue="1" type="pmd"/> </file> <file id="default-default-net_sf_flatpack_examples_multilinedelimitedrecord_DelimitedMultiLine.java" @@ -1421,6 +1556,9 @@ <result date="2007-09-29" statvalue="4" type="checkstyle"/> <result date="2007-09-30" statvalue="4" type="checkstyle"/> <result date="2007-11-06" statvalue="4" type="checkstyle"/> + <result date="2010-03-01" statvalue="4" type="checkstyle"/> + <result date="2010-03-02" statvalue="4" type="checkstyle"/> + <result date="2010-03-03" statvalue="4" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_numericsanddates_NumericsAndDates.java" @@ -1454,6 +1592,9 @@ <result date="2007-09-29" statvalue="6" type="checkstyle"/> <result date="2007-09-30" statvalue="6" type="checkstyle"/> <result date="2007-11-06" statvalue="6" type="checkstyle"/> + <result date="2010-03-01" statvalue="6" type="checkstyle"/> + <result date="2010-03-02" statvalue="6" type="checkstyle"/> + <result date="2010-03-03" statvalue="6" type="checkstyle"/> </file> <file id="default-default-net_sf_flatpack_examples_ConsoleMenu.java" module="default" @@ -1479,5 +1620,8 @@ <result date="2007-09-29" statvalue="2" type="findbugs"/> <result date="2007-09-30" statvalue="2" type="findbugs"/> <result date="2007-11-06" statvalue="2" type="findbugs"/> + <result date="2010-03-01" statvalue="2" type="findbugs"/> + <result date="2010-03-02" statvalue="2" type="findbugs"/> + <result date="2010-03-03" statvalue="2" type="findbugs"/> </file> </qalab> Modified: trunk/flatpack-samples/src/site/navigation.xml =================================================================== --- trunk/flatpack-samples/src/site/navigation.xml 2010-03-01 21:02:52 UTC (rev 413) +++ trunk/flatpack-samples/src/site/navigation.xml 2010-03-09 20:17:26 UTC (rev 414) @@ -27,7 +27,7 @@ </menu> <footer> <div style="vertical-align:middle"> - <a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> + <a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a href="http://digg.com/submit?phase=2&url=objectlabkit.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming"> <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a> </div> Modified: trunk/project.properties =================================================================== --- trunk/project.properties 2010-03-01 21:02:52 UTC (rev 413) +++ trunk/project.properties 2010-03-09 20:17:26 UTC (rev 414) @@ -44,7 +44,10 @@ # Display the maven version the web site is documenting #maven.xdoc.version = maven.xdoc.version=${pom.currentVersion} -maven.xdoc.distributionUrl=https://sourceforge.net/project/showfiles.php?group_id=127761 +#maven.xdoc.distributionUrl=https://sourceforge.net/project/showfiles.php?group_id=127761 +maven.xdoc.distributionUrl=http://prdownloads.sourceforge.net/flatpack +maven.xdoc.distributionType=zip + #maven.xdoc.poweredby.image=objectlab-poweredby.gif maven.xdoc.poweredby.title=Powered By the Nice People of ObjectLab maven.xdoc.poweredby.url=http://www.objectlab.co.uk Modified: trunk/src/site/index.xml =================================================================== --- trunk/src/site/index.xml 2010-03-01 21:02:52 UTC (rev 413) +++ trunk/src/site/index.xml 2010-03-09 20:17:26 UTC (rev 414) @@ -23,9 +23,11 @@ <section name="News"> <p style="margin-top:10px; margin-bottom:0; padding-bottom:0; text-align:center; line-height:0"><a href="http://feeds.feedburner.com/~r/ObjectlabOpenSourceNews/~6/1"><img src="http://feeds.feedburner.com/ObjectlabOpenSourceNews.1.gif" alt="ObjectLab Open Source News" style="border:0"/></a></p><p style="margin-top:5px; padding-top:0; font-size:x-small; text-align:center"><a href="http://www.feedburner.com/fb/a/headlineanimator/install?id=829470&w=1" onclick="window.open(this.href, 'haHowto', 'width=520,height=600,toolbar=no,address=no,resizable=yes,scrollbars'); return false" target="_blank">Grab this Headline Animator</a></p> - <p>Sept 14, 2007: FlatPack 3.1.0 is released, it is a very significant release, see the <a href="changes-report.html">change log</a>.</p> + <p>March 03, 2010: FlatPack 3.2.0 is released, it is mainly a bug-fix release, see the <a href="changes-report.html">change log</a>.</p> </section> + + <section name="FlatPack Introduction"> <p>FlatPack came out of the frustration of having to mix file parsing logic with business logic.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2010-03-01 21:02:58
|
Revision: 413 http://flatpack.svn.sourceforge.net/flatpack/?rev=413&view=rev Author: benoitx Date: 2010-03-01 21:02:52 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Prepare for 3.2 release. Added getBigDecimal on DataSet. Modified Paths: -------------- trunk/common-build/project.xml trunk/flatpack/.classpath trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/Version.java trunk/src/site/changes.xml trunk/src/site/navigation.xml Modified: trunk/common-build/project.xml =================================================================== --- trunk/common-build/project.xml 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/common-build/project.xml 2010-03-01 21:02:52 UTC (rev 413) @@ -27,7 +27,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/3.0.0 http://maven.apache.org/maven-v3_0_0.xsd"> <pomVersion>3</pomVersion> <groupId>net.sf.flatpack</groupId> - <currentVersion>3.2.0-SNAPSHOT</currentVersion> + <currentVersion>3.2.0</currentVersion> <organization> <name>ObjectLab Financial Ltd</name> <url>http://www.objectlab.co.uk</url> @@ -198,9 +198,9 @@ <versions> <version> - <id>3.2.0-SNAPSHOT</id> - <name>3.2.0-SNAPSHOT</name> - <tag>3.2.0-SNAPSHOT</tag> + <id>3.2.0</id> + <name>3.2.0</name> + <tag>3.2.0</tag> </version> <version> <id>3.1.1</id> Modified: trunk/flatpack/.classpath =================================================================== --- trunk/flatpack/.classpath 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/flatpack/.classpath 2010-03-01 21:02:52 UTC (rev 413) @@ -8,5 +8,6 @@ <classpathentry kind="var" path="MAVEN_REPO/org.slf4j/jars/slf4j-api-1.1.0-RC1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/org.slf4j/jars/slf4j-simple-1.1.0-RC1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jexcelapi/jars/jxl-2.4.2.jar"/> + <classpathentry kind="var" path="MAVEN_REPO"/> <classpathentry kind="output" path="target/classes"/> </classpath> Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java 2010-03-01 21:02:52 UTC (rev 413) @@ -35,7 +35,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; -import java.util.Iterator; import java.util.List; import net.sf.flatpack.structure.Row; Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2010-03-01 21:02:52 UTC (rev 413) @@ -32,10 +32,12 @@ */ package net.sf.flatpack; +import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import java.util.NoSuchElementException; import java.util.Properties; import net.sf.flatpack.ordering.OrderBy; @@ -92,6 +94,17 @@ double getDouble(final String column); /** + * Returns the BigDecimal value of a specified column + * + * @param column - + * Name of the column + * @exception NoSuchElementException + * @exception NumberFormatException + * @return BigDecimal + */ + BigDecimal getBigDecimal(final String column); + + /** * Returns the interger value of a specified column * * @param column - Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2010-03-01 21:02:52 UTC (rev 413) @@ -32,6 +32,7 @@ */ package net.sf.flatpack; +import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -99,7 +100,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getColumns() + * @see net.sf.flatpack.DataSet#getColumns() */ public String[] getColumns() { ColumnMetaData column = null; @@ -121,7 +122,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getColumns(java.lang.String) + * @see net.sf.flatpack.DataSet#getColumns(java.lang.String) */ public String[] getColumns(final String recordID) { String[] array = null; @@ -141,7 +142,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getDate(java.lang.String) + * @see net.sf.flatpack.DataSet#getDate(java.lang.String) */ public Date getDate(final String column) throws ParseException { return getDate(column, new SimpleDateFormat("yyyyMMdd")); @@ -150,7 +151,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getDate(java.lang.String, + * @see net.sf.flatpack.DataSet#getDate(java.lang.String, * java.text.SimpleDateFormat) */ public Date getDate(final String column, final SimpleDateFormat sdf) throws ParseException { @@ -165,12 +166,11 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getDouble(java.lang.String) + * @see net.sf.flatpack.DataSet#getDouble(java.lang.String) */ public double getDouble(final String column) { final StringBuffer newString = new StringBuffer(); final String s = getStringValue(column); - // final String s = row.getValue(ParserUtils.getColumnIndex(row.getMdkey(), columnMD, column, pzparser)); if (!strictNumericParse) { newString.append(ParserUtils.stripNonDoubleChars(s)); @@ -181,6 +181,17 @@ return Double.parseDouble(newString.toString()); } + /* + * (non-Javadoc) + * + * @see net.sf.flatpack.DataSet#getBigDecimal(java.lang.String) + */ + public BigDecimal getBigDecimal(final String column) { + final String s = getStringValue(column); + + return new BigDecimal(s); + } + private String getStringValue(final String column) { final Row row = (Row) rows.get(pointer); return row.getValue(ParserUtils.getColumnIndex(row.getMdkey(), metaData, column, parser)); @@ -194,7 +205,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getErrorCount() + * @see net.sf.flatpack.DataSet#getErrorCount() */ public int getErrorCount() { if (getErrors() != null) { @@ -207,7 +218,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getErrors() + * @see net.sf.flatpack.DataSet#getErrors() */ public List getErrors() { return errors; @@ -216,7 +227,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getIndex() + * @see net.sf.flatpack.DataSet#getIndex() */ public int getIndex() { return pointer; @@ -225,7 +236,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getInt(java.lang.String) + * @see net.sf.flatpack.DataSet#getInt(java.lang.String) */ public int getInt(final String column) { final String s = getStringValue(column); @@ -250,7 +261,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getRowCount() + * @see net.sf.flatpack.DataSet#getRowCount() */ public int getRowCount() { return rows.size(); @@ -259,7 +270,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getRowNo() + * @see net.sf.flatpack.DataSet#getRowNo() */ public int getRowNo() { return ((Row) rows.get(pointer)).getRowNumber(); @@ -268,7 +279,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#getString(java.lang.String) + * @see net.sf.flatpack.DataSet#getString(java.lang.String) */ public String getString(final String column) { String s = getStringValue(column); @@ -301,7 +312,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#goBottom() + * @see net.sf.flatpack.DataSet#goBottom() */ public void goBottom() { pointer = rows.size() - 1; @@ -310,7 +321,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#goTop() + * @see net.sf.flatpack.DataSet#goTop() */ public void goTop() { pointer = -1; @@ -319,7 +330,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#isAnError(int) + * @see net.sf.flatpack.DataSet#isAnError(int) */ public boolean isAnError(final int lineNo) { for (int i = 0; i < errors.size(); i++) { @@ -333,7 +344,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#next() + * @see net.sf.flatpack.DataSet#next() */ public boolean next() { if (pointer < rows.size() && pointer + 1 != rows.size()) { @@ -346,7 +357,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#orderRows(net.sf.flatpack.ordering.OrderBy) + * @see net.sf.flatpack.DataSet#orderRows(net.sf.flatpack.ordering.OrderBy) */ public void orderRows(final OrderBy ob) { // PZ try to handle other <records> by sending them to @@ -369,7 +380,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#previous() + * @see net.sf.flatpack.DataSet#previous() */ public boolean previous() { if (pointer <= 0) { @@ -442,7 +453,7 @@ /* * (non-Javadoc) * - * @see net.sf.flatpack.IDataSet#remove() + * @see net.sf.flatpack.DataSet#remove() */ public void remove() { rows.remove(pointer); Modified: trunk/flatpack/src/main/java/net/sf/flatpack/Version.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/Version.java 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/flatpack/src/main/java/net/sf/flatpack/Version.java 2010-03-01 21:02:52 UTC (rev 413) @@ -19,5 +19,5 @@ * Static class which stores the version of this FlatPack */ public class Version { - public static final String VERSION = "3.2.0-SNAPSHOT"; + public static final String VERSION = "3.2.0"; } Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/src/site/changes.xml 2010-03-01 21:02:52 UTC (rev 413) @@ -7,7 +7,8 @@ <title>Changes</title> </properties> <body> - <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <release version="3.2.0" date="2010-03-03" description="New parse options"> + <action dev="benoitx" type="add">Added a getBigDecimal method on DataSet.</action> <action dev="zepernick" type="fix">Fixed SF Bug 1869636. The parameters for the XML Map and data file were reversed in the BuffReaderDelimParser.</action> <action dev="zepernick" type="change">Added optional 3rd parameter to the OrderColumn constructor which Modified: trunk/src/site/navigation.xml =================================================================== --- trunk/src/site/navigation.xml 2010-03-01 20:17:58 UTC (rev 412) +++ trunk/src/site/navigation.xml 2010-03-01 21:02:52 UTC (rev 413) @@ -31,7 +31,7 @@ </menu> <footer> <div style="vertical-align:middle"> - <p style="margin-top:10px; margin-bottom:0; padding-bottom:0; text-align:center; line-height:0"><a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> + <p style="margin-top:10px; margin-bottom:0; padding-bottom:0; text-align:center; line-height:0"><a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a href="http://digg.com/submit?phase=2&url=flatpack.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming"> <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a> <a href="http://feeds.feedburner.com/~r/ObjectlabOpenSourceNews/~6/1"><img src="http://feeds.feedburner.com/ObjectlabOpenSourceNews.1.gif" alt="ObjectLab Open Source News" style="border:0"/></a></p><p style="margin-top:5px; padding-top:0; font-size:x-small; text-align:center"></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2010-03-01 20:18:05
|
Revision: 412 http://flatpack.svn.sourceforge.net/flatpack/?rev=412&view=rev Author: zepernick Date: 2010-03-01 20:17:58 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Added a test for the BuffReaderParseFactory to make sure the parameter order was truly fixed. Modified Paths: -------------- trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java Modified: trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java =================================================================== --- trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2010-03-01 19:52:16 UTC (rev 411) +++ trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2010-03-01 20:17:58 UTC (rev 412) @@ -201,6 +201,23 @@ assertEquals(true, ds.next()); } + public void testBRParseParameters() { + DataSet ds; + String xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> \r\n" + + "<!DOCTYPE PZMAP SYSTEM \"pzfilereader.dtd\" > \r\n" + + " <PZMAP>\r\n" + + " <COLUMN name=\"column1\" /> \r\n" + + " <COLUMN name=\"column2\" /> \r\n" + + " </PZMAP>"; + + String cols = "VAL1,VAL2"; + + Parser p = BuffReaderParseFactory.getInstance().newDelimitedParser(new StringReader(xml), new StringReader(cols), ',', FPConstants.NO_QUALIFIER, false); + ds = p.parse(); + + assertEquals(true, ds.next()); + } + public void testSorting() { DataSet ds; String cols = "fname,lname,dob,anumber\r\npaul,zepernick,06/21/1981,2\r\nbenoit,xhenseval,05/01/1970,12"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2010-03-01 19:52:24
|
Revision: 411 http://flatpack.svn.sourceforge.net/flatpack/?rev=411&view=rev Author: zepernick Date: 2010-03-01 19:52:16 +0000 (Mon, 01 Mar 2010) Log Message: ----------- added a couple junit tests to try to replicate a bug reported on SF. So far everything is passing and it cannot be recreated. Modified Paths: -------------- trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java Modified: trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java =================================================================== --- trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2010-03-01 14:54:20 UTC (rev 410) +++ trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2010-03-01 19:52:16 UTC (rev 411) @@ -9,6 +9,7 @@ import net.sf.flatpack.DataSet; import net.sf.flatpack.DefaultParserFactory; import net.sf.flatpack.Parser; +import net.sf.flatpack.brparse.BuffReaderParseFactory; import net.sf.flatpack.ordering.OrderBy; import net.sf.flatpack.ordering.OrderColumn; import net.sf.flatpack.util.FPConstants; @@ -21,6 +22,40 @@ * @author Paul Zepernick */ public class PZParserOptsTest extends TestCase { + + public void testHandleShortLines() { + DataSet ds; + final String cols = "COLUMN1,column2,Column3\r\n value1"; + Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + p.setHandlingShortLines(true); + // p.setIgnoreParseWarnings(true); + ds = p.parse(); + assertEquals("Should have a row of data", true, ds.next()); + + //re-test the buffered reader + p = BuffReaderParseFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + p.setHandlingShortLines(true); + // p.setIgnoreParseWarnings(true); + ds = p.parse(); + assertEquals("Should have a row of data", true, ds.next()); + } + + public void testIgnoreExtraColumns() { + DataSet ds; + final String cols = "COLUMN1,column2,Column3\r\n \"value1\",value2,value3,value4"; + Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', '"'); + p.setIgnoreExtraColumns(true); + // p.setIgnoreParseWarnings(true); + ds = p.parse(); + assertEquals("Should have a row of data", true, ds.next()); + + //re-test the buffered reader + p = BuffReaderParseFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', '"'); + p.setIgnoreExtraColumns(true); + // p.setIgnoreParseWarnings(true); + ds = p.parse(); + assertEquals("Should have a row of data", true, ds.next()); + } public void testEmptyToNull() { DataSet ds; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2010-03-01 14:54:26
|
Revision: 410 http://flatpack.svn.sourceforge.net/flatpack/?rev=410&view=rev Author: zepernick Date: 2010-03-01 14:54:20 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Modified Paths: -------------- trunk/src/site/changes.xml Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2010-02-28 20:44:26 UTC (rev 409) +++ trunk/src/site/changes.xml 2010-03-01 14:54:20 UTC (rev 410) @@ -8,6 +8,8 @@ </properties> <body> <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <action dev="zepernick" type="fix">Fixed SF Bug 1869636. The parameters for the XML Map and + data file were reversed in the BuffReaderDelimParser.</action> <action dev="zepernick" type="change">Added optional 3rd parameter to the OrderColumn constructor which allows the specification of the type of column being sorted: OrderColumn.COLTYPE_STRING, OrderColumn.COLTYPE_DATE, OrderColumn.COLTYPE_NUMERIC</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2010-02-28 20:44:34
|
Revision: 409 http://flatpack.svn.sourceforge.net/flatpack/?rev=409&view=rev Author: zepernick Date: 2010-02-28 20:44:26 +0000 (Sun, 28 Feb 2010) Log Message: ----------- fix for bug ID 1869636. The parameters for the datasource and xml map were reversed when calling the super class. Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java 2009-03-10 17:41:10 UTC (rev 408) +++ trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java 2010-02-28 20:44:26 UTC (rev 409) @@ -76,7 +76,7 @@ public BuffReaderDelimParser(final Reader pzmapXML, final Reader dataSource, final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { - super(pzmapXML, dataSource, delimiter, qualifier, ignoreFirstRecord); + super(dataSource, pzmapXML, delimiter, qualifier, ignoreFirstRecord); } public BuffReaderDelimParser(final Reader dataSourceStream, final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2009-03-10 17:41:14
|
Revision: 408 http://flatpack.svn.sourceforge.net/flatpack/?rev=408&view=rev Author: benoitx Date: 2009-03-10 17:41:10 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Updating the SF logo as per the SF email sent March 10. Modified Paths: -------------- trunk/flatpack/.classpath trunk/flatpack/src/site/navigation.xml trunk/flatpack-samples/.classpath trunk/flatpack-samples/src/site/navigation.xml trunk/src/site/navigation.xml Modified: trunk/flatpack/.classpath =================================================================== --- trunk/flatpack/.classpath 2008-09-04 11:17:35 UTC (rev 407) +++ trunk/flatpack/.classpath 2009-03-10 17:41:10 UTC (rev 408) @@ -2,11 +2,11 @@ <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="src/main/java"/> - <classpathentry output="target/test-classes" kind="src" path="src/test/java"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.2.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jdom/jars/jdom-1.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jexcelapi/jars/jxl-2.4.2.jar"/> <classpathentry kind="var" path="MAVEN_REPO/org.slf4j/jars/slf4j-api-1.1.0-RC1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/org.slf4j/jars/slf4j-simple-1.1.0-RC1.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/jexcelapi/jars/jxl-2.4.2.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> Modified: trunk/flatpack/src/site/navigation.xml =================================================================== --- trunk/flatpack/src/site/navigation.xml 2008-09-04 11:17:35 UTC (rev 407) +++ trunk/flatpack/src/site/navigation.xml 2009-03-10 17:41:10 UTC (rev 408) @@ -27,9 +27,7 @@ </menu> <footer> <div style="vertical-align:middle"> - <a href="http://sourceforge.net"> - <img src="http://sourceforge.net/sflogo.php?group_id=97367&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /> - </a> + <a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a href="http://digg.com/submit?phase=2&url=objectlabkit.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming"> <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a> </div> Modified: trunk/flatpack-samples/.classpath =================================================================== --- trunk/flatpack-samples/.classpath 2008-09-04 11:17:35 UTC (rev 407) +++ trunk/flatpack-samples/.classpath 2009-03-10 17:41:10 UTC (rev 408) @@ -2,7 +2,7 @@ <classpath> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="src/main/java"/> - <classpathentry kind="var" path="MAVEN_REPO/net.sf.flatpack/jars/flatpack-3.1.0.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/net.sf.flatpack/jars/flatpack-3.2.0-SNAPSHOT.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jdom/jars/jdom-1.0.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jexcelapi/jars/jxl-2.4.2.jar"/> <classpathentry kind="var" path="MAVEN_REPO/org.slf4j/jars/slf4j-api-1.1.0-RC1.jar"/> Modified: trunk/flatpack-samples/src/site/navigation.xml =================================================================== --- trunk/flatpack-samples/src/site/navigation.xml 2008-09-04 11:17:35 UTC (rev 407) +++ trunk/flatpack-samples/src/site/navigation.xml 2009-03-10 17:41:10 UTC (rev 408) @@ -27,9 +27,7 @@ </menu> <footer> <div style="vertical-align:middle"> - <a href="http://sourceforge.net"> - <img src="http://sourceforge.net/sflogo.php?group_id=97367&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /> - </a> + <a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a href="http://digg.com/submit?phase=2&url=objectlabkit.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming"> <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a> </div> Modified: trunk/src/site/navigation.xml =================================================================== --- trunk/src/site/navigation.xml 2008-09-04 11:17:35 UTC (rev 407) +++ trunk/src/site/navigation.xml 2009-03-10 17:41:10 UTC (rev 408) @@ -31,9 +31,7 @@ </menu> <footer> <div style="vertical-align:middle"> - <p style="margin-top:10px; margin-bottom:0; padding-bottom:0; text-align:center; line-height:0"><a href="http://sourceforge.net"> - <img src="http://sourceforge.net/sflogo.php?group_id=97367&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /> - </a> + <p style="margin-top:10px; margin-bottom:0; padding-bottom:0; text-align:center; line-height:0"><a href="http://sourceforge.net/projects/flatpack"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=127761&type=13" width="120" height="30" border="0" alt="Get FlatPack Java API For Flat Files at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> <a href="http://digg.com/submit?phase=2&url=flatpack.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming"> <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a> <a href="http://feeds.feedburner.com/~r/ObjectlabOpenSourceNews/~6/1"><img src="http://feeds.feedburner.com/ObjectlabOpenSourceNews.1.gif" alt="ObjectLab Open Source News" style="border:0"/></a></p><p style="margin-top:5px; padding-top:0; font-size:x-small; text-align:center"></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-09-04 11:17:31
|
Revision: 407 http://flatpack.svn.sourceforge.net/flatpack/?rev=407&view=rev Author: zepernick Date: 2008-09-04 11:17:35 +0000 (Thu, 04 Sep 2008) Log Message: ----------- fixed bug. Sorting was not working if the column names were not being looked up in lower case. They are put into the map lower case so that we can ignore case on the name unless the user elects to use strict lookup only. Had to pass the parser object into the order by so we can check the options which were set for the parse. Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-09-02 02:20:51 UTC (rev 406) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-09-04 11:17:35 UTC (rev 407) @@ -360,6 +360,7 @@ // final List cmds = ParserUtils.getColumnMetaData(PZConstants.DETAIL_ID, columnMD); //ob.setColumnMD(cmds); ob.setMetaData(getMetaData()); + ob.setParser(parser); Collections.sort(rows, ob); goTop(); } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java 2008-09-02 02:20:51 UTC (rev 406) +++ trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java 2008-09-04 11:17:35 UTC (rev 407) @@ -43,6 +43,7 @@ import java.util.List; import java.util.Locale; +import net.sf.flatpack.Parser; import net.sf.flatpack.structure.Row; import net.sf.flatpack.util.FPConstants; import net.sf.flatpack.util.ParserUtils; @@ -63,6 +64,8 @@ private final List orderbys = new ArrayList(); private MetaData metaData; + + private Parser parser; /** * Adds an order element to the sort. @@ -107,8 +110,8 @@ // into account when sorting Comparable comp0 = null; Comparable comp1 = null; - String str0 = row0.getValue(ParserUtils.getColumnIndex(row0.getMdkey(), metaData, oc.getColumnName(), null)).toLowerCase(Locale.getDefault()); - String str1 = row1.getValue(ParserUtils.getColumnIndex(row1.getMdkey(), metaData, oc.getColumnName(), null)).toLowerCase(Locale.getDefault()); + String str0 = row0.getValue(ParserUtils.getColumnIndex(row0.getMdkey(), metaData, oc.getColumnName(), parser)).toLowerCase(Locale.getDefault()); + String str1 = row1.getValue(ParserUtils.getColumnIndex(row1.getMdkey(), metaData, oc.getColumnName(), parser)).toLowerCase(Locale.getDefault()); switch (oc.getSelectedColType()) { case OrderColumn.COLTYPE_STRING: comp0 = str0; @@ -157,12 +160,6 @@ } - /** - * @return the metaData - */ - public MetaData getMetaData() { - return metaData; - } /** * @param metaData the metaData to set @@ -171,4 +168,12 @@ this.metaData = metaData; } + + /** + * @param parser the parser to set + */ + public void setParser(Parser parser) { + this.parser = parser; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-09-02 02:20:42
|
Revision: 406 http://flatpack.svn.sourceforge.net/flatpack/?rev=406&view=rev Author: zepernick Date: 2008-09-02 02:20:51 +0000 (Tue, 02 Sep 2008) Log Message: ----------- added the ability to specify the type of column being ordered by: String, Date, Numeric. This allows more control over the sorting. Modified Paths: -------------- trunk/src/site/changes.xml Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2008-09-02 02:20:25 UTC (rev 405) +++ trunk/src/site/changes.xml 2008-09-02 02:20:51 UTC (rev 406) @@ -8,6 +8,9 @@ </properties> <body> <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <action dev="zepernick" type="change">Added optional 3rd parameter to the OrderColumn constructor which + allows the specification of the type of column being sorted: OrderColumn.COLTYPE_STRING, OrderColumn.COLTYPE_DATE, + OrderColumn.COLTYPE_NUMERIC</action> <action dev="zepernick" type="change">New Parser option to log the raw line data of the record in the DataSet object. Parser.setStoreRawDataToDataSet()</action> <action dev="zepernick" type="fix">Stopped the fixed width parser from removing leading spaces in a data element. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-09-02 02:20:16
|
Revision: 405 http://flatpack.svn.sourceforge.net/flatpack/?rev=405&view=rev Author: zepernick Date: 2008-09-02 02:20:25 +0000 (Tue, 02 Sep 2008) Log Message: ----------- added the ability to specify the type of column being ordered by: String, Date, Numeric. This allows more control over the sorting. Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderColumn.java trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java 2008-09-02 02:19:23 UTC (rev 404) +++ trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderBy.java 2008-09-02 02:20:25 UTC (rev 405) @@ -33,14 +33,20 @@ package net.sf.flatpack.ordering; import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; import java.util.Comparator; +import java.util.Date; +import java.util.GregorianCalendar; import java.util.List; import java.util.Locale; import net.sf.flatpack.structure.Row; import net.sf.flatpack.util.FPConstants; import net.sf.flatpack.util.ParserUtils; +import net.sf.flatpack.xml.MetaData; /** * @author paul zepernick @@ -54,11 +60,10 @@ private static final long serialVersionUID = 5622406168247149895L; /** collection of order elements to sort by */ - private final ArrayList orderbys = new ArrayList(); + private final List orderbys = new ArrayList(); + + private MetaData metaData; - /** column meta data */ - private List columnMD = null; - /** * Adds an order element to the sort. * @@ -80,6 +85,7 @@ final Row row0 = (Row) arg0; final Row row1 = (Row) arg1; int result = 0; + for (int i = 0; i < orderbys.size(); i++) { final OrderColumn oc = (OrderColumn) orderbys.get(i); @@ -99,8 +105,35 @@ // convert to one type of case so the comparator does not take case // into account when sorting - final Comparable comp0 = row0.getValue(ParserUtils.findColumn(oc.getColumnName(), columnMD)).toLowerCase(Locale.getDefault()); - final Comparable comp1 = row1.getValue(ParserUtils.findColumn(oc.getColumnName(), columnMD)).toLowerCase(Locale.getDefault()); + Comparable comp0 = null; + Comparable comp1 = null; + String str0 = row0.getValue(ParserUtils.getColumnIndex(row0.getMdkey(), metaData, oc.getColumnName(), null)).toLowerCase(Locale.getDefault()); + String str1 = row1.getValue(ParserUtils.getColumnIndex(row1.getMdkey(), metaData, oc.getColumnName(), null)).toLowerCase(Locale.getDefault()); + switch (oc.getSelectedColType()) { + case OrderColumn.COLTYPE_STRING: + comp0 = str0; + comp1 = str1; + break; + case OrderColumn.COLTYPE_NUMERIC: + comp0 = Double.valueOf(ParserUtils.stripNonDoubleChars(str0)); + comp1 = Double.valueOf(ParserUtils.stripNonDoubleChars(str1)); + break; + case OrderColumn.COLTYPE_DATE: + final SimpleDateFormat sdf = new SimpleDateFormat(oc.getDateFormatPattern()); + try { + comp0 = sdf.parse(str0); + } catch(ParseException e) { + comp0 = getBadDateDefault(); + + } + + try { + comp1 = sdf.parse(str1); + } catch(ParseException e) { + comp1 = getBadDateDefault(); + } + break; + } // multiply by the sort indicator to get a ASC or DESC result result = comp0.compareTo(comp1) * oc.getSortIndicator(); @@ -115,11 +148,27 @@ return result; } + private Date getBadDateDefault() { + final Calendar defaultBadDt = new GregorianCalendar(); + defaultBadDt.set(Calendar.MONTH, 1); + defaultBadDt.set(Calendar.YEAR, 1900); + defaultBadDt.set(Calendar.DAY_OF_MONTH, 1); + return defaultBadDt.getTime(); + } + + /** - * @param columnMD - * The columnMD to set. + * @return the metaData */ - public void setColumnMD(final List columnMD) { - this.columnMD = columnMD; + public MetaData getMetaData() { + return metaData; } + + /** + * @param metaData the metaData to set + */ + public void setMetaData(MetaData metaData) { + this.metaData = metaData; + } + } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderColumn.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderColumn.java 2008-09-02 02:19:23 UTC (rev 404) +++ trunk/flatpack/src/main/java/net/sf/flatpack/ordering/OrderColumn.java 2008-09-02 02:20:25 UTC (rev 405) @@ -41,27 +41,62 @@ * @version 2.0 */ public class OrderColumn { - /** property name to sort by */ - private String columnName = null; + + /**Specifies descending sort order*/ + public static final boolean DESC = true; + + /**Specifies Ascending sort order*/ + public static final boolean ASC = false; + + /**string sort indicator*/ + public static final int COLTYPE_STRING = 0; + + /**date sort indicator*/ + public static final int COLTYPE_DATE = 1; + + /**numeric sort indicator*/ + public static final int COLTYPE_NUMERIC = 2; + + //property name to sort by + private String columnName; - /** 1 = ASC -1 = DESC */ + //1 = ASC -1 = DESC private int sortIndicator = 1; + + private int selectedColType; + + private String dateFormatPattern = "yyyyMMdd"; /** * Constructs a new order by element * - * @param columnName - + * @param columnName * column to sort by - * @param desc - - * boolean sort DESC? + * @param desc + * boolean sort DESC. OrderColumn.DESC, OrderColumn.ASC + * @param colType + * Type of column to be sorted: OrderColumn.COLTYPE_STRING,OrderColumn.COLTYPE_DATE, OrderColum.COLTYPE_NUMERIC */ - public OrderColumn(final String columnName, final boolean desc) { + public OrderColumn(final String columnName, final boolean desc, final int colType) { this.columnName = columnName; + this.selectedColType = colType; if (desc) { this.sortIndicator = -1; } } + + /** + * Constructs a new order by element + * + * @param columnName + * column to sort by + * @param desc + * boolean sort DESC. OrderColumn.DESC, OrderColumn.ASC + */ + public OrderColumn(final String columnName, final boolean desc) { + this(columnName, desc, OrderColumn.COLTYPE_STRING); + } /** * @return Returns the propertyName. @@ -84,4 +119,39 @@ public int getSortIndicator() { return sortIndicator; } + + /** + * @return the selectedColType + */ + public int getSelectedColType() { + return selectedColType; + } + + /** + * @param selectedColType the selectedColType to set + */ + public void setSelectedColType(int selectedColType) { + this.selectedColType = selectedColType; + } + + /** + * Format pattern to use to parse dates for sorting. Default is yyyyMMdd + * + * @return the dateFormatPattern + */ + public String getDateFormatPattern() { + return dateFormatPattern; + } + + /** + * Format pattern to use to parse dates for sorting. Default is yyyyMMdd + * + * @param dateFormatPattern the dateFormatPattern to set + * @see java.text.SimpleDateFormat + + */ + public void setDateFormatPattern(String dateFormatPattern) { + this.dateFormatPattern = dateFormatPattern; + } } + Modified: trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java =================================================================== --- trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2008-09-02 02:19:23 UTC (rev 404) +++ trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2008-09-02 02:20:25 UTC (rev 405) @@ -9,6 +9,8 @@ import net.sf.flatpack.DataSet; import net.sf.flatpack.DefaultParserFactory; import net.sf.flatpack.Parser; +import net.sf.flatpack.ordering.OrderBy; +import net.sf.flatpack.ordering.OrderColumn; import net.sf.flatpack.util.FPConstants; import net.sf.flatpack.util.FPInvalidUsageException; @@ -163,6 +165,66 @@ assertEquals(true, ds.next()); } + + public void testSorting() { + DataSet ds; + String cols = "fname,lname,dob,anumber\r\npaul,zepernick,06/21/1981,2\r\nbenoit,xhenseval,05/01/1970,12"; + Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + ds = p.parse(); + + OrderBy order = new OrderBy(); + order.addOrderColumn(new OrderColumn("fname",OrderColumn.ASC)); + ds.orderRows(order); + ds.next(); + assertEquals("benoit", ds.getString("fname")); + + + order = new OrderBy(); + order.addOrderColumn(new OrderColumn("lname",OrderColumn.DESC)); + ds.orderRows(order); + ds.next(); + assertEquals("zepernick", ds.getString("lname")); + + + //test date sorting + order = new OrderBy(); + OrderColumn column = new OrderColumn("dob",OrderColumn.ASC, OrderColumn.COLTYPE_DATE); + column.setDateFormatPattern("MM/dd/yyyy"); + order.addOrderColumn(column); + ds.orderRows(order); + ds.next(); + assertEquals("xhenseval", ds.getString("lname")); + + + //test numeric sorting + order = new OrderBy(); + order.addOrderColumn(new OrderColumn("anumber",OrderColumn.DESC, OrderColumn.COLTYPE_NUMERIC)); + ds.orderRows(order); + ds.next(); + assertEquals("xhenseval", ds.getString("lname")); + + + //test bad date format & bad numeric data + //06.21.1981 should default to 01/01/1900 since it does not match our date format + cols = "fname,lname,dob,anumber\r\npaul,zepernick,06.21.1981,not a number\r\nbenoit,xhenseval,05/01/1970,12"; + p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + ds = p.parse(); + order = new OrderBy(); + column = new OrderColumn("dob",OrderColumn.ASC, OrderColumn.COLTYPE_DATE); + column.setDateFormatPattern("MM/dd/yyyy"); + order.addOrderColumn(column); + ds.orderRows(order); + ds.next(); + assertEquals("zepernick", ds.getString("lname")); + + //not a number should get treated as a 0 + order = new OrderBy(); + order.addOrderColumn(new OrderColumn("anumber",OrderColumn.ASC, OrderColumn.COLTYPE_NUMERIC)); + ds.orderRows(order); + ds.next(); + assertEquals("zepernick", ds.getString("lname")); + + } public static void main(final String[] args) { junit.textui.TestRunner.run(PZParserOptsTest.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-09-02 02:19:13
|
Revision: 404 http://flatpack.svn.sourceforge.net/flatpack/?rev=404&view=rev Author: zepernick Date: 2008-09-02 02:19:23 +0000 (Tue, 02 Sep 2008) Log Message: ----------- removed the throws exception from the method signature or the orderRows() Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDataSet.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-09-01 13:21:36 UTC (rev 403) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-09-02 02:19:23 UTC (rev 404) @@ -239,11 +239,10 @@ * * @param ob - * OrderBy object - * @exception Exception * @see net.sf.flatpack.ordering.OrderBy * @see net.sf.flatpack.ordering.OrderColumn */ - void orderRows(final OrderBy ob) throws Exception; + void orderRows(final OrderBy ob); /** * Sets data in the DataSet to lowercase Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-09-01 13:21:36 UTC (rev 403) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-09-02 02:19:23 UTC (rev 404) @@ -348,7 +348,7 @@ * * @see net.sf.flatpack.IDataSet#orderRows(net.sf.flatpack.ordering.OrderBy) */ - public void orderRows(final OrderBy ob) throws Exception { + public void orderRows(final OrderBy ob) { // PZ try to handle other <records> by sending them to // the bottom of the sort // if (columnMD.size() > 1) { @@ -358,7 +358,8 @@ if (ob != null && rows != null) { final List cmds = metaData.getColumnsNames(); // final List cmds = ParserUtils.getColumnMetaData(PZConstants.DETAIL_ID, columnMD); - ob.setColumnMD(cmds); + //ob.setColumnMD(cmds); + ob.setMetaData(getMetaData()); Collections.sort(rows, ob); goTop(); } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDataSet.java 2008-09-01 13:21:36 UTC (rev 403) +++ trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDataSet.java 2008-09-02 02:19:23 UTC (rev 404) @@ -121,7 +121,7 @@ * @see com.pz.reader.ordering.OrderBy * @see com.pz.reader.ordering.OrderColumn */ - public void orderRows(final OrderBy ob) throws Exception { + public void orderRows(final OrderBy ob) { throw new UnsupportedOperationException("orderRows() is Not Implemented"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-09-01 13:21:25
|
Revision: 403 http://flatpack.svn.sourceforge.net/flatpack/?rev=403&view=rev Author: zepernick Date: 2008-09-01 13:21:36 +0000 (Mon, 01 Sep 2008) Log Message: ----------- added new option on the Parser to store the raw data of each line. Modified Paths: -------------- trunk/src/site/changes.xml Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2008-09-01 13:21:06 UTC (rev 402) +++ trunk/src/site/changes.xml 2008-09-01 13:21:36 UTC (rev 403) @@ -8,6 +8,8 @@ </properties> <body> <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <action dev="zepernick" type="change">New Parser option to log the raw line data of the record in the + DataSet object. Parser.setStoreRawDataToDataSet()</action> <action dev="zepernick" type="fix">Stopped the fixed width parser from removing leading spaces in a data element. Added the ParserUtils.rTrim() method.</action> <action dev="zepernick" type="change">Added getLong() to DataSet interface</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-09-01 13:20:57
|
Revision: 402 http://flatpack.svn.sourceforge.net/flatpack/?rev=402&view=rev Author: zepernick Date: 2008-09-01 13:21:06 +0000 (Mon, 01 Sep 2008) Log Message: ----------- added new option on the Parser to store the raw data of each line. Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/Parser.java trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java trunk/flatpack/src/main/java/net/sf/flatpack/structure/Row.java trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractDelimiterParser.java 2008-09-01 13:21:06 UTC (rev 402) @@ -190,15 +190,21 @@ row.setMdkey(mdkey.equals(FPConstants.DETAIL_ID) ? null : mdkey); // try // to limit the memory use row.setCols(columns); - row.setRowNumber(lineCount); - /** add the row to the array */ - ds.addRow(row); - + row.setRowNumber(lineCount); if (isFlagEmptyRows()) { //user has elected to have the parser flag rows that are empty row.setEmpty(ParserUtils.isListElementsEmpty(columns)); } + if (isStoreRawDataToDataSet()) { + //user told the parser to keep a copy of the raw data in the row + //WARNING potential for high memory usage here + row.setRawData(line); + } + //add the row to the array + ds.addRow(row); + + } } finally { if (br != null) { Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractFixedLengthParser.java 2008-09-01 13:21:06 UTC (rev 402) @@ -146,6 +146,11 @@ //user has elected to have the parser flag rows that are empty row.setEmpty(ParserUtils.isListElementsEmpty(row.getCols())); } + if (isStoreRawDataToDataSet()) { + //user told the parser to keep a copy of the raw data in the row + //WARNING potential for high memory usage here + row.setRawData(line); + } // add the row to the array ds.addRow(row); Modified: trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java 2008-09-01 13:21:06 UTC (rev 402) @@ -73,6 +73,8 @@ private boolean flagEmptyRows; private boolean storeRawDataToDataError; + + private boolean storeRawDataToDataSet; protected AbstractParser(final Reader dataSourceReader) { this.dataSourceReader = dataSourceReader; @@ -293,4 +295,18 @@ public void setStoreRawDataToDataError(boolean storeRawDataToDataError) { this.storeRawDataToDataError = storeRawDataToDataError; } + + /** + * @return the storeRawDataToDataSet + */ + public boolean isStoreRawDataToDataSet() { + return storeRawDataToDataSet; + } + + /** + * @param storeRawDataToDataSet the storeRawDataToDataSet to set + */ + public void setStoreRawDataToDataSet(boolean storeRawDataToDataSet) { + this.storeRawDataToDataSet = storeRawDataToDataSet; + } } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-09-01 13:21:06 UTC (rev 402) @@ -92,16 +92,16 @@ double getDouble(final String column); /** - * Returns the integer value of a specified column + * Returns the interger value of a specified column * * @param column - * Name of the column * @exception NoSuchElementException * @exception NumberFormatException - * @return int + * @return double */ int getInt(final String column); - + /** * Returns the long value of a specified column * @@ -339,4 +339,11 @@ * @return */ boolean isRowEmpty(); + + /** + * + * @return the raw data used to create this Row in the DataSet. Parser.setStoreRawDataToDataSet(true) + * must be specified before calling this method. + */ + String getRawData(); } \ No newline at end of file Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-09-01 13:21:06 UTC (rev 402) @@ -46,6 +46,7 @@ import net.sf.flatpack.structure.ColumnMetaData; import net.sf.flatpack.structure.Row; import net.sf.flatpack.util.FPConstants; +import net.sf.flatpack.util.FPException; import net.sf.flatpack.util.FPInvalidUsageException; import net.sf.flatpack.util.FPStringUtils; import net.sf.flatpack.util.ParserUtils; @@ -507,7 +508,8 @@ } /** - * @throws FPInvalidUsageException + * @throws FPInvalidUsageException Parser.isFlagEmptyRows() must be set to true before using this + * @throws FPException if cursor is on an invalid row */ public boolean isRowEmpty() { if (!parser.isFlagEmptyRows()) { @@ -516,6 +518,28 @@ throw new FPInvalidUsageException("Parser.isFlagEmptyRows(true) must be set before using isRowEmpty()"); } + if (pointer < 0) { + throw new FPException("Cursor on invalid row.. Make sure next() is called and returns true"); + } + return ((Row)rows.get(pointer)).isEmpty(); } + + /** + * @throws FPInvalidUsageException + * @throws FPException if cursor is on an invalid row + */ + public String getRawData() { + if (!parser.isStoreRawDataToDataSet()) { + //option needs to be set for this functionality + //throw an exception + throw new FPInvalidUsageException("Parser.isStoreRawDataToDataSet(true) must be set before using getRawData()"); + } + + if (pointer < 0) { + throw new FPException("Cursor on invalid row.. Make sure next() is called and returns true"); + } + + return ((Row)rows.get(pointer)).getRawData(); + } } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/Parser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/Parser.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/Parser.java 2008-09-01 13:21:06 UTC (rev 402) @@ -153,6 +153,13 @@ void setFlagEmptyRows(final boolean flagEmptyRows); /** + * @return when true, the parser will place the data of the line which failed the parse and + * place it into the DataError object. DataError.getRawData() can be called to retrieve + * the line. + */ + boolean isStoreRawDataToDataError(); + + /** * when true, the parser will place the data of the line which failed the parse and * place it into the DataError object. DataError.getRawData() can be called to retrieve * the line. @@ -160,4 +167,23 @@ * @param storeRawDataToDataError */ void setStoreRawDataToDataError(final boolean storeRawDataToDataError); + + + /** + * @return when true, the parser will place the data of the line into the DataSet object. + * DataSet.getRawData() can be called to retrieve the line. + */ + boolean isStoreRawDataToDataSet(); + + /** + * WARNING!! Setting this option has potential to cause high memory usage. + * + * when true, the parser will place the data of the line into the DataSet object. + * DataSet.getRawData() can be called to retrieve the line. + * + * @param storeRawDataToDataError + */ + void setStoreRawDataToDataSet(final boolean storeRawDataToDataError); + + } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderDelimParser.java 2008-09-01 13:21:06 UTC (rev 402) @@ -183,6 +183,11 @@ //user has elected to have the parser flag rows that are empty row.setEmpty(ParserUtils.isListElementsEmpty(columns)); } + if (isStoreRawDataToDataSet()) { + //user told the parser to keep a copy of the raw data in the row + //WARNING potential for high memory usage here + row.setRawData(line); + } return row; } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/brparse/BuffReaderFixedParser.java 2008-09-01 13:21:06 UTC (rev 402) @@ -152,6 +152,11 @@ //user has elected to have the parser flag rows that are empty row.setEmpty(ParserUtils.isListElementsEmpty(row.getCols())); } + if (isStoreRawDataToDataSet()) { + //user told the parser to keep a copy of the raw data in the row + //WARNING potential for high memory usage here + row.setRawData(line); + } return row; } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/structure/Row.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/structure/Row.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/main/java/net/sf/flatpack/structure/Row.java 2008-09-01 13:21:06 UTC (rev 402) @@ -52,6 +52,8 @@ private String mdkey; private boolean empty; + + private String rawData; /** * Constructs a new Row @@ -177,4 +179,22 @@ public void setEmpty(boolean empty) { this.empty = empty; } + + /** + * Raw data used to create the columns for the row + * + * @return the rawData + */ + public String getRawData() { + return rawData; + } + + /** + * Raw data used to create the columns for the row + * + * @param rawData the rawData to set + */ + public void setRawData(String rawData) { + this.rawData = rawData; + } } \ No newline at end of file Modified: trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java =================================================================== --- trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2008-08-31 12:43:32 UTC (rev 401) +++ trunk/flatpack/src/test/java/net/sf/flatpack/pzparser/PZParserOptsTest.java 2008-09-01 13:21:06 UTC (rev 402) @@ -125,6 +125,44 @@ de = (DataError)errors.next(); assertNull("DataError should have <null> line data...", de.getRawData()); } + + public void testStoreRawData() { + DataSet ds; + final String cols = "column1,column2,column3\r\nVAL1,VAL2,VAL3"; + Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + p.setStoreRawDataToDataSet(true); + ds = p.parse(); + ds.next(); + assertEquals("VAL1,VAL2,VAL3", ds.getRawData()); + + p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + ds = p.parse(); + ds.next(); + try { + ds.getRawData(); + fail("Should have received an FPExcpetion..."); + }catch(FPInvalidUsageException e) { + } + + } + + public void testEmptyLastColumn() { + //this was reported as a bug in the forums check to see + //if we actually have a problem + DataSet ds; + String cols = "column1,column2,column3\r\nVAL1,VAL2,"; + Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER); + ds = p.parse(); + + assertEquals(true, ds.next()); + + + cols = "column1,column2,column3\r\n\"VAL1\",\"VAL2\",\"\""; + p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', '"'); + ds = p.parse(); + + assertEquals(true, ds.next()); + } public static void main(final String[] args) { junit.textui.TestRunner.run(PZParserOptsTest.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-08-31 12:43:24
|
Revision: 401 http://flatpack.svn.sourceforge.net/flatpack/?rev=401&view=rev Author: zepernick Date: 2008-08-31 12:43:32 +0000 (Sun, 31 Aug 2008) Log Message: ----------- stopped the fixed width parser from removing leading spaces in the data element. Added the rTrim() method in the ParserUtils Modified Paths: -------------- trunk/src/site/changes.xml Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2008-08-31 12:34:49 UTC (rev 400) +++ trunk/src/site/changes.xml 2008-08-31 12:43:32 UTC (rev 401) @@ -8,6 +8,8 @@ </properties> <body> <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <action dev="zepernick" type="fix">Stopped the fixed width parser from removing leading spaces in a data element. + Added the ParserUtils.rTrim() method.</action> <action dev="zepernick" type="change">Added getLong() to DataSet interface</action> <action dev="zepernick" type="fix">Added check for duplicate column names when using file header for column names.</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-08-31 12:34:41
|
Revision: 400 http://flatpack.svn.sourceforge.net/flatpack/?rev=400&view=rev Author: zepernick Date: 2008-08-31 12:34:49 +0000 (Sun, 31 Aug 2008) Log Message: ----------- added test for rTrim() Modified Paths: -------------- trunk/flatpack/src/test/java/net/sf/flatpack/parserutils/ParserUtilsLTrimTest.java Modified: trunk/flatpack/src/test/java/net/sf/flatpack/parserutils/ParserUtilsLTrimTest.java =================================================================== --- trunk/flatpack/src/test/java/net/sf/flatpack/parserutils/ParserUtilsLTrimTest.java 2008-08-31 12:34:01 UTC (rev 399) +++ trunk/flatpack/src/test/java/net/sf/flatpack/parserutils/ParserUtilsLTrimTest.java 2008-08-31 12:34:49 UTC (rev 400) @@ -74,6 +74,18 @@ assertEquals("\t \t RemoveAll \tSpaces \t\t ", ParserUtils.lTrimKeepTabs(" \t \t RemoveAll \tSpaces \t\t ")); assertEquals("\t \t RemoveAll \tSpaces \t\t", ParserUtils.lTrimKeepTabs("\t \t RemoveAll \tSpaces \t\t")); } + + /** + * Make sure all spaces are properly removed from the end of the String + * + */ + public void testTrimTrailingSpaces() { + final String testS = " RemoveAll trailing SpacesFromMe "; + assertEquals(" RemoveAll trailing SpacesFromMe", ParserUtils.rTrim(testS)); + + assertEquals("", ParserUtils.rTrim(" ")); + assertEquals("test", ParserUtils.rTrim("test")); + } public static void main(final String[] args) { junit.textui.TestRunner.run(ParserUtilsLTrimTest.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-08-31 12:33:53
|
Revision: 399 http://flatpack.svn.sourceforge.net/flatpack/?rev=399&view=rev Author: zepernick Date: 2008-08-31 12:34:01 +0000 (Sun, 31 Aug 2008) Log Message: ----------- stopped the fixed width parser from removing leading spaces in the data element. Added the rTrim() method in the ParserUtils Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java 2008-03-18 12:31:17 UTC (rev 398) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/FixedWidthParserUtils.java 2008-08-31 12:34:01 UTC (rev 399) @@ -67,7 +67,9 @@ final ColumnMetaData colMetaDataObj = (ColumnMetaData) columnMetaData.get(i); final String tempValue = lineToParse.substring(recPosition - 1, recPosition + colMetaDataObj.getColLength() - 1); recPosition += colMetaDataObj.getColLength(); - splitResult.add(tempValue.trim()); + //make sure that we preserve leading spaces as they most likely are there intentionally. + //This was previously issuing a trim() + splitResult.add(ParserUtils.rTrim(tempValue)); } return splitResult; @@ -85,7 +87,7 @@ */ public static String getCMDKey(final Map columnMD, final String line) { if (columnMD.size() == 1) { - // no <RECORD> elments were specifed for this parse, just return the + // no <RECORD> elements were specified for this parse, just return the // detail id return FPConstants.DETAIL_ID; } @@ -131,7 +133,7 @@ */ public static String getCMDKey(final MetaData columnMD, final String line) { if (!columnMD.isAnyRecordFormatSpecified()) { - // no <RECORD> elments were specifed for this parse, just return the + // no <RECORD> elements were specified for this parse, just return the // detail id return FPConstants.DETAIL_ID; } Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java 2008-03-18 12:31:17 UTC (rev 398) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java 2008-08-31 12:34:01 UTC (rev 399) @@ -243,7 +243,7 @@ } /** - * Removes empty space from the begining of a string + * Removes empty space from the beginning of a string * * @param value - * to be trimmed @@ -267,9 +267,10 @@ return trimmed; } + /** - * Removes empty space from the begining of a string, except for tabs + * Removes empty space from the beginning of a string, except for tabs * * @param value - * to be trimmed @@ -293,7 +294,32 @@ return trimmed; } + + /** + * Removes empty space from the end of a string + * + * @param value - + * to be trimmed + * @return String + */ + public static String rTrim(final String value) { + if (value == null) { + return null; + } + String trimmed = value; + int offset = value.length() - 1; + while (offset > -1 && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t')) { + offset--; + } + + if (offset < value.length() - 1) { + trimmed = value.substring(0,offset + 1); + } + + return trimmed; + } + /** * Will return a null if the String is empty returns the * trimmed string otherwise. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-03-18 12:31:12
|
Revision: 398 http://flatpack.svn.sourceforge.net/flatpack/?rev=398&view=rev Author: zepernick Date: 2008-03-18 05:31:17 -0700 (Tue, 18 Mar 2008) Log Message: ----------- added getLong() to DataSet Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-03-18 12:30:58 UTC (rev 397) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DataSet.java 2008-03-18 12:31:17 UTC (rev 398) @@ -92,15 +92,26 @@ double getDouble(final String column); /** - * Returns the interger value of a specified column + * Returns the integer value of a specified column * * @param column - * Name of the column * @exception NoSuchElementException * @exception NumberFormatException - * @return double + * @return int */ int getInt(final String column); + + /** + * Returns the long value of a specified column + * + * @param column - + * Name of the column + * @exception NoSuchElementException + * @exception NumberFormatException + * @return long + */ + long getLong(final String column); /** * Returns the date value of a specified column. This assumes the date is in Modified: trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-03-18 12:30:58 UTC (rev 397) +++ trunk/flatpack/src/main/java/net/sf/flatpack/DefaultDataSet.java 2008-03-18 12:31:17 UTC (rev 398) @@ -235,7 +235,17 @@ return Integer.parseInt(s); } + + public long getLong(final String column) { + final String s = getStringValue(column); + if (!strictNumericParse) { + return Long.parseLong(ParserUtils.stripNonLongChars(s)); + } + + return Long.parseLong(s); + } + /* * (non-Javadoc) * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-03-18 12:31:02
|
Revision: 397 http://flatpack.svn.sourceforge.net/flatpack/?rev=397&view=rev Author: zepernick Date: 2008-03-18 05:30:58 -0700 (Tue, 18 Mar 2008) Log Message: ----------- added getLong() to DataSet Modified Paths: -------------- trunk/src/site/changes.xml Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2008-02-13 17:48:24 UTC (rev 396) +++ trunk/src/site/changes.xml 2008-03-18 12:30:58 UTC (rev 397) @@ -8,6 +8,7 @@ </properties> <body> <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <action dev="zepernick" type="change">Added getLong() to DataSet interface</action> <action dev="zepernick" type="fix">Added check for duplicate column names when using file header for column names.</action> <action dev="zepernick" type="fix">Applied patch from Dirk Olmes to prevent duplicate This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-02-13 17:48:32
|
Revision: 396 http://flatpack.svn.sourceforge.net/flatpack/?rev=396&view=rev Author: zepernick Date: 2008-02-13 09:48:24 -0800 (Wed, 13 Feb 2008) Log Message: ----------- fixed bug on duplicate check Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java 2008-02-13 17:42:21 UTC (rev 395) +++ trunk/flatpack/src/main/java/net/sf/flatpack/xml/MapParser.java 2008-02-13 17:48:24 UTC (rev 396) @@ -218,6 +218,7 @@ } cmd.setColName(columnName); + columnNames.add(columnName); // check to see if the column length can be set if (xmlColumn.getAttributeValue("length") != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-02-13 17:42:17
|
Revision: 395 http://flatpack.svn.sourceforge.net/flatpack/?rev=395&view=rev Author: zepernick Date: 2008-02-13 09:42:21 -0800 (Wed, 13 Feb 2008) Log Message: ----------- prevent duplicate column names when using column names from file header Modified Paths: -------------- trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java Modified: trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java =================================================================== --- trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java 2008-02-13 17:36:59 UTC (rev 394) +++ trunk/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java 2008-02-13 17:42:21 UTC (rev 395) @@ -402,11 +402,11 @@ for (int i = 0; i < lineData.size(); i++) { final ColumnMetaData cmd = new ColumnMetaData(); cmd.setColName((String) lineData.get(i)); - if (dupCheck.contains(cmd)) { - throw new FPException("Duplicate Column Name In File: " + cmd); + if (dupCheck.contains(cmd.getColName())) { + throw new FPException("Duplicate Column Name In File: " + cmd.getColName()); } results.add(cmd); - dupCheck.add(cmd); + dupCheck.add(cmd.getColName()); } return new MetaData(results, buidColumnIndexMap(results, p)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zep...@us...> - 2008-02-13 17:37:40
|
Revision: 394 http://flatpack.svn.sourceforge.net/flatpack/?rev=394&view=rev Author: zepernick Date: 2008-02-13 09:36:59 -0800 (Wed, 13 Feb 2008) Log Message: ----------- prevent duplicate column names when using column names from file header Modified Paths: -------------- trunk/src/site/changes.xml Modified: trunk/src/site/changes.xml =================================================================== --- trunk/src/site/changes.xml 2008-02-13 17:35:41 UTC (rev 393) +++ trunk/src/site/changes.xml 2008-02-13 17:36:59 UTC (rev 394) @@ -8,6 +8,8 @@ </properties> <body> <release version="3.2.0-SNAPSHOT" date="2007-11-17" description="New parse options"> + <action dev="zepernick" type="fix">Added check for duplicate column names when using file + header for column names.</action> <action dev="zepernick" type="fix">Applied patch from Dirk Olmes to prevent duplicate column names in the XML mapping. IllegalArgumentException is now thrown if a duplicate column name exists in the map. Thanks Dirk...</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |