|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.fhcrc.cpl.viewer.CommandFileRunner
public class CommandFileRunner
Provides macro-running functionality in MSInspect. Knows how to read commands and arguments form a macro file in the following format: -Comment lines begin with # and are ignored -Commands begin immediately on a given line. Anything other than a comment that begins immediately at the start of a line is considered a command -Arguments start with a tab character. Anything other than a comment that begins with a tab is considered an argument. Arguments are of the format NAME=VALUE. For this reason, '=' is not currently allowed in arguments. For unnamed arguments, simply us a tab followed by the argument value -Arguments for a given command should follow directly after that command All handling of individual macro commands is spelled out here. In general it's desirable to have these macros follow the same code path as the UI, to the greatest extent possible
| Nested Class Summary | |
|---|---|
static class |
CommandFileRunner.CommandFileRunnerAction
action for the menu item that kicks macro-running off |
| Constructor Summary | |
|---|---|
CommandFileRunner()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
createCommandFileEntry(java.lang.String commandName,
java.util.Map<java.lang.String,java.lang.String> argumentMap)
Utility method to create a command, for use in a command file, based on a command name and argument map |
static java.util.Map<java.lang.String,java.lang.String> |
getArguments(java.io.BufferedReader reader,
CommandLineModule module)
Gobbles a list of arguments, stopping when it hits eof or a protein definition. |
static java.lang.String |
getNextCommand(java.io.BufferedReader reader)
skips past any argument lines to the next command, in my funky file format TODO: this should probably be reimplemented as an Iterator |
protected static void |
macroError()
print out a generic error message |
protected static void |
macroMissingArguments()
print out a missing-arguments error message |
protected static Pair<java.lang.String,java.lang.String> |
processArgument(java.lang.String argument,
CommandLineModule module)
split an argument around an = sign TODO: add error handling |
static void |
runMacroFile(java.io.File macroFile)
Parse a macro file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandFileRunner()
| Method Detail |
|---|
public static void runMacroFile(java.io.File macroFile)
macroFile - public static java.lang.String getNextCommand(java.io.BufferedReader reader)
reader -
public static java.util.Map<java.lang.String,java.lang.String> getArguments(java.io.BufferedReader reader,
CommandLineModule module)
reader -
protected static Pair<java.lang.String,java.lang.String> processArgument(java.lang.String argument,
CommandLineModule module)
argument -
protected static void macroError()
protected static void macroMissingArguments()
public static java.lang.String createCommandFileEntry(java.lang.String commandName,
java.util.Map<java.lang.String,java.lang.String> argumentMap)
commandName - argumentMap -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||