|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.java.input.SQLCreateScriptInput
public abstract class SQLCreateScriptInput
Base class for the parsing. All essential stuff is in this class. Only some db specific data must be implemented by the concrete class.
| Field Summary | |
|---|---|
protected boolean |
initialized
Flag indicates of the parser is sufficiently initialized for the parsing |
protected EParserState |
state
Holds the state of the Parser |
| Fields inherited from interface ch.sahits.codegen.java.input.ISQLCreateToken |
|---|
CLOSE_CURLY_BRACE, CREATE, CREATE_DELIMITER, FIELD_DEFLIMITER, INDEX, LEFT_PARENTHESIS, NOT, NULL, ON, OPEN_CURLY_BRACE, RIGHT_PARENTHESIS, TABLE, UNIQUE |
| Constructor Summary | |
|---|---|
SQLCreateScriptInput()
Default constructor |
|
| Method Summary | |
|---|---|
protected java.lang.String |
createIndexName(java.lang.String hint)
Create an index name |
protected java.lang.String |
getLines()
Retrieve the SQL create script for the table |
protected abstract boolean |
hasTypeSize(java.lang.String type)
Check if the type has any size property |
protected abstract boolean |
isAutogenKey(java.lang.String fieldName,
IDataBaseTable dbt)
Check whether the field name is an autogenerated key. |
protected abstract boolean |
isIndexConstraintToken(java.lang.String token)
Check if the token is a Index constraint token. |
EDBConnectionData |
needsDataBaseInformationForCompleetion()
Indicate if the input file is self contained or if for compleetion of the model information from the second page is needed. |
DataBaseTable |
parse()
Parse the create script and produce a database model |
protected DataBaseTableIndex |
parseIndex(java.util.StringTokenizer st,
java.lang.String lastToken,
DataBaseTable table)
Parse the script for the index definition. |
protected DataBaseTable |
parseTable(java.util.StringTokenizer st,
DataBaseTable dbt)
Parse the script for the table definition. |
protected abstract DataBaseTable |
parseTable(java.util.StringTokenizer st,
java.lang.String className)
Parse the script for the table definition. |
protected void |
readFile(java.io.BufferedReader inputStream)
Read the contents of the file into a string array |
java.lang.String |
unquote(java.lang.String s)
Unquote the string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ch.sahits.codegen.input.IDBInputParser |
|---|
convert2JavaType, getDatabaseName, getDefaultHost, getDefaultPort, getDefaultUser, getPassword, hasSchema, init |
| Methods inherited from interface ch.sahits.codegen.input.IInputParser |
|---|
getFileExtension, getRanking, getWorkload, init |
| Field Detail |
|---|
protected EParserState state
protected boolean initialized
| Constructor Detail |
|---|
public SQLCreateScriptInput()
| Method Detail |
|---|
protected final void readFile(java.io.BufferedReader inputStream)
throws java.io.IOException
inputStream - Input stream to be read from
java.io.IOException - Exception while reading from the streampublic DataBaseTable parse()
parse in interface IDBInputParserparse in interface IInputParserprotected abstract boolean isIndexConstraintToken(java.lang.String token)
token - to be checked
protected DataBaseTableIndex parseIndex(java.util.StringTokenizer st,
java.lang.String lastToken,
DataBaseTable table)
st - StringTokernizerlastToken - table - table model the index belongs to
protected abstract DataBaseTable parseTable(java.util.StringTokenizer st,
java.lang.String className)
st - StringTokernizerclassName - name of the class
protected DataBaseTable parseTable(java.util.StringTokenizer st,
DataBaseTable dbt)
st - StringTokernizerdbt - object to store the parsed info into
protected abstract boolean hasTypeSize(java.lang.String type)
type - to be checked
protected final java.lang.String createIndexName(java.lang.String hint)
hint - hit at the index name
protected abstract boolean isAutogenKey(java.lang.String fieldName,
IDataBaseTable dbt)
fieldName - name of the field that is to be checkeddbt - Database table model for with the autogenerated key is searched
protected final java.lang.String getLines()
public final java.lang.String unquote(java.lang.String s)
s - input string
public EDBConnectionData needsDataBaseInformationForCompleetion()
needsDataBaseInformationForCompleetion in interface IInputParser
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||