net.sf.farrago.ddl.gen
Class GeneratedDdlStmt

java.lang.Object
  extended by net.sf.farrago.ddl.gen.GeneratedDdlStmt

public class GeneratedDdlStmt
extends Object

Working set for DdlGenerator. Maintains list of DDL statement lines.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/ddl/gen/GeneratedDdlStmt.java#7 $
Author:
Jason Ouellette

Field Summary
private  List<String> ddl
           
private  String newName
           
private  boolean replace
           
private  boolean topLevel
           
 
Constructor Summary
  GeneratedDdlStmt()
           
  GeneratedDdlStmt(boolean replace)
           
  GeneratedDdlStmt(String newName)
           
private GeneratedDdlStmt(String newName, boolean replace)
           
 
Method Summary
 void addStmt(String stmt)
           
 void clear()
           
 String getNewName()
           
 List<String> getStatementList()
          Returns the list of generated DDL strings.
 boolean isReplace()
           
 boolean isTopLevel()
          Returns whether the element is a top-level element.
 void setTopLevel(boolean topLevel)
          Indicates whether the element is a top-level element, that is, it requires its own DDL statement.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ddl

private final List<String> ddl

replace

private final boolean replace

newName

private final String newName

topLevel

private boolean topLevel
Constructor Detail

GeneratedDdlStmt

public GeneratedDdlStmt()

GeneratedDdlStmt

public GeneratedDdlStmt(boolean replace)

GeneratedDdlStmt

public GeneratedDdlStmt(String newName)

GeneratedDdlStmt

private GeneratedDdlStmt(String newName,
                         boolean replace)
Method Detail

clear

public void clear()

addStmt

public void addStmt(String stmt)

isReplace

public boolean isReplace()

getNewName

public String getNewName()

setTopLevel

public void setTopLevel(boolean topLevel)
Indicates whether the element is a top-level element, that is, it requires its own DDL statement.

For example, a regular index is top-level but a clustered index is not (it lives inside a CREATE TABLE statement).

The clear() method resets the topLevel attribute to true.

Parameters:
topLevel - Whether element has its own DDL statement

isTopLevel

public boolean isTopLevel()
Returns whether the element is a top-level element.

Returns:
whether the element is a top-level element
See Also:
setTopLevel(boolean)

getStatementList

public List<String> getStatementList()
Returns the list of generated DDL strings.

Returns:
list of DDL statements

toString

public String toString()
Overrides:
toString in class Object