public abstract class AbstractCommandLineMode extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCommandLineMode(String jarFilename) |
| Modifier and Type | Method and Description |
|---|---|
abstract AbstractCommandLineMode |
configure(String[] args)
Configure the mode via command line arguments.
|
abstract void |
execute()
Execute the mode.
|
String |
getJarFilename() |
abstract String |
getModeDescription()
Returns the mode description defined by subclasses.
|
abstract String |
getModeName()
Returns the mode name defined by subclasses.
|
String |
getShortModeName()
The short version of the mode name.
|
com.martiansoftware.jsap.JSAP |
loadJsapFromResource()
Load JSAP from resource with no modifications to help / defaults.
|
com.martiansoftware.jsap.JSAP |
loadJsapFromResource(Map<String,String> helpValues)
Load JSAP XML configuration for the current class.
|
com.martiansoftware.jsap.JSAPResult |
parseJsap(com.martiansoftware.jsap.JSAP jsap,
String[] args)
Parse the JSAP to JSAPResult.
|
protected com.martiansoftware.jsap.JSAPResult |
parseJsapArguments(String[] args)
Parse the JSAP arguments defined for the mode.
|
protected com.martiansoftware.jsap.JSAPResult |
parseJsapArguments(String[] args,
Map<String,String> helpValues)
Parse the JSAP arguments defined for the mode.
|
protected void |
printDynamicHelpOptions(com.martiansoftware.jsap.JSAP jsap) |
void |
printUsage(com.martiansoftware.jsap.JSAP jsap)
Print usage for the mode.
|
void |
printUsageAsHtmlTable(com.martiansoftware.jsap.JSAP jsap)
Print the usage for a mode in the format appropriate for a table in HTML.
|
void |
printUsageAsWikiTable(com.martiansoftware.jsap.JSAP jsap)
Print the usage for a mode in the format appropriate for a
Wikimedia table.
|
void |
setJarFilename(String jarFilename) |
protected AbstractCommandLineMode(String jarFilename)
public String getJarFilename()
public void setJarFilename(String jarFilename)
public abstract String getModeName()
public String getShortModeName()
public abstract String getModeDescription()
public void printUsage(com.martiansoftware.jsap.JSAP jsap)
jsap - the configured JSAP objectpublic void printUsageAsWikiTable(com.martiansoftware.jsap.JSAP jsap)
jsap - The parameters for the modepublic void printUsageAsHtmlTable(com.martiansoftware.jsap.JSAP jsap)
jsap - The parameters for the modepublic com.martiansoftware.jsap.JSAP loadJsapFromResource()
throws IOException,
com.martiansoftware.jsap.JSAPException
IOException - error reading or configuringcom.martiansoftware.jsap.JSAPException - error reading or configuringpublic com.martiansoftware.jsap.JSAP loadJsapFromResource(Map<String,String> helpValues) throws IOException, com.martiansoftware.jsap.JSAPException
helpValues - a map of values to replace in the jsap help with other valuesIOException - error reading or configuringcom.martiansoftware.jsap.JSAPException - error reading or configuringpublic com.martiansoftware.jsap.JSAPResult parseJsap(com.martiansoftware.jsap.JSAP jsap,
String[] args)
jsap - the parser to use when parsing argumentsargs - the arguments to parseprotected void printDynamicHelpOptions(com.martiansoftware.jsap.JSAP jsap)
public abstract AbstractCommandLineMode configure(String[] args) throws IOException, com.martiansoftware.jsap.JSAPException
args - command line argumentsIOException - error configuringcom.martiansoftware.jsap.JSAPException - error configuringpublic abstract void execute()
throws IOException
IOException - io errorprotected com.martiansoftware.jsap.JSAPResult parseJsapArguments(String[] args, Map<String,String> helpValues) throws IOException, com.martiansoftware.jsap.JSAPException
args - command line arguments.helpValues - A map of option names to help stringsIOException - if there was a problem configuring the parsercom.martiansoftware.jsap.JSAPException - if there was a problem parsing the argsloadJsapFromResource(),
loadJsapFromResource(java.util.Map)protected com.martiansoftware.jsap.JSAPResult parseJsapArguments(String[] args) throws IOException, com.martiansoftware.jsap.JSAPException
args - command line arguments.IOException - if there was a problem parsing the help textcom.martiansoftware.jsap.JSAPException - if there was a problem parsing the argsloadJsapFromResource(),
loadJsapFromResource(java.util.Map)Copyright © 2017 Campagne Laboratory. All rights reserved.