|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.dewdrop.sqlml.config.Configuration
Constructor Summary | |
Configuration()
|
|
Configuration(Dialect dialect)
|
Method Summary | |
void |
decrementIndent()
|
Dialect |
getDialect()
|
int |
getIndentLevel()
|
String |
getIndentString()
|
int |
getLinesBetweenRootDefinitions()
Returns the number of new lines inserted between root-level SQL component definitions such as tables, indicies, views, etc. |
int |
getLinesBetweenTableComponents()
|
String |
getLineSeparator()
|
int |
getMaxPageWidth()
Returns the maxPageWidth, which is the maximum number of characters per line. |
int |
getRootIndentLevel()
Returns the indent level for all root SchemaComponent s relative to the left margin of the page. |
int |
getTableComponentIndentLevel()
Returns the column indent level for a column relative to the left margin of its parent table. |
void |
incrementIndent()
|
void |
indent(Writer out)
|
void |
indent(Writer out,
int num)
|
boolean |
isColumnMetadataJustified()
Returns whether or not column metadata for column definitions will be justified flush with all other column metadata in a table. |
boolean |
isOutputWrappedInTransaction()
|
boolean |
isSpaceUsedForIndents()
Returns true if the space character is to be used as the indent character in the document, false if a tab is to be used. |
boolean |
isTableOpenParenOnSameLine()
Returns true if, when creating a new table, the table's open parenthesis is to be on the same line as the table name and table modifiers. |
void |
setColumnMetadataJustified(boolean columnMetadataJustified)
Sets whether or not column metadata is to be justfied when printed out. |
void |
setDialect(Dialect dialect)
|
void |
setIndentLevel(int indentLevel)
|
void |
setIndentString(String indentString)
|
void |
setLinesBetweenRootDefinitions(int linesBetweenRootDefinitions)
Sets the number of new lines to be inserted between root-level SQL component definitions such as tables, indices, views, etc. |
void |
setLinesBetweenTableComponents(int linesBetweenTableComponents)
|
void |
setLineSeparator(String lineSeparator)
|
void |
setMaxPageWidth(int maxPageWidth)
Sets the maxPageWidth, which is the maximum number of characters per line. |
void |
setOutputWrappedInTransaction(boolean outputWrappedInTransaction)
|
void |
setRootIndentLevel(int rootIndentLevel)
Sets the root indent level for all SchemaComponents relative to the left margin of the page. |
void |
setTableComponentIndentLevel(int tableComponentIndentLevel)
Sets the indent level for a table component relative to the left margin of its parent table. |
void |
setTableOpenParenOnSameLine(boolean tableOpenParenOnSameLine)
Sets whether or not a table definition's opening parenthesis will exist on the same line as the table declaration or not. |
void |
write(Writer out,
String toWrite)
|
void |
writeln(Writer out)
|
void |
writeln(Writer out,
String toWrite)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Configuration DEFAULT_CONFIG
public static final boolean DEFAULT_OUTPUT_WRAPPED_IN_TRANSACTION
protected static final int DEFAULT_MAX_PAGE_WIDTH
protected static final int DEFAULT_ROOT_INDENT_LEVEL
protected static final boolean DEFAULT_TABLE_OPEN_PAREN_ON_SAME_LINE
protected static final String DEFAULT_INDENT_STRING
protected static final int DEFAULT_COLUMN_INDENT_LEVEL
protected static final boolean DEFAULT_COLUMN_METADATA_JUSTIFIED
protected static final int DEFAULT_LINES_BETWEEN_ROOT_DEFINITIONS
protected static final int DEFAULT_LINES_BETWEEN_COLUMN_DEFINITIONS
protected static final int DEFAULT_TABLE_COMPONENT_INDENT_LEVEL
protected boolean outputWrappedInTransaction
protected int maxPageWidth
protected int rootIndentLevel
protected boolean tableOpenParenOnSameLine
protected String indentString
protected int tableComponentIndentLevel
protected boolean columnMetadataJustified
protected String lineSeparator
protected int linesBetweenRootDefinitions
protected int linesBetweenTableComponents
protected Dialect dialect
protected int indentLevel
Constructor Detail |
public Configuration()
public Configuration(Dialect dialect)
Method Detail |
public boolean isOutputWrappedInTransaction()
public void setOutputWrappedInTransaction(boolean outputWrappedInTransaction)
outputWrappedInTransaction
- The outputWrappedInTransaction to set.public int getMaxPageWidth()
public void setMaxPageWidth(int maxPageWidth)
Sets the maxPageWidth, which is the maximum number of characters per line. Any values of maxPageWidth less than 1 are ignored.
maxPageWidth
- The maxPageWidth to set.public int getRootIndentLevel()
SchemaComponent
s relative to the left margin of the page. The root indent level is the
number of indent characters an entire schema component definition will be indented
from the 1st column on the page. An indent character is either a space or a tab. The
character used is determined by rootIndentUsesSpaces(). For example, if
indentUsesSpaces() returns true and the rootIndentLevel is set to
4, then 4 spaces will be output before each line in the schema component, thereby
indenting the entire component 4 spaces. If indentUsesSpaces() returns false and the
rootIndentLevel is set to 4 then 4 tabs will be output before each
line in the component, thereby indenting the entire component by 4 tabs. Most common
conventions set the rootIndentLevel to 2 or 4 when using spaces and 1 when using
tabs.
public void setRootIndentLevel(int rootIndentLevel)
rootIndentLevel
- The table indent level to set.getRootIndentLevel()
public boolean isSpaceUsedForIndents()
public void setIndentString(String indentString)
public String getIndentString()
public boolean isTableOpenParenOnSameLine()
public void setTableOpenParenOnSameLine(boolean tableOpenParenOnSameLine)
tableOpenParenOnSameLine
- The boolean value to set.public int getTableComponentIndentLevel()
public void setTableComponentIndentLevel(int tableComponentIndentLevel)
tableComponentIndentLevel
- The tableComponentIndentLevel to set.public boolean isColumnMetadataJustified()
Returns whether or not column metadata for column definitions will be justified flush with all other column metadata in a table.
For example:
Metadata Justified:
column_name char(36), another_column_name integer not null, some_other_column varchar(100) not null unique, ...
Metadata Not Justified:
column_name char(36), another_column_name integer not null, some_other_column varchar(100) not null unique, ...
Although purely a personal preference, metadata justification almost always makes column definitions easier to read.
public void setColumnMetadataJustified(boolean columnMetadataJustified)
columnMetadataJustified
- The boolean to set.isColumnMetadataJustified()
public String getLineSeparator()
public void setLineSeparator(String lineSeparator)
public int getLinesBetweenRootDefinitions()
public void setLinesBetweenRootDefinitions(int linesBetweenRootDefinitions)
linesBetweenRootDefinitions
- The number to set.public int getLinesBetweenTableComponents()
public void setLinesBetweenTableComponents(int linesBetweenTableComponents)
linesBetweenTableComponents
- The linesBetweenTableComponents to set.public void setDialect(Dialect dialect)
public Dialect getDialect()
public int getIndentLevel()
public void setIndentLevel(int indentLevel)
public void incrementIndent()
public void decrementIndent()
public final void indent(Writer out)
public final void indent(Writer out, int num)
public final void write(Writer out, String toWrite)
public final void writeln(Writer out, String toWrite)
public final void writeln(Writer out)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |