From c935d2bdbad770238f6d25208999ceab75197ffa Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Fri, 15 Mar 2013 16:24:29 +0000 Subject: [PATCH] don't need init method on import/export filters after all git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-2@688 f203690c-595d-4dc9-a70b-905162fa7fd2 --- TODO.txt | 3 +++ .../jackcess/util/ExportFilter.java | 10 ---------- .../healthmarketscience/jackcess/util/ExportUtil.java | 3 --- .../jackcess/util/ImportFilter.java | 10 ---------- .../healthmarketscience/jackcess/util/ImportUtil.java | 6 ------ .../jackcess/util/SimpleExportFilter.java | 4 ---- .../jackcess/util/SimpleImportFilter.java | 4 ---- 7 files changed, 3 insertions(+), 37 deletions(-) diff --git a/TODO.txt b/TODO.txt index 5d03856..31ae396 100644 --- a/TODO.txt +++ b/TODO.txt @@ -39,3 +39,6 @@ Refactor goals: * clean up columnimpl/tableimpl constructors - add updateCurrentRow(Map), add updateRow(Row) - sort out query types +- clean up javadocs + - enhance public api classes + - add @usage tags to util classes diff --git a/src/java/com/healthmarketscience/jackcess/util/ExportFilter.java b/src/java/com/healthmarketscience/jackcess/util/ExportFilter.java index 9fece9d..b9b8607 100644 --- a/src/java/com/healthmarketscience/jackcess/util/ExportFilter.java +++ b/src/java/com/healthmarketscience/jackcess/util/ExportFilter.java @@ -39,16 +39,6 @@ import com.healthmarketscience.jackcess.Column; */ public interface ExportFilter { - /** - * Called before any calls {@link #filterColumns} and {@link #filterRow} for - * a single export operation. Allows the given instance to return a - * per-call instance which can maintain state. - * - * @return the ExportFilter instance to use for the rest of the export - * operation - */ - public ExportFilter init(); - /** * The columns that should be used to create the exported file. * diff --git a/src/java/com/healthmarketscience/jackcess/util/ExportUtil.java b/src/java/com/healthmarketscience/jackcess/util/ExportUtil.java index 81bf6da..059347d 100644 --- a/src/java/com/healthmarketscience/jackcess/util/ExportUtil.java +++ b/src/java/com/healthmarketscience/jackcess/util/ExportUtil.java @@ -308,9 +308,6 @@ public class ExportUtil { "(?:" + Pattern.quote(delimiter) + ")|(?:" + Pattern.quote("" + quote) + ")|(?:[\n\r])"); - // allow filter to setup per-call state - filter = filter.init(); - List origCols = cursor.getTable().getColumns(); List columns = new ArrayList(origCols); columns = filter.filterColumns(columns); diff --git a/src/java/com/healthmarketscience/jackcess/util/ImportFilter.java b/src/java/com/healthmarketscience/jackcess/util/ImportFilter.java index 786dbac..a7131b7 100644 --- a/src/java/com/healthmarketscience/jackcess/util/ImportFilter.java +++ b/src/java/com/healthmarketscience/jackcess/util/ImportFilter.java @@ -41,16 +41,6 @@ import com.healthmarketscience.jackcess.ColumnBuilder; */ public interface ImportFilter { - /** - * Called before any calls {@link #filterColumns} and {@link #filterRow} for - * a single import operation. Allows the given instance to return a - * per-call instance which can maintain state. - * - * @return the ImportFilter instance to use for the rest of the import - * operation - */ - public ImportFilter init(); - /** * The columns that should be used to create the imported table. * @param destColumns the columns as determined by the import code, may be diff --git a/src/java/com/healthmarketscience/jackcess/util/ImportUtil.java b/src/java/com/healthmarketscience/jackcess/util/ImportUtil.java index 56e30dc..58b04bb 100644 --- a/src/java/com/healthmarketscience/jackcess/util/ImportUtil.java +++ b/src/java/com/healthmarketscience/jackcess/util/ImportUtil.java @@ -168,9 +168,6 @@ public class ImportUtil { ResultSetMetaData md = source.getMetaData(); - // allow filter to setup per-call state - filter = filter.init(); - name = DatabaseImpl.escapeIdentifier(name); Table table = null; if(!useExistingTable || ((table = db.getTable(name)) == null)) { @@ -459,9 +456,6 @@ public class ImportUtil Pattern delimPat = Pattern.compile(delim); - // allow filter to setup per-call state - filter = filter.init(); - try { name = DatabaseImpl.escapeIdentifier(name); Table table = null; diff --git a/src/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java b/src/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java index 70f4118..5e61d6d 100644 --- a/src/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java +++ b/src/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java @@ -44,10 +44,6 @@ public class SimpleExportFilter implements ExportFilter { public SimpleExportFilter() { } - public ExportFilter init() { - return this; - } - public List filterColumns(List columns) throws IOException { return columns; } diff --git a/src/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java b/src/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java index fe475f3..40b27ef 100644 --- a/src/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java +++ b/src/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java @@ -47,10 +47,6 @@ public class SimpleImportFilter implements ImportFilter { public SimpleImportFilter() { } - public ImportFilter init() { - return this; - } - public List filterColumns(List destColumns, ResultSetMetaData srcColumns) throws SQLException, IOException -- 2.39.5