Class AbstractUserArgumentProcessor
- java.lang.Object
-
- org.biojava.nbio.structure.align.ce.AbstractUserArgumentProcessor
-
- All Implemented Interfaces:
UserArgumentProcessor
- Direct Known Subclasses:
CeUserArgumentProcessor
,FatCatUserArgumentProcessor
,SmithWatermanUserArgumentProcessor
public abstract class AbstractUserArgumentProcessor extends Object implements UserArgumentProcessor
Base class for a new structure alignment CLI.To add a new StructureAlignment with a CLI similar to CE or FATCAT,
- Implement StructureAlignment with the main algorithm
- Implement ConfigStrucAligParams. This provides the parameters for the GUI.
- Subclass StartupParameters (can be an inner class) with the same parameters described in the ConfigStrucAligParams.
- Subclass AbstractUserArgumentProcessor, with the getStartupParams() method returning a fresh instance of the custom StartupParameters
- Implement the getParameters() method to copy values from the StartupParameters to the ConfigStrucAligParams.
Note that reflection is used in a number of places, so the CLI argument names must match the get/set functions in both parameter beans.
- AlignmentGUI automatically takes parameter names and types from the ConfigStrucAligParams
- AbstractUserArgumentProcessor also takes parameter names and help descriptions from ConfigStrucAligParams, but it saves arguments to the StartupParameter bean.
- Author:
- Andreas, Spencer
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>
mandatoryArgs
static String
newline
protected StartupParameters
params
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractUserArgumentProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StructureAlignment
getAlgorithm()
abstract String
getDbSearchLegend()
String
getDbSearchResult(AFPChain afpChain)
abstract Object
getParameters()
protected abstract StartupParameters
getStartupParametersInstance()
StartupParameters is a bean to store all the possible command line parameters.static void
printAboutMe()
String
printHelp()
Print help about the argumentsvoid
process(String[] argv)
Process user arguments that have been provided from the command line
-
-
-
Field Detail
-
params
protected StartupParameters params
-
mandatoryArgs
public static final List<String> mandatoryArgs
-
-
Constructor Detail
-
AbstractUserArgumentProcessor
protected AbstractUserArgumentProcessor()
-
-
Method Detail
-
getStartupParametersInstance
protected abstract StartupParameters getStartupParametersInstance()
StartupParameters is a bean to store all the possible command line parameters. The `StartupParameter` class contains the basic set of CLI parameters common to all `StructureAligmnent`s. This method should return a subclass of StartupParameters which has been extended to store values for all additional parameters.- Returns:
- A new instance of the correct StartupParameters subclass
-
getAlgorithm
public abstract StructureAlignment getAlgorithm()
-
getParameters
public abstract Object getParameters()
-
getDbSearchLegend
public abstract String getDbSearchLegend()
-
process
public void process(String[] argv)
Description copied from interface:UserArgumentProcessor
Process user arguments that have been provided from the command line- Specified by:
process
in interfaceUserArgumentProcessor
-
printAboutMe
public static void printAboutMe()
-
getDbSearchResult
public String getDbSearchResult(AFPChain afpChain)
-
printHelp
public String printHelp()
Description copied from interface:UserArgumentProcessor
Print help about the arguments- Specified by:
printHelp
in interfaceUserArgumentProcessor
- Returns:
-
-