Package org.tweetyproject.cli.plugins
Class CliMain
java.lang.Object
org.tweetyproject.cli.plugins.CliMain
skeleton of the new main method of this CLI using plugins.
- Author:
- Bastian Wolf
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The argument name for the called pluginstatic final String
The argument name for the called plugin (short)static final String
The argument name for debugging outputstatic final String
The argument name for debugging output (short)static final String
The argument name for the input file(s)static final String
The argument name for the input file(s) (short)static final String
The argument name for the output filestatic final String
The argument name for the output file (short)static final String
help textstatic final String
config -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis method is meant to load the tweety plugin pathes on startupstatic ArrayList
<CommandParameter> instantiateParameters
(TweetyPlugin tp, ArrayList<ArrayList<String>> inparams) instantiates each given input parameter within the called plugin - if possiblestatic void
Examplevoid
This function allows to print the content of the current configuration file.static void
prints help text if cli is called with parameter "--help" or empty argument arrayvoid
settervoid
setHelptextPath
(String path) setter
-
Field Details
-
HELPTEXT
-
TWEETY_CLI_DEFAULT_CONFIG
-
ARG__CALLED_PLUGIN
-
ARG__CALLED_PLUGIN_SHORT
The argument name for the called plugin (short)- See Also:
-
ARG__INPUT_FILES
-
ARG__INPUT_FILES_SHORT
The argument name for the input file(s) (short)- See Also:
-
ARG__OUTPUT_FILE
-
ARG__OUTPUT_FILE_SHORT
The argument name for the output file (short)- See Also:
-
ARG__DEBUG_FLAG
-
ARG__DEBUG_FLAG_SHORT
The argument name for debugging output (short)- See Also:
-
-
Constructor Details
-
CliMain
public CliMain()
-
-
Method Details
-
printHelpText
public static void printHelpText()prints help text if cli is called with parameter "--help" or empty argument array -
configCLI
public static Map<String,String> configCLI() throws org.apache.commons.configuration.ConfigurationException, FileNotFoundExceptionThis method is meant to load the tweety plugin pathes on startup- Returns:
- an object with one or more pluginpathes
- Throws:
org.apache.commons.configuration.ConfigurationException
- if there is an issue with the configurationFileNotFoundException
- if the file could not be found
-
printConfiguration
public void printConfiguration()This function allows to print the content of the current configuration file. It consists of pairs of each available plugin an its path. -
setConfigurationFilePath
-
setHelptextPath
-
instantiateParameters
public static ArrayList<CommandParameter> instantiateParameters(TweetyPlugin tp, ArrayList<ArrayList<String>> inparams) throws CloneNotSupportedException instantiates each given input parameter within the called plugin - if possible- Parameters:
tp
- the called Tweety-Plugin Implementationinparams
- the parameter given as input- Returns:
- an ArrayList of instantiated CommandParameter
- Throws:
CloneNotSupportedException
- if the CommandParameter does not implement Cloneable
-
main
-