org.h2gis.drivers.file_table
Class FileEngine<Driver extends FileDriver>

java.lang.Object
  extended by org.h2gis.drivers.file_table.FileEngine<Driver>
All Implemented Interfaces:
org.h2.api.TableEngine
Direct Known Subclasses:
DBFEngine, SHPEngine

public abstract class FileEngine<Driver extends FileDriver>
extends Object
implements org.h2.api.TableEngine

Implement theses abstract methods in order to define a file engine.

Author:
Nicolas Fortin

Constructor Summary
FileEngine()
           
 
Method Summary
protected abstract  Driver createDriver(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.Table createTable(org.h2.command.ddl.CreateTableData data)
           
protected abstract  void feedCreateTableData(Driver driver, org.h2.command.ddl.CreateTableData data)
          Add columns definition of the file into the CreateTableData instance.
static String getUniqueColumnName(String base, List<org.h2.table.Column> columns)
          Compute unique column name among the other columns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileEngine

public FileEngine()
Method Detail

createTable

public org.h2.table.Table createTable(org.h2.command.ddl.CreateTableData data)
Specified by:
createTable in interface org.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 duplicate
columns - 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 name
args - 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:
data - Data to initialise
Throws:
IOException


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.