ch.sahits.codegen.java.input
Class CSVInputFileParser

java.lang.Object
  extended by ch.sahits.codegen.java.input.CSVInputFileParser
All Implemented Interfaces:
IInputParser

public class CSVInputFileParser
extends java.lang.Object
implements IInputParser

This input parser can handle a CSV file that defines its values in the first row and its columns are separated by ',', ';' or ' '.

Since:
1.2.0
Author:
Andi Hotz, Sahits GmbH

Constructor Summary
CSVInputFileParser()
           
 
Method Summary
 java.lang.String getFileExtension()
          This class can parse CSV files
 int getRanking()
          Low ranking so that better implementation can override this basic implementation
 int getWorkload()
          Retrieve the workload
 void init(java.lang.String inputFile)
          Initialize the file that is to be parsed to generate a model
 EDBConnectionData needsDataBaseInformationForCompleetion()
          Indicate if the input file is self contained or if for compleetion of the model information from the second page is needed.
 IGeneratedObject parse()
          Parse the CVS file and determine its values from the first row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVInputFileParser

public CSVInputFileParser()
Method Detail

getFileExtension

public java.lang.String getFileExtension()
This class can parse CSV files

Specified by:
getFileExtension in interface IInputParser
Returns:
csv

getRanking

public int getRanking()
Low ranking so that better implementation can override this basic implementation

Specified by:
getRanking in interface IInputParser
Returns:
1

getWorkload

public int getWorkload()
Retrieve the workload

Specified by:
getWorkload in interface IInputParser
Returns:
5

init

public void init(java.lang.String inputFile)
          throws java.lang.Exception
Initialize the file that is to be parsed to generate a model

Specified by:
init in interface IInputParser
Parameters:
inputFile - absolute file path of the input file
Throws:
java.lang.Exception - Error while initializing

parse

public IGeneratedObject parse()
Parse the CVS file and determine its values from the first row. The generated model is a DataBaseTable. All elements of the model are null allowed

Specified by:
parse in interface IInputParser
Returns:
DatabaseTable with the fields, the tablename (File), and product (MYSQL) defined

needsDataBaseInformationForCompleetion

public EDBConnectionData needsDataBaseInformationForCompleetion()
Indicate if the input file is self contained or if for compleetion of the model information from the second page is needed.

Specified by:
needsDataBaseInformationForCompleetion in interface IInputParser
Returns: