public class JCleanCim
extends java.lang.Object
Most of configuration currently needs to be specified in ./config/ "config.properties" file. Command line arguments allow you to:
We use apache command line argument library here as it gives nice help :-) If we need more configuration/filtering, best would be to do that in ./config/ "config.properties" file and not with command line options (we could end up in a mess of what is defined on cmd line, and what in properties file).
Implementation note: To add new command line arguments, follow examples in the constructor. To
add functionality for validation, statistics, profile crosschek and doc generation (from UML or
from profiles), implement methods on UmlModel
class and call them from
validate(UmlModel)
, collectStatistics(UmlModel)
,
crossCheck(UmlModel, UmlModel)
and generateDoc(UmlModel)
methods, respectively.
Modifier and Type | Field and Description |
---|---|
private Config |
_cfg |
private static org.apache.log4j.Logger |
_logger |
private boolean |
_printHelp |
private boolean |
_printVersion |
Modifier | Constructor and Description |
---|---|
private |
JCleanCim(java.lang.String[] args)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
UmlModel |
buildFromEA()
Builds the model from EA file given in configuration or on command line.
|
UmlModel |
buildFromProfiles()
Builds the model from all profiles found under the /input/profiles directory.
|
void |
collectStatistics(UmlModel model)
Collects statistics for the model and logs them.
|
UmlModel |
createEmptyModel()
Creates empty model.
|
void |
crossCheck(UmlModel profilesModel,
UmlModel umlModel)
Performs cross-check between the set of profiles and the UML model.
|
void |
generateDoc(UmlModel model)
Generates documentation for the model in the format specified in configuration through output
file extension.
|
private Config |
getCfg() |
private boolean |
isPrintHelpOnly() |
private boolean |
isPrintVersionOnly() |
private static void |
logApplicationVersion() |
private static void |
logExecutionEnvironment(org.apache.log4j.Level level) |
static void |
main(java.lang.String[] args)
This command-line application first populates its model from full .eap file and/or profiles
(to allow for different kinds of analysis afterwards), then selectively runs validation,
statistics, profile-model cross-checking and MS Word document generation.
|
(package private) static void |
pause() |
void |
validate(UmlModel model)
Validates the model.
|
private static final org.apache.log4j.Logger _logger
private final Config _cfg
private final boolean _printHelp
private final boolean _printVersion
private JCleanCim(java.lang.String[] args) throws ApplicationException
Implementation note: If you add command line arguments, run jCleanCim with only -help command
line argument and update the doc of main(String[])
with what is printed on screen.
args
- ApplicationException
public static void main(java.lang.String[] args) throws ApplicationException, java.io.IOException
-propFile
command line option).
usage: jCleanCim -help print this message -version print application version -modelFile <*.eap> name of the model file to use instead of one defined in config properties -propFile <*.properties> name of the config properties file to use instead of default
ApplicationException
java.io.IOException
static void pause() throws java.io.IOException
java.io.IOException
private static void logExecutionEnvironment(org.apache.log4j.Level level)
private static void logApplicationVersion()
public UmlModel buildFromEA() throws ApplicationException
ApplicationException
public UmlModel buildFromProfiles() throws ApplicationException
ApplicationException
public UmlModel createEmptyModel() throws ApplicationException
ApplicationException
public void validate(UmlModel model)
model
- public void collectStatistics(UmlModel model)
model
- public void crossCheck(UmlModel profilesModel, UmlModel umlModel)
profilesModel
- umlModel
- public void generateDoc(UmlModel model) throws ApplicationException, java.io.IOException
UnsupportedOutputFormatException
- if the requested format (extension) of the output file is not supported.java.io.IOException
- on any file system-related problem.ApplicationException
private boolean isPrintHelpOnly()
private boolean isPrintVersionOnly()
private Config getCfg()
Copyright 2009-2015 Tatjana (Tanja) Kostic