Package net.ssehub.easy.standalone.cmd
Class CommandLineExecuter
java.lang.Object
net.ssehub.easy.standalone.cmd.CommandLineExecuter
Class for executing EASy commands via the command line. Potential
system return values:
CmdConstants. The result file (by default .result) can be defined via the
command line option --resultFile=<i>fileOrFolder</i> (no spaces around "=").- Author:
- El-Sharkawy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancheckForOption(String arg, Map<String, String> options) Checks an argument for a known option.private static intcheckValidity(String[] args, Map<String, String> options) Handles the validity check calls.private static intCreates a PLP.private static intinstantiate(String[] args, Map<String, String> options) Handles the instantiate method calls.private static intinstantiateSelf(String[] args, Map<String, String> options) Handles the instantiateSelf method calls.static voidMain method for testing.private static voidPrints the command line help.private static String[]pruneArguments(String[] args, Map<String, String> options) Prunes the argument list for known options.private static intpullConfig(String[] args, Map<String, String> options, boolean add) Pulls the configuration.private static intsetPredecessors(String[] args, Map<String, String> options, boolean add) Modifies the predecessors.
-
Field Details
-
LOGGER
private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger LOGGER -
OPTIONS
-
OPT_RESULTFILE
- See Also:
-
DEBUG
private static final boolean DEBUG
-
-
Constructor Details
-
CommandLineExecuter
public CommandLineExecuter()
-
-
Method Details
-
printHelp
private static void printHelp()Prints the command line help. -
main
Main method for testing.- Parameters:
args- Specification which method shall be executed. Also possibility to pass arguments to the selected method.
-
instantiateSelf
Handles the instantiateSelf method calls.- Parameters:
args- The arguments for the instantiateSelf method calls.options- additional command line options extracted fromargs- Returns:
- command line result value
-
instantiate
Handles the instantiate method calls.- Parameters:
args- The arguments for the instantiate method calls.options- additional command line options extracted fromargs- Returns:
- command line result value
-
checkForOption
Checks an argument for a known option.- Parameters:
arg- the argument to checkoptions- the optional option result (to be modified as a side effect)- Returns:
trueifargis an option and has been stored inoptionsif not null,falseelse (usual command line argument)
-
pruneArguments
Prunes the argument list for known options.- Parameters:
args- the arguments to checkoptions- the optional option result (to be modified as a side effect)- Returns:
- the pruned arguments
-
pullConfig
Pulls the configuration.- Parameters:
args- The arguments for the validity check.options- additional command line options extracted fromargsadd- add or remove the specified predecessors- Returns:
- command line result value
-
createPLP
Creates a PLP.- Parameters:
args- The arguments for the validity check.options- additional command line options extracted fromargsadd- add or remove the specified predecessors- Returns:
- command line result value
-
setPredecessors
Modifies the predecessors.- Parameters:
args- The arguments for the validity check.options- additional command line options extracted fromargsadd- add or remove the specified predecessors- Returns:
- command line result value
-
checkValidity
Handles the validity check calls.- Parameters:
args- The arguments for the validity check.options- additional command line options extracted fromargs- Returns:
- command line result value
-