From: <be...@us...> - 2006-10-27 14:14:51
|
Revision: 143 http://svn.sourceforge.net/pzfilereader/?rev=143&view=rev Author: benoitx Date: 2006-10-27 07:14:36 -0700 (Fri, 27 Oct 2006) Log Message: ----------- General clean Up by Eclipse (cleanup, organise imports and format). Modified Paths: -------------- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractFixedLengthPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBDelimiterPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBFixedLengthPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataError.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultDataSet.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultPZParserFactory.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DelimiterPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/FixedLengthPZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/InitialisationException.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/LargeDataSet.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/ordering/OrderBy.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/structure/Row.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/util/FixedWidthParserUtils.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/util/PZConstants.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/util/ParserUtils.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/xml/PZMapParser.java trunk/PZFileReader/src/main/java/net/sf/pzfilereader/xml/XMLRecordElement.java Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractDelimiterPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -26,22 +55,24 @@ private boolean ignoreFirstRecord = false; - public AbstractDelimiterPZParser(InputStream dataSourceStream, String dataDefinition, char delimiter, char qualifier, - boolean ignoreFirstRecord) { + public AbstractDelimiterPZParser(final InputStream dataSourceStream, final String dataDefinition, final char delimiter, + final char qualifier, final boolean ignoreFirstRecord) { super(dataSourceStream, dataDefinition); this.delimiter = delimiter; this.qualifier = qualifier; this.ignoreFirstRecord = ignoreFirstRecord; } - public AbstractDelimiterPZParser(File dataSource, char delimiter, char qualifier, boolean ignoreFirstRecord) { + public AbstractDelimiterPZParser(final File dataSource, final char delimiter, final char qualifier, + final boolean ignoreFirstRecord) { super(dataSource); this.delimiter = delimiter; this.qualifier = qualifier; this.ignoreFirstRecord = ignoreFirstRecord; } - public AbstractDelimiterPZParser(InputStream dataSourceStream, char delimiter, char qualifier, boolean ignoreFirstRecord) { + public AbstractDelimiterPZParser(final InputStream dataSourceStream, final char delimiter, final char qualifier, + final boolean ignoreFirstRecord) { super(dataSourceStream); this.delimiter = delimiter; this.qualifier = qualifier; @@ -51,13 +82,15 @@ public IDataSet doParse() { try { if (getDataSourceStream() != null) { - return doDelimitedFile(getDataSourceStream(), getDelimiter(), getQualifier(), isIgnoreFirstRecord(), shouldCreateMDFromFile()); + return doDelimitedFile(getDataSourceStream(), getDelimiter(), getQualifier(), isIgnoreFirstRecord(), + shouldCreateMDFromFile()); } else { InputStream stream = null; try { stream = ParserUtils.createInputStream(getDataSource()); - return doDelimitedFile(stream, getDelimiter(), getQualifier(), isIgnoreFirstRecord(), shouldCreateMDFromFile()); - } catch (Exception e) { + return doDelimitedFile(stream, getDelimiter(), getQualifier(), isIgnoreFirstRecord(), + shouldCreateMDFromFile()); + } catch (final Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { @@ -66,23 +99,23 @@ } } } - } catch (FileNotFoundException e) { + } catch (final FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); - } catch (Exception e) { + } catch (final Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } - + protected abstract boolean shouldCreateMDFromFile(); protected char getDelimiter() { return delimiter; } - protected void setDelimiter(char delimiter) { + protected void setDelimiter(final char delimiter) { this.delimiter = delimiter; } @@ -90,7 +123,7 @@ return ignoreFirstRecord; } - protected void setIgnoreFirstRecord(boolean ignoreFirstRecord) { + protected void setIgnoreFirstRecord(final boolean ignoreFirstRecord) { this.ignoreFirstRecord = ignoreFirstRecord; } @@ -98,7 +131,7 @@ return qualifier; } - protected void setQualifier(char qualifier) { + protected void setQualifier(final char qualifier) { this.qualifier = qualifier; } @@ -117,7 +150,7 @@ InputStreamReader isr = null; BufferedReader br = null; - DefaultDataSet ds = new DefaultDataSet(getColumnMD()); + final DefaultDataSet ds = new DefaultDataSet(getColumnMD()); try { // get the total column count // columnCount = columnMD.size(); @@ -136,7 +169,7 @@ while ((line = br.readLine()) != null) { lineCount++; /** empty line skip past it */ - String trimmed = line.trim(); + final String trimmed = line.trim(); if (!processingMultiLine && trimmed.length() == 0) { continue; } @@ -177,7 +210,7 @@ // line break processingMultiLine = false; if (trimmedLineData.length() > 0) { // + would always be - // true surely.... + // true surely.... lineData += "\r\n"; } lineData += line; @@ -185,8 +218,8 @@ // check to see if this is the last line of the record // looking for a qualifier followed by a delimiter if (trimmedLineData.length() > 0) { // + here again, - // this should - // always be true... + // this should + // always be true... lineData += "\r\n"; } lineData += line; Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractFixedLengthPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractFixedLengthPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractFixedLengthPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -23,19 +52,19 @@ */ public abstract class AbstractFixedLengthPZParser extends AbstractPZParser { - protected AbstractFixedLengthPZParser(File dataSource, String dataDefinition) { + protected AbstractFixedLengthPZParser(final File dataSource, final String dataDefinition) { super(dataSource, dataDefinition); } - protected AbstractFixedLengthPZParser(File dataSource) { + protected AbstractFixedLengthPZParser(final File dataSource) { super(dataSource); } - protected AbstractFixedLengthPZParser(InputStream dataSourceStream, String dataDefinition) { + protected AbstractFixedLengthPZParser(final InputStream dataSourceStream, final String dataDefinition) { super(dataSourceStream, dataDefinition); } - protected AbstractFixedLengthPZParser(InputStream dataSourceStream) { + protected AbstractFixedLengthPZParser(final InputStream dataSourceStream) { super(dataSourceStream); } @@ -48,7 +77,7 @@ stream = ParserUtils.createInputStream(getDataSource()); try { return doFixedLengthFile(stream); - } catch (Exception e) { + } catch (final Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { @@ -57,10 +86,10 @@ } } } - } catch (FileNotFoundException e) { + } catch (final FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); - } catch (Exception e) { + } catch (final Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -78,7 +107,7 @@ InputStreamReader isr = null; BufferedReader br = null; - DefaultDataSet ds = new DefaultDataSet(getColumnMD()); + final DefaultDataSet ds = new DefaultDataSet(getColumnMD()); try { final Map recordLengths = ParserUtils.calculateRecordLengths(getColumnMD()); Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/AbstractPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -27,20 +56,20 @@ private File dataSource = null; - protected AbstractPZParser(File dataSource) { + protected AbstractPZParser(final File dataSource) { this.dataSource = dataSource; } - protected AbstractPZParser(InputStream dataSourceStream) { + protected AbstractPZParser(final InputStream dataSourceStream) { this.dataSourceStream = dataSourceStream; } - protected AbstractPZParser(File dataSource, String dataDefinition) { + protected AbstractPZParser(final File dataSource, final String dataDefinition) { this.dataSource = dataSource; this.dataDefinition = dataDefinition; } - protected AbstractPZParser(InputStream dataSourceStream, String dataDefinition) { + protected AbstractPZParser(final InputStream dataSourceStream, final String dataDefinition) { this.dataSourceStream = dataSourceStream; this.dataDefinition = dataDefinition; } @@ -59,7 +88,7 @@ * * @see net.sf.pzfilereader.PZParser#setHandlingShortLines(boolean) */ - public void setHandlingShortLines(boolean handleShortLines) { + public void setHandlingShortLines(final boolean handleShortLines) { this.handlingShortLines = handleShortLines; } @@ -89,7 +118,7 @@ return initialised; } - protected void setInitialised(boolean initialised) { + protected void setInitialised(final boolean initialised) { this.initialised = initialised; } @@ -97,7 +126,7 @@ return dataDefinition; } - protected void setDataDefinition(String dataDefinition) { + protected void setDataDefinition(final String dataDefinition) { this.dataDefinition = dataDefinition; } @@ -105,7 +134,7 @@ return dataSource; } - protected void setDataSource(File dataSource) { + protected void setDataSource(final File dataSource) { this.dataSource = dataSource; } @@ -113,7 +142,7 @@ return dataSourceStream; } - protected void setDataSourceStream(InputStream dataSourceStream) { + protected void setDataSourceStream(final InputStream dataSourceStream) { this.dataSourceStream = dataSourceStream; } @@ -133,8 +162,8 @@ * int 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) { - final DataError de = new DataError(errorDesc,lineNo,errorLevel); + final DataError de = new DataError(errorDesc, lineNo, errorLevel); ds.addError(de); } - + } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBDelimiterPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBDelimiterPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBDelimiterPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -24,8 +53,8 @@ private Connection con; - public DBDelimiterPZParser(Connection con, InputStream dataSourceStream, String dataDefinition, char delimiter, - char qualifier, boolean ignoreFirstRecord) { + public DBDelimiterPZParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition, + final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { super(dataSourceStream, dataDefinition, delimiter, qualifier, ignoreFirstRecord); this.con = con; } @@ -69,10 +98,10 @@ // read in the fixed length file and construct the DataSet object // doFixedLengthFile(dataSourceStream); setInitialised(true); - } catch (SQLException e) { + } catch (final SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); - } catch (FileNotFoundException e) { + } catch (final FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { @@ -83,17 +112,13 @@ if (stmt != null) { stmt.close(); } - } catch (SQLException e) { + } catch (final SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } - public IDataSet doParse() { - return null; - } - protected boolean shouldCreateMDFromFile() { return true; } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBFixedLengthPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBFixedLengthPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DBFixedLengthPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -30,7 +59,7 @@ this.con = con; } - public DBFixedLengthPZParser(Connection con, File dataSource, String dataDefinition) { + public DBFixedLengthPZParser(final Connection con, final File dataSource, final String dataDefinition) { super(dataSource, dataDefinition); this.con = con; } @@ -74,10 +103,10 @@ // read in the fixed length file and construct the DataSet object // doFixedLengthFile(dataSourceStream); setInitialised(true); - } catch (SQLException e) { + } catch (final SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); - } catch (FileNotFoundException e) { + } catch (final FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { @@ -88,7 +117,7 @@ if (stmt != null) { stmt.close(); } - } catch (SQLException e) { + } catch (final SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataError.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataError.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataError.java 2006-10-27 14:14:36 UTC (rev 143) @@ -33,9 +33,7 @@ */ private int errorLevel = 0; - - - public DataError(String errorDesc, int lineNo, int errorLevel) { + public DataError(final String errorDesc, final int lineNo, final int errorLevel) { this.errorDesc = errorDesc; this.lineNo = lineNo; this.errorLevel = errorLevel; @@ -43,7 +41,7 @@ /** * @deprecated should use the ctor with fields - * + * */ public DataError() { } @@ -80,7 +78,7 @@ * * @param errorDesc * The errorDesc to set - * @deprecated the DataError should be immutable (i.e. no Set method) + * @deprecated the DataError should be immutable (i.e. no Set method) */ public void setErrorDesc(final String errorDesc) { this.errorDesc = errorDesc; @@ -91,7 +89,7 @@ * * @param errorLevel * The errorLevel to set - * @deprecated the DataError should be immutable (i.e. no Set method) + * @deprecated the DataError should be immutable (i.e. no Set method) */ public void setErrorLevel(final int errorLevel) { this.errorLevel = errorLevel; @@ -102,7 +100,7 @@ * * @param lineNo * The lineNo to set - * @deprecated the DataError should be immutable (i.e. no Set method) + * @deprecated the DataError should be immutable (i.e. no Set method) */ public void setLineNo(final int lineNo) { this.lineNo = lineNo; Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DataSet.java 2006-10-27 14:14:36 UTC (rev 143) @@ -31,7 +31,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.NoSuchElementException; import net.sf.pzfilereader.ordering.OrderBy; import net.sf.pzfilereader.structure.ColumnMetaData; @@ -391,7 +390,6 @@ .charAt(0) : 0, ignoreFirstRecord, handleShortLines); } - /** * Constructs a new DataSet using the PZMAP XML file layout method. This is * used for a DELIMITED text file. esacpe sequence reference: \n newline @@ -421,7 +419,7 @@ this(ParserUtils.createInputStream(pzmapXML), ParserUtils.createInputStream(dataSource), delimiter, qualifier, ignoreFirstRecord, handleShortLines); } - + /** * New constructor based on InputStream. Constructs a new DataSet using the * PZMAP XML file layout method. This is used for a DELIMITED text file. @@ -677,7 +675,7 @@ } } - //int recPosition = 1; + // int recPosition = 1; final Row row = new Row(); row.setMdkey(mdkey.equals(PZConstants.DETAIL_ID) ? null : mdkey); // try @@ -685,12 +683,13 @@ row.addColumn(FixedWidthParserUtils.splitFixedText(cmds, line)); // to limit the memory use // Build the columns for the row - //for (int i = 0; i < cmds.size(); i++) { - // final String tempValue = line.substring(recPosition - 1, recPosition - // + (((ColumnMetaData) cmds.get(i)).getColLength() - 1)); - // recPosition += ((ColumnMetaData) cmds.get(i)).getColLength(); - // row.addColumn(tempValue.trim()); - // } + // for (int i = 0; i < cmds.size(); i++) { + // final String tempValue = line.substring(recPosition - 1, + // recPosition + // + (((ColumnMetaData) cmds.get(i)).getColLength() - 1)); + // recPosition += ((ColumnMetaData) cmds.get(i)).getColLength(); + // row.addColumn(tempValue.trim()); + // } row.setRowNumber(lineCount); // add the row to the array rows.add(row); @@ -742,7 +741,7 @@ while ((line = br.readLine()) != null) { lineCount++; /** empty line skip past it */ - String trimmed = line.trim(); + final String trimmed = line.trim(); if (!processingMultiLine && trimmed.length() == 0) { continue; } @@ -781,14 +780,17 @@ // it is safe to assume we have reached the end of the // line break processingMultiLine = false; - if (trimmedLineData.length() > 0) { //+ would always be true surely.... + if (trimmedLineData.length() > 0) { // + would always be + // true surely.... lineData += "\r\n"; } lineData += line; } else { // check to see if this is the last line of the record // looking for a qualifier followed by a delimiter - if (trimmedLineData.length() > 0) { //+ here again, this should always be true... + if (trimmedLineData.length() > 0) { // + here again, + // this should + // always be true... lineData += "\r\n"; } lineData += line; @@ -908,21 +910,27 @@ // row.setValue(ParserUtils.findColumn(columnName, cmds), value); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#goTop() */ public void goTop() { pointer = -1; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#goBottom() */ public void goBottom() { pointer = rows.size() - 1; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#next() */ public boolean next() { @@ -933,7 +941,9 @@ return false; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#previous() */ public boolean previous() { @@ -944,7 +954,9 @@ return true; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getString(java.lang.String) */ public String getString(final String column) { @@ -972,7 +984,9 @@ return s; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getDouble(java.lang.String) */ public double getDouble(final String column) { @@ -1006,7 +1020,9 @@ return Double.parseDouble(newString.toString()); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getInt(java.lang.String) */ public int getInt(final String column) { @@ -1040,7 +1056,9 @@ return Integer.parseInt(newString.toString()); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String) */ public Date getDate(final String column) throws ParseException { @@ -1054,8 +1072,11 @@ return sdf.parse(s); } - /* (non-Javadoc) - * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String, java.text.SimpleDateFormat) + /* + * (non-Javadoc) + * + * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String, + * java.text.SimpleDateFormat) */ public Date getDate(final String column, final SimpleDateFormat sdf) throws ParseException { final Row row = (Row) rows.get(pointer); @@ -1067,7 +1088,9 @@ return sdf.parse(s); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getColumns() */ public String[] getColumns() { @@ -1087,7 +1110,9 @@ return array; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getColumns(java.lang.String) */ public String[] getColumns(final String recordID) { @@ -1105,14 +1130,18 @@ return array; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getRowNo() */ public int getRowNo() { return ((Row) rows.get(pointer)).getRowNumber(); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getErrors() */ public List getErrors() { @@ -1138,7 +1167,9 @@ errors.add(de); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#remove() */ public void remove() { @@ -1146,7 +1177,9 @@ pointer--; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getIndex() */ public int getIndex() { @@ -1183,14 +1216,18 @@ return rowID.equals(recordID); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getRowCount() */ public int getRowCount() { return rows.size(); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getErrorCount() */ public int getErrorCount() { @@ -1201,7 +1238,9 @@ return 0; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#isAnError(int) */ public boolean isAnError(final int lineNo) { @@ -1213,7 +1252,9 @@ return false; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#orderRows(net.sf.pzfilereader.ordering.OrderBy) */ public void orderRows(final OrderBy ob) throws Exception { @@ -1326,7 +1367,9 @@ this.columnMD = columnMD; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see net.sf.pzfilereader.IDataSet#getRows() */ public List getRows() { Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultDataSet.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultDataSet.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultDataSet.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -23,9 +52,9 @@ * */ public class DefaultDataSet implements IDataSet { - private List rows = new ArrayList(); + private final List rows = new ArrayList(); - private List errors = new ArrayList(); + private final List errors = new ArrayList(); /** Pointer for the current row in the array we are on */ private int pointer = -1; @@ -44,15 +73,15 @@ private Map columnMD; - public DefaultDataSet(Map columnMD2) { + public DefaultDataSet(final Map columnMD2) { this.columnMD = columnMD2; } - public void addRow(Row row) { + public void addRow(final Row row) { rows.add(row); } - public void addError(DataError dataError) { + public void addError(final DataError dataError) { errors.add(dataError); } @@ -83,7 +112,7 @@ * * @see net.sf.pzfilereader.IDataSet#getColumns(java.lang.String) */ - public String[] getColumns(String recordID) { + public String[] getColumns(final String recordID) { String[] array = null; if (columnMD != null) { @@ -103,7 +132,7 @@ * * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String) */ - public Date getDate(String column) throws ParseException { + public Date getDate(final String column) throws ParseException { final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); final Row row = (Row) rows.get(pointer); final String s = row.getValue(ParserUtils.getColumnIndex(row.getMdkey(), columnMD, column)); @@ -116,7 +145,7 @@ * @see net.sf.pzfilereader.IDataSet#getDate(java.lang.String, * java.text.SimpleDateFormat) */ - public Date getDate(String column, SimpleDateFormat sdf) throws ParseException { + public Date getDate(final String column, final SimpleDateFormat sdf) throws ParseException { final Row row = (Row) rows.get(pointer); final String s = row.getValue(ParserUtils.getColumnIndex(row.getMdkey(), columnMD, column)); return sdf.parse(s); @@ -127,7 +156,7 @@ * * @see net.sf.pzfilereader.IDataSet#getDouble(java.lang.String) */ - public double getDouble(String column) { + public double getDouble(final String column) { final StringBuffer newString = new StringBuffer(); final Row row = (Row) rows.get(pointer); @@ -190,7 +219,7 @@ * * @see net.sf.pzfilereader.IDataSet#getInt(java.lang.String) */ - public int getInt(String column) { + public int getInt(final String column) { final StringBuffer newString = new StringBuffer(); final Row row = (Row) rows.get(pointer); final String s = row.getValue(ParserUtils.getColumnIndex(row.getMdkey(), columnMD, column)); @@ -249,7 +278,7 @@ * * @see net.sf.pzfilereader.IDataSet#getString(java.lang.String) */ - public String getString(String column) { + public String getString(final String column) { final Row row = (Row) rows.get(pointer); final String s = row.getValue(ParserUtils.getColumnIndex(row.getMdkey(), columnMD, column)); @@ -294,7 +323,7 @@ * * @see net.sf.pzfilereader.IDataSet#isAnError(int) */ - public boolean isAnError(int lineNo) { + public boolean isAnError(final int lineNo) { for (int i = 0; i < errors.size(); i++) { if (((DataError) errors.get(i)).getLineNo() == lineNo && ((DataError) errors.get(i)).getErrorLevel() > 1) { return true; @@ -321,7 +350,7 @@ * * @see net.sf.pzfilereader.IDataSet#orderRows(net.sf.pzfilereader.ordering.OrderBy) */ - public void orderRows(OrderBy ob) throws Exception { + public void orderRows(final OrderBy ob) throws Exception { // PZ try to handle other <records> by sending them to // the bottom of the sort // if (columnMD.size() > 1) { @@ -419,7 +448,7 @@ pointer--; } - void setColumnMD(Map columnMD) { + void setColumnMD(final Map columnMD) { this.columnMD = columnMD; } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultPZParserFactory.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultPZParserFactory.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DefaultPZParserFactory.java 2006-10-27 14:14:36 UTC (rev 143) @@ -53,7 +53,7 @@ * @see net.sf.pzfilereader.PZParserFactory#newFixedWidthParser(java.sql.Connection, * java.io.File, java.lang.String) */ - public PZParser newFixedLengthParser(Connection con, File dataSource, String dataDefinition) { + public PZParser newFixedLengthParser(final Connection con, final File dataSource, final String dataDefinition) { return new DBFixedLengthPZParser(con, dataSource, dataDefinition); } @@ -63,7 +63,7 @@ * @see net.sf.pzfilereader.PZParserFactory#newFixedWidthParser(java.sql.Connection, * java.io.InputStream, java.lang.String) */ - public PZParser newFixedLengthParser(Connection con, InputStream dataSourceStream, String dataDefinition) { + public PZParser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) { return new DBFixedLengthPZParser(con, dataSourceStream, dataDefinition); } @@ -73,7 +73,7 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.io.File, * java.io.File) */ - public PZParser newFixedLengthParser(File pzmapXML, File dataSource) { + public PZParser newFixedLengthParser(final File pzmapXML, final File dataSource) { return new FixedLengthPZParser(pzmapXML, dataSource); } @@ -83,7 +83,7 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.io.InputStream, * java.io.InputStream) */ - public PZParser newFixedLengthParser(InputStream pzmapXMLStream, InputStream dataSourceStream) { + public PZParser newFixedLengthParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream) { return new FixedLengthPZParser(pzmapXMLStream, dataSourceStream); } @@ -93,8 +93,8 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.sql.Connection, * java.io.InputStream, java.lang.String, char, char, boolean) */ - public PZParser newDelimitedParser(Connection con, InputStream dataSourceStream, String dataDefinition, char delimiter, - char qualifier, boolean ignoreFirstRecord) { + public PZParser newDelimitedParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition, + final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { return new DBDelimiterPZParser(con, dataSourceStream, dataDefinition, delimiter, qualifier, ignoreFirstRecord); } @@ -104,7 +104,8 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.io.File, * java.io.File, char, char, boolean) */ - public PZParser newDelimitedParser(File pzmapXML, File dataSource, char delimiter, char qualifier, boolean ignoreFirstRecord) { + public PZParser newDelimitedParser(final File pzmapXML, final File dataSource, final char delimiter, final char qualifier, + final boolean ignoreFirstRecord) { return new DelimiterPZParser(pzmapXML, dataSource, delimiter, qualifier, ignoreFirstRecord); } @@ -114,8 +115,8 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.io.InputStream, * java.io.InputStream, char, char, boolean) */ - public PZParser newDelimitedParser(InputStream pzmapXMLStream, InputStream dataSourceStream, char delimiter, char qualifier, - boolean ignoreFirstRecord) { + public PZParser newDelimitedParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream, + final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { return new DelimiterPZParser(pzmapXMLStream, dataSourceStream, delimiter, qualifier, ignoreFirstRecord); } @@ -125,7 +126,7 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.io.File, char, * char) */ - public PZParser newDelimitedParser(File dataSource, char delimiter, char qualifier) { + public PZParser newDelimitedParser(final File dataSource, final char delimiter, final char qualifier) { return new DelimiterPZParser(dataSource, delimiter, qualifier, false); } @@ -135,7 +136,7 @@ * @see net.sf.pzfilereader.PZParserFactory#newParser(java.io.InputStream, * char, char) */ - public PZParser newDelimitedParser(InputStream dataSourceStream, char delimiter, char qualifier) { + public PZParser newDelimitedParser(final InputStream dataSourceStream, final char delimiter, final char qualifier) { return new DelimiterPZParser(dataSourceStream, delimiter, qualifier, false); } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DelimiterPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DelimiterPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/DelimiterPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -21,22 +50,24 @@ private File pzmapXML = null; - public DelimiterPZParser(File pzmapXML, File dataSource, char delimiter, char qualifier, boolean ignoreFirstRecord) { + public DelimiterPZParser(final File pzmapXML, final File dataSource, final char delimiter, final char qualifier, + final boolean ignoreFirstRecord) { super(dataSource, delimiter, qualifier, ignoreFirstRecord); this.pzmapXML = pzmapXML; } - public DelimiterPZParser(InputStream pzmapXMLStream, InputStream dataSourceStream, char delimiter, char qualifier, - boolean ignoreFirstRecord) { + public DelimiterPZParser(final InputStream pzmapXMLStream, final InputStream dataSourceStream, final char delimiter, + final char qualifier, final boolean ignoreFirstRecord) { super(dataSourceStream, delimiter, qualifier, ignoreFirstRecord); this.pzmapXMLStream = pzmapXMLStream; } - public DelimiterPZParser(File dataSource, char delimiter, char qualifier, boolean ignoreFirstRecord) { + public DelimiterPZParser(final File dataSource, final char delimiter, final char qualifier, final boolean ignoreFirstRecord) { super(dataSource, delimiter, qualifier, ignoreFirstRecord); } - public DelimiterPZParser(InputStream dataSourceStream, char delimiter, char qualifier, boolean ignoreFirstRecord) { + public DelimiterPZParser(final InputStream dataSourceStream, final char delimiter, final char qualifier, + final boolean ignoreFirstRecord) { super(dataSourceStream, delimiter, qualifier, ignoreFirstRecord); } @@ -45,7 +76,7 @@ if (pzmapXMLStream != null) { setColumnMD(PZMapParser.parse(pzmapXMLStream)); } else if (pzmapXML != null) { - InputStream stream = ParserUtils.createInputStream(pzmapXML); + final InputStream stream = ParserUtils.createInputStream(pzmapXML); try { setColumnMD(PZMapParser.parse(stream)); } finally { @@ -55,9 +86,9 @@ } } setInitialised(true); - } catch (JDOMException e) { + } catch (final JDOMException e) { throw new InitialisationException(e); - } catch (IOException e) { + } catch (final IOException e) { throw new InitialisationException(e); } } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/FixedLengthPZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/FixedLengthPZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/FixedLengthPZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,5 +1,34 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; @@ -26,7 +55,7 @@ this.pzmapXMLStream = pzmapXMLStream; } - public FixedLengthPZParser(File pzmapXML, File dataSource) { + public FixedLengthPZParser(final File pzmapXML, final File dataSource) { super(dataSource); this.pzmapXML = pzmapXML; } @@ -36,7 +65,7 @@ if (pzmapXMLStream != null) { setColumnMD(PZMapParser.parse(pzmapXMLStream)); } else { - InputStream stream = ParserUtils.createInputStream(pzmapXML); + final InputStream stream = ParserUtils.createInputStream(pzmapXML); try { setColumnMD(PZMapParser.parse(stream)); } finally { @@ -45,9 +74,9 @@ } } } - } catch (JDOMException e) { + } catch (final JDOMException e) { throw new InitialisationException(e); - } catch (IOException e) { + } catch (final IOException e) { throw new InitialisationException(e); } } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/InitialisationException.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/InitialisationException.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/InitialisationException.java 2006-10-27 14:14:36 UTC (rev 143) @@ -1,11 +1,40 @@ -/** +/* + * ObjectLab, http://www.objectlab.co.uk/open is supporting PZFileReader. * + * Based in London, we are world leaders in the design and development + * of bespoke applications for the securities financing markets. + * + * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> + * ___ _ _ _ _ _ + * / _ \| |__ (_) ___ ___| |_| | __ _| |__ + * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ + * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | + * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ + * |__/ + * + * www.ObjectLab.co.uk + * + * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $ + * + * Copyright 2006 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package net.sf.pzfilereader; /** * @author xhensevb - * + * */ public class InitialisationException extends RuntimeException { private static final long serialVersionUID = -4181701730609348676L; @@ -19,14 +48,14 @@ /** * @param message */ - public InitialisationException(String message) { + public InitialisationException(final String message) { super(message); } /** * @param cause */ - public InitialisationException(Throwable cause) { + public InitialisationException(final Throwable cause) { super(cause); } @@ -34,7 +63,7 @@ * @param message * @param cause */ - public InitialisationException(String message, Throwable cause) { + public InitialisationException(final String message, final Throwable cause) { super(message, cause); } } Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/LargeDataSet.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/LargeDataSet.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/LargeDataSet.java 2006-10-27 14:14:36 UTC (rev 143) @@ -23,7 +23,6 @@ import java.util.Map; import net.sf.pzfilereader.ordering.OrderBy; -import net.sf.pzfilereader.structure.ColumnMetaData; import net.sf.pzfilereader.structure.Row; import net.sf.pzfilereader.util.FixedWidthParserUtils; import net.sf.pzfilereader.util.PZConstants; @@ -405,7 +404,7 @@ * also close out the readers used to read the file in. */ public void freeMemory() { - //super.freeMemory(); + // super.freeMemory(); ParserUtils.closeReader(br); ParserUtils.closeReader(isr); @@ -430,7 +429,7 @@ /** loop through each line in the file */ while ((line = br.readLine()) != null) { lineCount++; - String trimmed = line.trim(); + final String trimmed = line.trim(); /** empty line skip past it */ if (!processingMultiLine && trimmed.length() == 0) { continue; @@ -569,13 +568,14 @@ private boolean readNextFixedLen() throws Exception { String line = null; - //final int aLineCount = 0; // +++++++++++++++++++++++++++++++++ Paul + // final int aLineCount = 0; // +++++++++++++++++++++++++++++++++ Paul // this does not seem incremented afaLineCountt all... - //******************************************************************** - //Good point, and it is being used to report line errors. Looks like a bug. - //Should be using lineCount - //PZ - + // ******************************************************************** + // Good point, and it is being used to report line errors. Looks like a + // bug. + // Should be using lineCount + // PZ + boolean readRecordOk = false; if (getRows() == null) { @@ -621,19 +621,20 @@ } } - //int recPosition = 1; + // int recPosition = 1; final Row row = new Row(); row.setMdkey(mdkey.equals("detail") ? null : mdkey); // try to // limit the memory use - + // Build the columns for the row row.addColumn(FixedWidthParserUtils.splitFixedText(cmds, line)); - //for (int i = 0; i < cmds.size(); i++) { - // final String tempValue = line.substring(recPosition - 1, recPosition - // + (((ColumnMetaData) cmds.get(i)).getColLength() - 1)); - // recPosition += ((ColumnMetaData) cmds.get(i)).getColLength(); - // row.addColumn(tempValue.trim()); - // } + // for (int i = 0; i < cmds.size(); i++) { + // final String tempValue = line.substring(recPosition - 1, + // recPosition + // + (((ColumnMetaData) cmds.get(i)).getColLength() - 1)); + // recPosition += ((ColumnMetaData) cmds.get(i)).getColLength(); + // row.addColumn(tempValue.trim()); + // } row.setRowNumber(this.lineCount); // add the row to the array getRows().add(row); Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java 2006-10-27 14:06:22 UTC (rev 142) +++ trunk/PZFileReader/src/main/java/net/sf/pzfilereader/PZParser.java 2006-10-27 14:14:36 UTC (rev 143) @@ -33,24 +33,24 @@ package net.sf.pzfilereader; /** - * PZParser is ready to parse the data and return an object that can then be traversed. - * The default parser should NOT handle short lines, the user can change it prior to calling - * parse. + * PZParser is ready to parse the data and return an object that can then be + * traversed. The default parser should NOT handle short lines, the user can + * change it prior to calling parse. * * @author Benoit Xhenseval */ public interface PZParser { - + /** * Start the parsing + * * @return the data set resulting from parsing */ IDataSet parse(); /** - * @return true, lines with less columns then the amount - * of column headers will be added as empty's instead of - * producing an error + * @return true, lines with less columns then the amount of column headers + * will be added as empty's instead of producing an error */ boolean isHandlingShortLines(); Modified: trunk/PZFileReader/src/main/java/net/sf/pzfilereader/ordering/OrderBy.java =================================================================== --- trunk/PZFileReader/src/main/java/net/sf/pzfilereader/ordering/OrderBy.java 2006-10-27... [truncated message content] |