easik.sketch.util.Export.Text
Class TextBuilder

java.lang.Object
  extended by easik.sketch.util.Export.Text.TextBuilder

public class TextBuilder
extends java.lang.Object

A class to create strings for addition to an SQL text file. Accepts a SQLFileBuilder and an ExportHandler associated with the current sketch. Formats strings generated in a SketchToSchema object for writing to a text file. These strings are then given to the SQLFileBuilder object to be written to the user defined file.

Since:
2006-05-17 Vera Ranieri
Version:
2006-06-19 Vera Ranieri
Author:
Vera Ranieri

Field Summary
private  SQLFileBuilder _fb
          The file builder containing the file to be written to
private  SketchToSchema _schema
          The object containing the sketch data, prepared for SQL
private  java.lang.String _sep
          The new line string for this system
 
Constructor Summary
TextBuilder(SQLFileBuilder fileBuilder, ExportHandler sh, java.lang.String name)
          Constructor.
 
Method Summary
private  void addConstraints()
          Formats constraints for SQL.
private  void addStringToFile(java.lang.String s)
          Writes a string to the file stored in the SQLFileBuilder passed to the constructor.
private  void addTables()
          Formats tables for SQL.
private  void addTriggers()
          Formats triggers for SQL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_fb

private SQLFileBuilder _fb
The file builder containing the file to be written to


_schema

private SketchToSchema _schema
The object containing the sketch data, prepared for SQL


_sep

private java.lang.String _sep
The new line string for this system

Constructor Detail

TextBuilder

public TextBuilder(SQLFileBuilder fileBuilder,
                   ExportHandler sh,
                   java.lang.String name)
Constructor.

Parameters:
fileBuilder - The SQLFileBuilder object associated with this schema
sh - The ExportHandler associated with this schema.
name - The name of the new database
Since:
2006-06-19 Vera Ranieri
Method Detail

addTables

private void addTables()
Formats tables for SQL. This includes the addition of a fail table. Once tables are formatted, they are added to the file

Since:
2006-06-19 Vera Ranieri

addConstraints

private void addConstraints()
Formats constraints for SQL. This formatting includes changing the SQL delimiter before and after the creation of the constraint. Once strings are formatted, they are then added to the file.

Since:
2006-06-19 Vera Ranieri

addTriggers

private void addTriggers()
Formats triggers for SQL. Once triggers are formatted, they are added to the file

Since:
2006-06-19 Vera Ranieri

addStringToFile

private void addStringToFile(java.lang.String s)
Writes a string to the file stored in the SQLFileBuilder passed to the constructor.

Parameters:
s - The string to write to the file