Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/* Copyright (C) 2002 Albert Tumanov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package net.sourceforge.pldoc;
import java.io.*;
import java.util.*;
/** Represents all settings for the program.
* Setting values may be received from command line options and/or defaulted.
* This class should not have side effects.
* @author Albert Tumanov
* @version $Header: /cvsroot/pldoc/sources/src/java/net/sourceforge/pldoc/Settings.java,v 1.7 2005/11/29 08:25:00 gpaulissen Exp $
*/
public class Settings
{
// Default settings
private static final String GET_METADATA_STATEMENT_DEFAULT =
"BEGIN" +
"\n DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM, 'SEGMENT_ATTRIBUTES', FALSE);" +
"\n DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM, 'CONSTRAINTS', FALSE);" +
"\n DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA. SESSION_TRANSFORM,'SQLTERMINATOR',true );" +
"\n :1 := DBMS_METADATA.GET_DDL(\n :2 ,\n :3 ,\n :4 ,\n :5 ,\n :6 ,\n :7 ) \n;" +
"\nEND;"
;
private static final String DRIVER_NAME_DEFAULT = "oracle.jdbc.OracleDriver";
// settings and their defaults
private String applicationName = "MyApplication";
private File outputDirectory = new File("." + File.separator);
private Collection inputFiles = new ArrayList();
private String stylesheetfile = null;
private File overviewfile = null;
private Properties defines = null;
private boolean ignoreInformalComments = false;
private String defaultNamescase = "UPPER"; //SRT 20110419
private String defaultKeywordscase = "UPPER"; //SRT 20110419
private boolean namesDefaultcase = true;
private boolean namesUppercase = false;
private boolean namesLowercase = false;
private boolean keywordsDefaultcase = true; //SRT 20110419
private boolean keywordsUppercase = false; //SRT 20110419
private boolean keywordsLowercase = false; //SRT 20110419
// by default, assume system default encoding for all input files
private String inputEncoding = System.getProperty("file.encoding");
// we cannot yet set output encoding dynamically, because of XSLs
private String outputEncoding = "UTF-8";
private boolean exitOnError = false;
private boolean verbose = false;
private String driverName = DRIVER_NAME_DEFAULT ;
private String getMetadataStatement = GET_METADATA_STATEMENT_DEFAULT ;
private int returnType = java.sql.Types.CLOB;
private String dbUrl = null;
private String dbUser = null;
private String dbPassword = null;
private Collection inputTypes = new ArrayList();
private Collection inputObjects = new ArrayList();
private boolean showSkippedPackages = false;
/** Extract PL/Scope procedure call information from the database when runing against the database
This is used to generate "Calls:" and "Called From:" sections for each method with relevant
PL/Scope information
*/
private boolean plscope = false;
/** Save source code whilst parsing it.
This is used to generate visible source code, whilst reading source from the database
*/
private boolean saveSourceCode = false;
/** Stylesheet file to display source code
*
*/
private String sourcestylesheetfile = null;
private static final String usage =
"Arguments: [options] inputfile(s)\n" +
"-verbose Verbose - report each object processed \n" +
"-d Destination directory for output files [default: current]\n" +
"-doctitle Application name [default: MyApplication]\n" +
"-overview Read overview documentation from HTML file [default: none]\n" +
"-defaultnamescase Case of unquoted names [default upper] - {upper, lower, mixed}\n" +
"-defaultkeywordscase Case of keywords [default upper] - {upper, lower}\n" +
"-namesdefaultcase Convert all names to defaultcase [default true]\n" +
"-namesuppercase Convert all names to uppercase\n" +
"-nameslowercase Convert all names to lowercase\n" +
"-keywordsdefaultcase Convert all names to defaultcase [default true]\n" +
"-keywordsuppercase Convert all keywords to uppercase\n" +
"-keywordslowercase Convert all keywords to lowercase\n" +
"-stylesheetfile File to change style of the generated document [default: defaultstylesheet.css]\n" +
"-definesfile File containing SQL*Plus-style variable substitutions [default: none], for example:\n" +
" &myvar1=123456\n" +
" &myvar2=abcdef\n" +
"-inputencoding Encoding used in the input files [default: operation system default encoding]\n" +
"-exitonerror Force program to exit when some input file cannot be processed\n" +
" [by default, the file is skipped and processing continues]\n" +
"-driver Name of JDBC driver class, for example oracle.jdbc.OracleDriver, com.edb.Driver, or org.postgresql.Driver [default: " + DRIVER_NAME_DEFAULT + "].\n" +
"-getmetadata SQL 92 CallableStatement Statement that retrieves the object source (EnterpriseDB does not support Oracle BEGIN .. END statements) [default: Oracle DBMS_METADATA anonymous block ].\n" +
" Statement structure is (\"call\" and function are case sensitive} \"{ ? = call GET_SOURCE( ? , ? , ? , ? , ? , ? ) }\" where GET_SOURCE(...) mimics \n" +
" \"{ = call DBMS_METADATA.GET_DDL( , , , 'COMPATIBLE' , 'ORACLE' , 'DDL' ) }\" \n" +
"-returntype number corresponding to java.sql.Types.CLOB (2005) or java.sql.Types.VARCHAR (12) [default: java.sql.Types.CLOB].\n" +
"-url Database URL, for example jdbc:oracle:thin:@HOST:PORT:SID, jdbc:oracle:thin:@HOST:PORT/SERVICE, jdbc:edb://HOST:PORT/DATABASE,\n" +
" or jdbc:postgresql://HOST:PORT/DATABASE [default: none].\n" +
" Required when generating from the Oracle dictionary.\n" +
"-user Schema name.\n" +
" Required when generating from the Oracle dictionary. The user name is\n" +
" case sensitive since Oracle stores user/schema names like \"My schema\" (name wit \n" +
" double quotes) as 'My schema' in the dictionary. Ordinary schema names\n" +
" like scott are stored as 'SCOTT' (upper case).\n" +
"-password Password of the logon user.\n" +
" Required when generating from the Oracle dictionary.\n" +
"-types