Package net.sf.tweety.cli.plugins
Class CliMain
- java.lang.Object
-
- net.sf.tweety.cli.plugins.CliMain
-
public class CliMain extends java.lang.Objectskeleton of the new main method of this CLI using plugins.- Author:
- Bastian Wolf
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringARG__CALLED_PLUGINThe argument name for the called pluginstatic java.lang.StringARG__CALLED_PLUGIN_SHORTThe argument name for the called plugin (short)static java.lang.StringARG__DEBUG_FLAGThe argument name for debugging outputstatic java.lang.StringARG__DEBUG_FLAG_SHORTThe argument name for debugging output (short)static java.lang.StringARG__INPUT_FILESThe argument name for the input file(s)static java.lang.StringARG__INPUT_FILES_SHORTThe argument name for the input file(s) (short)static java.lang.StringARG__OUTPUT_FILEThe argument name for the output filestatic java.lang.StringARG__OUTPUT_FILE_SHORTThe argument name for the output file (short)static java.lang.StringHELPTEXTprivate static java.io.File[]inputFilesthe list of input filesprivate static java.lang.StringoutputFilethe output fileprivate static java.lang.Stringpluginthe called pluginstatic java.lang.StringTWEETY_CLI_DEFAULT_CONFIG
-
Constructor Summary
Constructors Constructor Description CliMain()
-
Method Summary
Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>configCLI()This method is meant to load the tweety plugin pathes on startupstatic java.util.ArrayList<CommandParameter>instantiateParameters(TweetyPlugin tp, java.util.ArrayList<java.util.ArrayList<java.lang.String>> inparams)instantiates each given input parameter within the called plugin - if possiblestatic voidmain(java.lang.String[] args)voidprintConfiguration()This function allows to print the content of the current configuration file.static voidprintHelpText()prints help text if cli is called with parameter "--help" or empty argument arrayvoidsetConfigurationFilePath(java.lang.String path)voidsetHelptextPath(java.lang.String path)
-
-
-
Field Detail
-
HELPTEXT
public static final java.lang.String HELPTEXT
- See Also:
- Constant Field Values
-
TWEETY_CLI_DEFAULT_CONFIG
public static final java.lang.String TWEETY_CLI_DEFAULT_CONFIG
- See Also:
- Constant Field Values
-
ARG__CALLED_PLUGIN
public static final java.lang.String ARG__CALLED_PLUGIN
The argument name for the called plugin- See Also:
- Constant Field Values
-
ARG__CALLED_PLUGIN_SHORT
public static final java.lang.String ARG__CALLED_PLUGIN_SHORT
The argument name for the called plugin (short)- See Also:
- Constant Field Values
-
ARG__INPUT_FILES
public static final java.lang.String ARG__INPUT_FILES
The argument name for the input file(s)- See Also:
- Constant Field Values
-
ARG__INPUT_FILES_SHORT
public static final java.lang.String ARG__INPUT_FILES_SHORT
The argument name for the input file(s) (short)- See Also:
- Constant Field Values
-
ARG__OUTPUT_FILE
public static final java.lang.String ARG__OUTPUT_FILE
The argument name for the output file- See Also:
- Constant Field Values
-
ARG__OUTPUT_FILE_SHORT
public static final java.lang.String ARG__OUTPUT_FILE_SHORT
The argument name for the output file (short)- See Also:
- Constant Field Values
-
ARG__DEBUG_FLAG
public static final java.lang.String ARG__DEBUG_FLAG
The argument name for debugging output- See Also:
- Constant Field Values
-
ARG__DEBUG_FLAG_SHORT
public static final java.lang.String ARG__DEBUG_FLAG_SHORT
The argument name for debugging output (short)- See Also:
- Constant Field Values
-
plugin
private static java.lang.String plugin
the called plugin
-
inputFiles
private static java.io.File[] inputFiles
the list of input files
-
outputFile
private static java.lang.String outputFile
the output file
-
-
Method Detail
-
printHelpText
public static void printHelpText()
prints help text if cli is called with parameter "--help" or empty argument array
-
configCLI
public static java.util.Map<java.lang.String,java.lang.String> configCLI() throws org.apache.commons.configuration.ConfigurationException, java.io.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 configurationjava.io.FileNotFoundException- 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
public void setConfigurationFilePath(java.lang.String path)
-
setHelptextPath
public void setHelptextPath(java.lang.String path)
-
instantiateParameters
public static java.util.ArrayList<CommandParameter> instantiateParameters(TweetyPlugin tp, java.util.ArrayList<java.util.ArrayList<java.lang.String>> inparams) throws java.lang.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:
java.lang.CloneNotSupportedException- if the CommandParameter does not implement Cloneable
-
main
public static void main(java.lang.String[] args)
-
-