Package org.incenp.obofoundry.uberon
Class BasePlugin
java.lang.Object
org.incenp.obofoundry.uberon.BasePlugin
- All Implemented Interfaces:
org.obolibrary.robot.Command
- Direct Known Subclasses:
InferenceDiffCommand,MergeEquivalentSetsCommand,MergeSpeciesCommand,SpeciesSubsetCommand
Helper base class for ROBOT commands.
This class is intended to serve as a base class for ROBOT commands, to avoid
duplicating boilerplate across several commands. Subclasses should call the
constructor with the desired name, description, and help message, add any
option they need, and implement the
performOperation(org.obolibrary.robot.CommandState,org.apache.commons.cli.CommandLine) method.-
Field Summary
FieldsFields inherited from interface org.obolibrary.robot.Command
global, missingFileError -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBasePlugin(String name, String description, String usage) Creates a new command. -
Method Summary
Modifier and TypeMethodDescriptionorg.obolibrary.robot.CommandStateprotected org.obolibrary.robot.IOHelperprotected org.semanticweb.owlapi.model.IRICreate an IRI from a user-specified source.getName()org.apache.commons.cli.OptionsgetUsage()voidabstract voidperformOperation(org.obolibrary.robot.CommandState state, org.apache.commons.cli.CommandLine line) Perform whatever operation the command is supposed to do.
-
Field Details
-
options
protected org.apache.commons.cli.Options options
-
-
Constructor Details
-
BasePlugin
Creates a new command.- Parameters:
name- The command name, as it should be invoked on the command line.description- The description of the command that ROBOT will display.usage- The help message for the command.
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceorg.obolibrary.robot.Command
-
getDescription
- Specified by:
getDescriptionin interfaceorg.obolibrary.robot.Command
-
getUsage
- Specified by:
getUsagein interfaceorg.obolibrary.robot.Command
-
getOptions
public org.apache.commons.cli.Options getOptions()- Specified by:
getOptionsin interfaceorg.obolibrary.robot.Command
-
main
- Specified by:
mainin interfaceorg.obolibrary.robot.Command
-
execute
public org.obolibrary.robot.CommandState execute(org.obolibrary.robot.CommandState state, String[] args) throws Exception - Specified by:
executein interfaceorg.obolibrary.robot.Command- Throws:
Exception
-
performOperation
public abstract void performOperation(org.obolibrary.robot.CommandState state, org.apache.commons.cli.CommandLine line) throws Exception Perform whatever operation the command is supposed to do.- Parameters:
state- The internal state of ROBOT.line- The command line used to invoke the command.- Throws:
Exception- If any error occurred when attempting to execute the operation.
-
getIRI
Create an IRI from a user-specified source. This delegates the task of expanding CURIEs to ROBOT, which may use whatever informations it has (such as prefix mappings specified using the --prefix option).- Parameters:
term- the term to transform into an IRI.field- The source where the term comes from. Used in ROBOT's error message, if the term cannot be transformed into an IRI.- Returns:
- The resulting IRI.
-
getIOHelper
protected org.obolibrary.robot.IOHelper getIOHelper()
-