Class FileEngine<Driver extends org.h2gis.api.FileDriver>
- java.lang.Object
-
- org.h2gis.functions.io.file_table.FileEngine<Driver>
-
- Type Parameters:
Driver- file driver
- All Implemented Interfaces:
org.h2.api.TableEngine
public abstract class FileEngine<Driver extends org.h2gis.api.FileDriver> extends Object implements org.h2.api.TableEngine
Implement theses abstract methods in order to define a file engine.- Author:
- Nicolas Fortin
-
-
Constructor Summary
Constructors Constructor Description FileEngine()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract DrivercreateDriver(File filePath, List<String> args)Create the driver instance using the file name and additional arguments provided in SQL create table request.org.h2.table.TableBasecreateTable(org.h2.command.ddl.CreateTableData data)protected abstract voidfeedCreateTableData(Driver driver, org.h2.command.ddl.CreateTableData data)Add columns definition of the file into the CreateTableData instance.static StringgetUniqueColumnName(String base, List<org.h2.table.Column> columns)Compute unique column name among the other columns
-
-
-
Method Detail
-
createTable
public org.h2.table.TableBase createTable(org.h2.command.ddl.CreateTableData data)
- Specified by:
createTablein interfaceorg.h2.api.TableEngine
-
getUniqueColumnName
public static String getUniqueColumnName(String base, List<org.h2.table.Column> columns)
Compute unique column name among the other columns- Parameters:
base- Returned name if there is no duplicatecolumns- Other existing columns- Returns:
- Unique column name
-
createDriver
protected abstract Driver createDriver(File filePath, List<String> args) throws IOException
Create the driver instance using the file name and additional arguments provided in SQL create table request.- Parameters:
filePath- First argument, file nameargs- Additional argument, contains the file name as first argument- Returns:
- Instance of FileDriver
- Throws:
IOException
-
feedCreateTableData
protected abstract void feedCreateTableData(Driver driver, org.h2.command.ddl.CreateTableData data) throws IOException
Add columns definition of the file into the CreateTableData instance.- Parameters:
driver- driver objectdata- Data to initialise- Throws:
IOException
-
-