Package ffx.utilities
Class FFXScript
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Script
ffx.utilities.FFXScript
- All Implemented Interfaces:
groovy.lang.GroovyObject
- Direct Known Subclasses:
AlgorithmsScript,PotentialScript
public abstract class FFXScript
extends groovy.lang.Script
BaseScript class.
- Author:
- Michael J. Schnieders
-
Field Summary
FieldsModifier and TypeFieldDescriptionString[]The array of args passed into the Script.final picocli.CommandLine.Help.AnsiUnix shells are able to evaluate PicoCLI ANSI color codes, but right now the FFX GUI Shell does not.boolean-h or --help Prints a help message.static final LoggerThe logger for this class.picocli.CommandLine.ParseResultParse Result.boolean-V or --version Prints the FFX version and exits. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUse the System ClassLoader to find the requested script.Default help information.booleaninit()Initialize this Script based on the specified command line arguments.static voidlistGroovyScripts(boolean logScripts, boolean logTestScripts) List the embedded FFX Groovy Scripts.run()Methods inherited from class groovy.lang.Script
evaluate, evaluate, getBinding, getProperty, invokeMethod, print, printf, printf, println, println, run, setBinding, setPropertyMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
-
Field Details
-
logger
The logger for this class. -
color
public final picocli.CommandLine.Help.Ansi colorUnix shells are able to evaluate PicoCLI ANSI color codes, but right now the FFX GUI Shell does not.In a headless environment, color will be ON for command line help, but OFF for the GUI.
-
args
The array of args passed into the Script. -
parseResult
public picocli.CommandLine.ParseResult parseResultParse Result. -
version
public boolean version-V or --version Prints the FFX version and exits. -
help
public boolean help-h or --help Prints a help message.
-
-
Constructor Details
-
FFXScript
public FFXScript()Default constructor for an FFX Script. -
FFXScript
Create an FFX Script using the supplied command line arguments.- Parameters:
args- The command line arguments.
-
FFXScript
public FFXScript(groovy.lang.Binding binding) Default constructor for an FFX Script.- Parameters:
binding- aBindingobject
-
-
Method Details
-
getScript
Use the System ClassLoader to find the requested script.- Parameters:
name- Name of the script to load (e.g. Energy).- Returns:
- The Script, if found, or null.
-
listGroovyScripts
public static void listGroovyScripts(boolean logScripts, boolean logTestScripts) List the embedded FFX Groovy Scripts.- Parameters:
logScripts- List Scripts.logTestScripts- List Test Scripts.
-
helpString
Default help information.- Returns:
- String describing how to use this command.
-
init
public boolean init()Initialize this Script based on the specified command line arguments.- Returns:
- boolean Returns true if the script should continue and false to exit.
-
run
Execute the script.
- Specified by:
runin classgroovy.lang.Script
-