public class Config extends Object
| 修飾子とタイプ | クラスと説明 |
|---|---|
static class |
Config.MissingRequiredParameterException
Thrown to indicate that a required parameter is missing
|
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static String |
DOT_CHARSET |
| コンストラクタと説明 |
|---|
Config()
Default constructor.
|
Config(String[] argv)
Construct a configuration from an array of options (e.g. from a command
line interface).
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
List<String> |
asList()
Return all of the configuration options as a List of Strings, with
each parameter and its value as a separate element.
|
static Properties |
asProperties(ResourceBundle bundle)
Returns a
Properties populated with the contents of bundle |
protected void |
dumpUsage(String errorMessage,
boolean detailedDb) |
protected List<String> |
fixupArgs(List<String> args)
Allow an equal sign in args...like "-o=foo.bar".
|
static Set<String> |
getBuiltInDatabaseTypes(String loadedFromJar) |
String |
getCharset() |
Pattern |
getColumnExclusions()
|
Properties |
getConnectionProperties()
Returns a
Properties populated either from the properties file specified
by setConnectionPropertiesFile(String), the properties specified by
setConnectionProperties(String) or not populated. |
String |
getConnectionPropertiesFile() |
String |
getCss() |
String |
getDb() |
Properties |
getDbProperties(String type) |
protected String |
getDbPropertiesLoadedFrom() |
Map<String,String> |
getDbSpecificOptions() |
String |
getDbType() |
String |
getDescription() |
String |
getDriverPath() |
String |
getFont() |
int |
getFontSize() |
File |
getGraphvizDir()
Return the path to Graphviz (used to find the dot executable to run to
generate ER diagrams).
|
String |
getHost() |
Pattern |
getIndirectColumnExclusions() |
static Config |
getInstance() |
static String |
getLoadedFromJar() |
Level |
getLogLevel()
Returns the level of logging to perform.
|
int |
getMaxDbThreads() |
int |
getMaxDetailedTables() |
String |
getMeta() |
File |
getOutputDir() |
String |
getParam(String paramName)
Get the value of the specified parameter.
|
String |
getPassword() |
Integer |
getPort() |
List<String> |
getRemainingParameters() |
String |
getRenderer() |
String |
getSchema() |
List<String> |
getSchemas() |
String |
getSchemaSpec() |
String |
getServer() |
SqlFormatter |
getSqlFormatter()
Returns an implementation of
SQL formatter to use to format
SQL into HTML. |
Pattern |
getTableExclusions()
Get the regex
Pattern for which tables to exclude from the analysis. |
Pattern |
getTableInclusions()
Get the regex
Pattern for which tables to include in the analysis. |
String |
getUser()
User used to connect to the database.
|
boolean |
isAdsEnabled()
Returns
true if we should display advertisements. |
boolean |
isDbHelpRequired() |
boolean |
isEncodeCommentsEnabled() |
boolean |
isEvaluateAllEnabled() |
boolean |
isHelpRequired()
Returns
true if the options indicate that the user wants
to see some help information. |
boolean |
isHighQuality() |
boolean |
isHtmlGenerationEnabled() |
boolean |
isImpliedConstraintsEnabled() |
boolean |
isLogoEnabled() |
boolean |
isLowQuality() |
boolean |
isMeterEnabled()
Returns
true if metering should be embedded in
the generated pages. |
boolean |
isNumRowsEnabled() |
boolean |
isOneOfMultipleSchemas()
Returns true if we're evaluating a bunch of schemas in one go and
at this point we're evaluating a specific schema.
|
boolean |
isPromptForPasswordEnabled() |
boolean |
isRailsEnabled() |
boolean |
isRankDirBugEnabled() |
boolean |
isSchemaDisabled()
Some databases types (e.g. older versions of Informix) don't really
have the concept of a schema but still return true from
DatabaseMetaData.supportsSchemasInTableDefinitions(). |
boolean |
isSingleSignOn() |
boolean |
isViewsEnabled() |
void |
setAdsEnabled(boolean enabled)
true if we should display advertisements. |
void |
setCharset(String charset)
The character set to use within HTML pages (defaults to
"ISO-8859-1"). |
void |
setColumnExclusions(String columnExclusions)
Set the columns to exclude from all relationship diagrams.
|
void |
setConnectionProperties(String properties)
Specifies connection properties to use in the format:
key1\=value1;key2\=value2user (from -u) and password (from -p) will be passed in the connection properties if specified. |
void |
setConnectionPropertiesFile(String propertiesFilename)
Properties from this file (in key=value pair format) are passed to the
database connection.
|
void |
setCss(String css)
The filename of the cascading style sheet to use.
|
void |
setDb(String db) |
void |
setDbSpecificOptions(Map<String,String> dbSpecificOptions)
Options that are specific to a type of database.
|
void |
setDbType(String dbType) |
void |
setDescription(String description)
Description of schema that gets display on main pages.
|
void |
setDriverPath(String driverPath) |
void |
setEncodeCommentsEnabled(boolean enabled)
Allow Html In Comments - encode them unless otherwise specified
|
void |
setEvaluateAllEnabled(boolean enabled) |
void |
setFont(String font)
The font to use within diagrams.
|
void |
setFontSize(int fontSize)
The font size to use within diagrams.
|
void |
setGraphvizDir(File graphvizDir)
Set the path to Graphviz so we can find dot to generate ER diagrams
|
void |
setGraphvizDir(String graphvizDir)
Set the path to Graphviz so we can find dot to generate ER diagrams
|
void |
setHighQuality(boolean highQuality)
If
false then generate output of "lower quality"
than the default. |
void |
setHost(String host) |
void |
setHtmlGenerationEnabled(boolean generateHtml) |
void |
setImpliedConstraintsEnabled(boolean includeImpliedConstraints) |
void |
setIndirectColumnExclusions(String fullColumnExclusions)
Set the columns to exclude from relationship diagrams where the specified
columns aren't directly referenced by the focal table.
|
static void |
setInstance(Config config)
Sets the global instance.
|
void |
setLogLevel(String logLevel)
Set the level of logging to perform.
|
void |
setMaxDbThreads(int maxDbThreads)
Maximum number of threads to use when querying database metadata information.
|
void |
setMaxDetailedTabled(int maxDetailedTables) |
void |
setMeta(String meta)
Meta files are XML-based files that provide additional metadata
about the schema being evaluated.
|
void |
setNumRowsEnabled(boolean enabled)
If enabled we'll attempt to query/render the number of rows that
each table contains.
|
void |
setOutputDir(File outputDir) |
void |
setOutputDir(String outputDirName) |
void |
setPassword(String password)
Set the password used to connect to the database.
|
void |
setPort(Integer port) |
void |
setPromptForPasswordEnabled(boolean promptForPassword)
Set to
true to prompt for the password |
void |
setRailsEnabled(boolean enabled)
Look for Ruby on Rails-based naming conventions in
relationships between logical foreign keys and primary keys.
|
void |
setRankDirBugEnabled(boolean enabled)
Don't use this unless absolutely necessary as it screws up the layout
|
void |
setRenderer(String renderer)
Set the renderer to use for the -Tpng[:renderer[:formatter]] dot option as specified
at
http://www.graphviz.org/doc/info/command.html.
|
void |
setSchema(String schema) |
void |
setSchemaSpec(String schemaSpec)
When -all (evaluateAll) is specified then this is the regular
expression that determines which schemas to evaluate.
|
void |
setServer(String server) |
void |
setSingleSignOn(boolean enabled)
By default a "user" (as specified with -u) is required.
|
void |
setSqlFormatter(SqlFormatter sqlFormatter)
Set the
SQL formatter to use to format
SQL into HTML. |
void |
setSqlFormatter(String formatterClassName)
Set the name of the
SQL formatter class to use to
format SQL into HTML. |
void |
setTableExclusions(String tableExclusions)
Set the tables to exclude as a regular expression
|
void |
setTableInclusions(String tableInclusions)
Set the tables to include as a regular expression
|
void |
setUser(String user) |
void |
setViewsEnabled(boolean enabled)
If enabled we'll include views in the analysis.
|
public Config()
public Config(String[] argv)
options - public static Config getInstance()
public static void setInstance(Config config)
config - public void setHtmlGenerationEnabled(boolean generateHtml)
public boolean isHtmlGenerationEnabled()
public void setImpliedConstraintsEnabled(boolean includeImpliedConstraints)
public boolean isImpliedConstraintsEnabled()
public void setOutputDir(String outputDirName)
public void setOutputDir(File outputDir)
public File getOutputDir()
public void setGraphvizDir(String graphvizDir)
graphvizDir - public void setGraphvizDir(File graphvizDir)
graphvizDir - public File getGraphvizDir()
#getDefaultGraphvizPath() if a specific Graphviz path
was not specified.public void setMeta(String meta)
meta is either the name of an individual XML file or
the directory that contains meta files.
If a directory is specified then it is expected to contain files
matching the pattern [schema].meta.xml.
For databases that don't have schema substitute database for schema.
meta - public String getMeta()
public void setDbType(String dbType)
public String getDbType()
public void setDb(String db)
public String getDb()
public void setSchema(String schema)
public String getSchema()
public boolean isSchemaDisabled()
DatabaseMetaData.supportsSchemasInTableDefinitions().
This option lets you ignore that and treat all the tables
as if they were in one flat namespace.public void setHost(String host)
public String getHost()
public void setPort(Integer port)
public Integer getPort()
public void setServer(String server)
public String getServer()
public void setUser(String user)
public String getUser()
setSingleSignOn(boolean)).public void setSingleSignOn(boolean enabled)
enabled - defaults to falsepublic boolean isSingleSignOn()
setSingleSignOn(boolean)public void setPassword(String password)
password - public String getPassword()
setPassword(String)public void setPromptForPasswordEnabled(boolean promptForPassword)
true to prompt for the passwordpromptForPassword - public boolean isPromptForPasswordEnabled()
setPromptForPasswordEnabled(boolean)public void setMaxDetailedTabled(int maxDetailedTables)
public int getMaxDetailedTables()
public String getConnectionPropertiesFile()
public void setConnectionPropertiesFile(String propertiesFilename) throws FileNotFoundException, IOException
propertiesFilename - FileNotFoundExceptionIOExceptionpublic Properties getConnectionProperties() throws FileNotFoundException, IOException
Properties populated either from the properties file specified
by setConnectionPropertiesFile(String), the properties specified by
setConnectionProperties(String) or not populated.FileNotFoundExceptionIOExceptionpublic void setConnectionProperties(String properties)
key1\=value1;key2\=value2
This is an alternative form of passing connection properties than by file
(see setConnectionPropertiesFile(String))
properties - public void setDriverPath(String driverPath)
public String getDriverPath()
public void setCss(String css)
Defaults to "schemaSpy.css".
css - public String getCss()
public void setFont(String font)
font - public String getFont()
setFont(String)public void setFontSize(int fontSize)
Modify the .css to specify HTML font sizes.
Defaults to 11.
fontSize - public int getFontSize()
setFontSize(int)public void setCharset(String charset)
"ISO-8859-1").charset - public String getCharset()
setCharset(String)public void setDescription(String description)
description - public String getDescription()
setDescription(String)public void setMaxDbThreads(int maxDbThreads)
maxDbThreads - public int getMaxDbThreads()
throws InvalidConfigurationException
InvalidConfigurationException - if unable to load propertiessetMaxDbThreads(int)public boolean isLogoEnabled()
public void setRankDirBugEnabled(boolean enabled)
enabled - public boolean isRankDirBugEnabled()
public void setRailsEnabled(boolean enabled)
Basically all tables have a primary key named ID.
All tables are named plural names.
The columns that logically reference that ID are the singular
form of the table name suffixed with _ID.
enabled - public boolean isRailsEnabled()
setRailsEnabled(boolean)public void setEncodeCommentsEnabled(boolean enabled)
public boolean isEncodeCommentsEnabled()
public void setNumRowsEnabled(boolean enabled)
true (enabled).enabled - public boolean isNumRowsEnabled()
setNumRowsEnabled(boolean)public void setViewsEnabled(boolean enabled)
true (enabled).enabled - public boolean isViewsEnabled()
setViewsEnabled(boolean)public boolean isMeterEnabled()
true if metering should be embedded in
the generated pages.
Defaults to false (disabled).public void setColumnExclusions(String columnExclusions)
columnExclusions - regular expression of the columns to
excludepublic Pattern getColumnExclusions()
public void setIndirectColumnExclusions(String fullColumnExclusions)
columnExclusions - regular expression of the columns to
excludepublic Pattern getIndirectColumnExclusions()
setIndirectColumnExclusions(String)public void setTableInclusions(String tableInclusions)
tableInclusions - public Pattern getTableInclusions()
Pattern for which tables to include in the analysis.public void setTableExclusions(String tableExclusions)
tableInclusions - public Pattern getTableExclusions()
Pattern for which tables to exclude from the analysis.public void setSqlFormatter(String formatterClassName)
SQL formatter class to use to
format SQL into HTML.
The implementation of the class must be made available to the class
loader, typically by specifying the path to its jar with -dp
(setDriverPath(String)).public void setSqlFormatter(SqlFormatter sqlFormatter)
SQL formatter to use to format
SQL into HTML.public SqlFormatter getSqlFormatter() throws InvalidConfigurationException
SQL formatter to use to format
SQL into HTML. The default implementation is DefaultSqlFormatter.InvalidConfigurationException - if unable to instantiate an instancepublic void setEvaluateAllEnabled(boolean enabled)
public boolean isEvaluateAllEnabled()
public boolean isOneOfMultipleSchemas()
public void setSchemaSpec(String schemaSpec)
schemaSpec - public String getSchemaSpec()
public void setRenderer(String renderer)
Note that the leading ":" is required while :formatter is optional.
The default renderer is typically GD.
Note that using setHighQuality(boolean) is the preferred approach
over using this method.
public String getRenderer()
setRenderer(String)public void setHighQuality(boolean highQuality)
false then generate output of "lower quality"
than the default.
Note that the default is intended to be "higher quality",
but various installations of Graphviz may have have different abilities.
That is, some might not have the "lower quality" libraries and others might
not have the "higher quality" libraries.Higher quality output takes longer to generate and results in significantly larger image files (which take longer to download / display), but it generally looks better.
public boolean isHighQuality()
setHighQuality(boolean)public boolean isLowQuality()
setHighQuality(boolean)public void setAdsEnabled(boolean enabled)
true if we should display advertisements.
Defaults to true.Please do not disable ads unless absolutely necessary.
public boolean isAdsEnabled()
true if we should display advertisements.Please do not disable ads unless absolutely necessary.
public void setLogLevel(String logLevel)
severe (highest - least detail)
warning (default)
info
config
fine
finer
finest (lowest - most detail)
logLevel - public Level getLogLevel()
setLogLevel(String).public boolean isHelpRequired()
true if the options indicate that the user wants
to see some help information.public boolean isDbHelpRequired()
public static String getLoadedFromJar()
public Properties getDbProperties(String type) throws IOException, InvalidConfigurationException
type - IOExceptionInvalidConfigurationException - if db properties are incorrectly formedprotected String getDbPropertiesLoadedFrom() throws IOException
IOExceptionpublic void setDbSpecificOptions(Map<String,String> dbSpecificOptions)
host,
port or db, but don't have a setter in this class.dbSpecificOptions - public static Properties asProperties(ResourceBundle bundle)
Properties populated with the contents of bundlebundle - ResourceBundleprotected List<String> fixupArgs(List<String> args)
args - Listprotected void dumpUsage(String errorMessage, boolean detailedDb)
public String getParam(String paramName)
paramName - public List<String> asList() throws IOException
IOExceptionCopyright © 2016. All Rights Reserved.