public class ConversionDriver extends TransformDriver
This program provides a command line interface. See main(java.lang.String[])
for the
syntax.
Modifier and Type | Class and Description |
---|---|
private static class |
ConversionDriver.CvtRunMode
Container class that aggregates a set of options to control a run of the conversion
driver.
|
TransformDriver.ExcludeCheck, TransformDriver.JobDefinition, TransformDriver.ListType, TransformDriver.ScanCheck
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
codenames
Match list for source code name conversion.
|
private FileList |
dp2os
The list of database P2O files.
|
private FileList |
dschemas
The list of database schema files.
|
private java.lang.String[] |
frames
Java ASTs (abstract syntax trees) created during frame generation.
|
private static java.lang.String[] |
helpText
Help text, which needs to be implemented in each subclass.
|
private FileList |
jasts
The list of Java AST (abstract syntax tree) files.
|
private java.lang.String[] |
menus
Java ASTs (abstract syntax trees) created during menus generation.
|
private static java.util.Map<java.lang.String,RunMode> |
modes
Associates mode names with detailed mode definitions.
|
private FileList |
sp2os
The list of Progress source file specific P2O files.
|
private static java.lang.String |
TITLE
Job title, which needs to be implemented in each subclass.
|
Constructor and Description |
---|
ConversionDriver(TransformDriver.JobDefinition job)
Creates an instance with a specific configuration.
|
Modifier and Type | Method and Description |
---|---|
protected void |
back()
Drive the back end of the conversion process using the file list
of Progress AST files that is already defined in this instance.
|
private void |
brew(FileList files,
java.lang.String extra)
Convert Java AST (JAST) files into Java source code (
.java
files). |
private void |
convertSourceNamesToJavaAstNames()
Using the source name list as input, this method creates duplicate
lists with the proper
.ast or .jast file
suffixes on each entry. |
private void |
generateDDL(java.lang.String ddlType,
java.util.List<java.lang.String> schemas,
java.lang.String dialectList,
java.lang.String ruleset)
For each .p2o file associated with a schema and for each specified dialect, generate the
specified type of DDL.
|
private FileList |
generateDMOs(boolean skipDBSchema)
Drives the execution of the DMO creation rule-set using the P2O lists
as input and capturing the list of Java AST files generated.
|
private void |
generateFrames()
Drives the execution of the frame generator rule-set using the Progress
ASTs as input and capturing the list of Java AST files generated.
|
private void |
generateMenus()
Drives the execution of the frame generator rule-set using the Progress
ASTs as input and capturing the list of Java AST files generated.
|
(package private) static void |
generateWsdls(int debug)
Gather all SOAP operations from all files, regardless if they are included in the incremental conversion
or not, and generate the WSDLs.
|
static void |
main(java.lang.String[] args)
Provides a command line interface for an end user to drive the scanning harness.
|
protected void |
middle()
Drive the middle of the conversion process using the schema dictionary
lists generated from the output of the
SchemaLoader and
the file list of Progress AST files that is already defined in this
instance. |
cleanScanResults, convertSourceNamesToAstNames, convertSourceNamesToDictNames, createDatabaseList, deleteFiles, deleteFileSpecs, escapeRegex, executeJob, front, interpretRunMode, omitSchemaMetadata, printElapsed, printHeader, processCommandLine, processTrees, processTrees, replaceFilenameExtension, runCallGraphGenerator, runScanDriver, runSchemaLoader, syntax, zapFiles
private static final java.lang.String codenames
private static final java.util.Map<java.lang.String,RunMode> modes
private static final java.lang.String[] helpText
private static final java.lang.String TITLE
private FileList jasts
private java.lang.String[] frames
private java.lang.String[] menus
private FileList dschemas
private FileList dp2os
private FileList sp2os
ConversionDriver(TransformDriver.JobDefinition job)
job
- The details of this driver run.protected void middle() throws ConfigurationException, AstException, SchemaException, java.io.IOException
SchemaLoader
and
the file list of Progress AST files that is already defined in this
instance.
This runs the following:
.java
)
middle
in class TransformDriver
ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.SchemaException
- If there is a problem with the schema.java.io.IOException
- If there is a problem with I/O.protected void back() throws ConfigurationException, AstException, SchemaException, java.io.IOException
This runs the following:
.java
)
back
in class TransformDriver
ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.SchemaException
- If there is a problem with the schema.java.io.IOException
- If there is a problem with I/O.static void generateWsdls(int debug) throws AstException, ConfigurationException
debug
- The debug level.ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.private void generateFrames() throws AstException, ConfigurationException
ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.private void generateDDL(java.lang.String ddlType, java.util.List<java.lang.String> schemas, java.lang.String dialectList, java.lang.String ruleset) throws ConfigurationException
This is done by calling the ruleset specified and setting the dbName
and
targetDb
parameters accordingly.
ddlType
- Type of DDL being generated (used only for console message).schemas
- List of names of schemas to process.dialectList
- List of database dialects for which to generate DDL or null
if this
information is to be read from the configuration.ruleset
- Name of ruleset to execute (without file extension suffix).ConfigurationException
- if the schema configuration can't be loaded.private FileList generateDMOs(boolean skipDBSchema) throws AstException, ConfigurationException
skipDBSchema
- true
if the physical DB schemas are not processed.ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.private void generateMenus() throws AstException, ConfigurationException
ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.private void brew(FileList files, java.lang.String extra) throws ConfigurationException, AstException
.java
files). The output is written into the configured project's output
path.files
- The list of JAST files to process.extra
- Text to append to the displayed header.ConfigurationException
- If there is problem reading/parsing the configuration.AstException
- If there is an problem processing ASTs.private void convertSourceNamesToJavaAstNames()
.ast
or .jast
file
suffixes on each entry. Appended to this list is the list of Java ASTs
created during frame generation. The results are saved into the
Java AST name list.public static void main(java.lang.String[] args)
The program will return a non-zero code if there is a fatal error running the conversion.
Syntax:
java -DP2J_HOME=<home> ConversionDriver [-options]* <mode> <file-specs>
Where:
MSG_NONE
(0) and
MSG_TRACE
(3) inclusive
<file-specs>
is a <filename>
containing a custom FILE-LIST, instead of
using the explicit command line file list
<file-specs>
is composed of a root <directory>
and a "<file-filter>"
, to select SPECIFIC files instead of an explicit command line file list
<file-specs>
is similar to S but has an additional custom EXCLUDE list file
"<filename>"
to be ignored
<file-filter>
(S options)",
<file-set>
is a <filename>
containing the definition file list and
Include plus eXclude operations to be applied on it,
>=
0; defaults to 1; set to 0 to use 1 thread per available CPU)
WARNING: this mode is not compatible if there are legacy .cls files
<name>
of the configuration PROFILE follows the option
mode
(one or more of the following values, use '+' to delimit if there are two or more
values; don't insert spaces!):
<filelist>
is arbitrary list of absolute and/or relative file names to scan, this
list is hard coded in the command line itself
<filename>
is a single absolute or relative filename of a text file that contains a
custom list of absolute and/or relative file names of files to scan
<directory>
is the root directory to search for files
"filespec"
is the file specification that will be used to create a list of files to
process, should be enclosed in double quotes if any of the wildcard characters '*' or '?'
are used
<directory>
is the root directory to search for files
"filespec"
" is the file specification that will be used to create a list of files
to process, should be enclosed in double quotes if any of the wildcard characters '*' or
'?' are used
<filename>
is a single absolute or relative filename of a text file that contains a
custom list of specifications of file names to ignore
filespec
which are not matched by the ignore list
are scanned as they would be in filespec
mode.
args
- List of command line arguments.