Package org.tweetyproject.plugin
Class AbstractTweetyPlugin
java.lang.Object
org.tweetyproject.plugin.AbstractTweetyPlugin
- All Implemented Interfaces:
net.xeoh.plugins.base.Plugin
,TweetyPlugin
- Direct Known Subclasses:
FirstOrderLogicPlugin
,PlPlugin
,PreferencesPlugin
,RPCLPlugin
This abstract class implements the TweetyPlugin interface and provides a base
for plugin implementations in each project
- Author:
- Bastian Wolf
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(CommandParameter cmdParameter) adds new command parameter to this pluginabstract PluginOutput
execute
(File[] input, CommandParameter[] params) executes the given inputabstract String
returns the command this plugin is called withreturns all possible parameterschecks, whether each command parameter given with the plugin call is valid within is this pluginThis method handels instantiations with array-lists instead of a simple string (e.g.
-
Constructor Details
-
AbstractTweetyPlugin
public AbstractTweetyPlugin()Default Constructor
-
-
Method Details
-
getCommand
returns the command this plugin is called with- Specified by:
getCommand
in interfaceTweetyPlugin
- Returns:
- the keyword used in the cli to call this plugin
-
execute
executes the given input- Specified by:
execute
in interfaceTweetyPlugin
- Parameters:
input
- files to be used within the pluginparams
- parameter handled in the plugin (e.g. desired output file, iterations...)- Returns:
- the output resulted after the execution
-
addParameter
adds new command parameter to this plugin- Parameters:
cmdParameter
- the command parameter to be added
-
getParameters
returns all possible parameters- Specified by:
getParameters
in interfaceTweetyPlugin
- Returns:
- parameters allowed with plugin calls
-
validateParameter
checks, whether each command parameter given with the plugin call is valid within is this plugin- Parameters:
s
- the given parameter string- Returns:
- a newly instantiated command parameter with the given value
- Throws:
CloneNotSupportedException
- if cloning is not supported
-
validateParameter
public ArrayList<CommandParameter> validateParameter(ArrayList<String> s) throws CloneNotSupportedException This method handels instantiations with array-lists instead of a simple string (e.g. for multi-argument parameter)- Parameters:
s
- the ArrayList<String> containing the input parameter- Returns:
- the newly instantiated command parameter with the given value
- Throws:
CloneNotSupportedException
- if cloning is not supported
-