01: /*
02: * ImportFileParser.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.interfaces;
13:
14: import java.sql.SQLException;
15: import java.util.List;
16: import workbench.db.ColumnIdentifier;
17: import workbench.db.importer.ImportFileHandler;
18: import workbench.db.importer.modifier.ImportValueModifier;
19:
20: /**
21: * @author support@sql-workbench.net
22: */
23: public interface ImportFileParser {
24:
25: /**
26: * Return the encoding used to read input files
27: */
28: String getEncoding();
29:
30: /**
31: * Return the name of the input file
32: */
33: String getSourceFilename();
34:
35: /**
36: * Parse the file and return a list of column
37: * names defined in that file
38: */
39: List<ColumnIdentifier> getColumnsFromFile();
40:
41: void setTableName(String table);
42:
43: /**
44: * Define the column structure to be used for the import
45: */
46: void setColumns(List<ColumnIdentifier> columns) throws SQLException;
47:
48: /**
49: * Returns the column list as a comma separated string
50: * that can be used for the WbImport command
51: */
52: String getColumns();
53:
54: ImportFileHandler getFileHandler();
55:
56: /**
57: * Define a modifier to change the values received
58: * from the text file before they are converted to
59: * the correct datatype.
60: *
61: * @param modifier the ImportValueModifier to apply to the values in the import file
62: */
63: void setValueModifier(ImportValueModifier modifier);
64: }
|