ch.sahits.codegen.input
Interface IDBInputParser

All Superinterfaces:
IInputParser
All Known Implementing Classes:
MySQLCreateScriptInputParser, OracleSQLCreateScriptInputParser, SQLCreateScriptInput, SQLServerCreateScriptInputParser

public interface IDBInputParser
extends IInputParser

This interface defines methods that mus be provided by a database parser of input files

Since:
0.9.0
Author:
Andi Hotz

Method Summary
 java.lang.Class convert2JavaType(java.lang.String type)
          Convert the corresponding Java type for a database type
 java.lang.String getDatabaseName()
          Get the name of the database that is used for initialization of the wizard.
 java.lang.String getDefaultHost()
          Get the default value for the host for a database product that is used for initialization of the wizard e.g.
 int getDefaultPort()
          Get the default port number for a database product that is used for initialization of the wizard e.g. '1521'.
 java.lang.String getDefaultUser()
          Get the default user name for a database product that is used for initialization of the wizard e.g.
 java.lang.String getPassword()
          Get the password of the database for the user name specified at getDefaultUser() that is used for initialization of the wizard.
 boolean hasSchema()
          Indicates if this database works through schemas
 void init(java.lang.Object obj)
          Initialize the the parser
 DataBaseTable parse()
          Parse the input file into an object that represents a database table.
 
Methods inherited from interface ch.sahits.codegen.input.IInputParser
getFileExtension, getRanking, getWorkload, init, needsDataBaseInformationForCompleetion
 

Method Detail

parse

DataBaseTable parse()
Parse the input file into an object that represents a database table.

Specified by:
parse in interface IInputParser
Returns:
DataBaseTable Bean with the data

convert2JavaType

java.lang.Class convert2JavaType(java.lang.String type)
Convert the corresponding Java type for a database type

Parameters:
type - database type
Returns:
Java type

getDefaultHost

java.lang.String getDefaultHost()
Get the default value for the host for a database product that is used for initialization of the wizard e.g. 'localhost' The default host may not be specified in which case an empty string is returned. The default host must not be null.

Returns:
name of a default host.

getDefaultPort

int getDefaultPort()
Get the default port number for a database product that is used for initialization of the wizard e.g. '1521'. The default port may be 0 which means not specified but it must not be negative.

Returns:
number of the port.

getDefaultUser

java.lang.String getDefaultUser()
Get the default user name for a database product that is used for initialization of the wizard e.g. 'root'. The default user name may not be specified in which case an empty string is returned. The default user name must not be null.

Returns:
name of the default user

getDatabaseName

java.lang.String getDatabaseName()
Get the name of the database that is used for initialization of the wizard. The name may not be specified in which case an empty string is returned. The name must not be null.
Normally this should be an empty string since you want to generate a parser that works out of the box for all systems.

Returns:
name of the database

getPassword

java.lang.String getPassword()
Get the password of the database for the user name specified at getDefaultUser() that is used for initialization of the wizard. The password may not be specified in which case an empty string is returned. The password must not be null.
Normally this should be an empty string since you want to generate a parser that works out of the box for all systems.

Returns:
password of the database for the user

init

void init(java.lang.Object obj)
          throws java.lang.Exception
Initialize the the parser

Parameters:
obj - some date with which to initialize the data
Throws:
java.lang.Exception

hasSchema

boolean hasSchema()
Indicates if this database works through schemas

Returns:
true if the schema must be supplied.