Class CommandLineExecuter

java.lang.Object
net.ssehub.easy.standalone.cmd.CommandLineExecuter

public class CommandLineExecuter extends Object
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 Details

    • LOGGER

      private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger LOGGER
    • OPTIONS

      private static final List<String> OPTIONS
    • OPT_RESULTFILE

      private static final String 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

      public static void main(String[] args)
      Main method for testing.
      Parameters:
      args - Specification which method shall be executed. Also possibility to pass arguments to the selected method.
    • instantiateSelf

      private static int instantiateSelf(String[] args, Map<String,String> options)
      Handles the instantiateSelf method calls.
      Parameters:
      args - The arguments for the instantiateSelf method calls.
      options - additional command line options extracted from args
      Returns:
      command line result value
    • instantiate

      private static int instantiate(String[] args, Map<String,String> options)
      Handles the instantiate method calls.
      Parameters:
      args - The arguments for the instantiate method calls.
      options - additional command line options extracted from args
      Returns:
      command line result value
    • checkForOption

      private static boolean checkForOption(String arg, Map<String,String> options)
      Checks an argument for a known option.
      Parameters:
      arg - the argument to check
      options - the optional option result (to be modified as a side effect)
      Returns:
      true if arg is an option and has been stored in options if not null, false else (usual command line argument)
    • pruneArguments

      private static String[] pruneArguments(String[] args, Map<String,String> options)
      Prunes the argument list for known options.
      Parameters:
      args - the arguments to check
      options - the optional option result (to be modified as a side effect)
      Returns:
      the pruned arguments
    • pullConfig

      private static int pullConfig(String[] args, Map<String,String> options, boolean add)
      Pulls the configuration.
      Parameters:
      args - The arguments for the validity check.
      options - additional command line options extracted from args
      add - add or remove the specified predecessors
      Returns:
      command line result value
    • createPLP

      private static int createPLP(String[] args, Map<String,String> options, boolean add)
      Creates a PLP.
      Parameters:
      args - The arguments for the validity check.
      options - additional command line options extracted from args
      add - add or remove the specified predecessors
      Returns:
      command line result value
    • setPredecessors

      private static int setPredecessors(String[] args, Map<String,String> options, boolean add)
      Modifies the predecessors.
      Parameters:
      args - The arguments for the validity check.
      options - additional command line options extracted from args
      add - add or remove the specified predecessors
      Returns:
      command line result value
    • checkValidity

      private static int checkValidity(String[] args, Map<String,String> options)
      Handles the validity check calls.
      Parameters:
      args - The arguments for the validity check.
      options - additional command line options extracted from args
      Returns:
      command line result value