adams.flow.template
Class Groovy

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.template.AbstractActorTemplate
              extended by adams.flow.template.AbstractScriptTemplate
                  extended by adams.flow.template.Groovy
All Implemented Interfaces:
adams.core.CleanUpHandler, adams.core.Debuggable, adams.core.Destroyable, OptionHandler, adams.core.ShallowCopySupporter<AbstractActorTemplate>, adams.core.SizeOfHandler, Serializable

public class Groovy
extends AbstractScriptTemplate

Uses a Groovy script to generate a sub-flow.

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to 
    the console (0 = off).
    default: 0
    minimum: 0
 
-name <java.lang.String> (property: name)
    The new name for the actor; leave empty to use current.
    default: 
 
-script <adams.core.io.PlaceholderFile> (property: scriptFile)
    The script file to load and execute.
    default: ${CWD}
 
-options <java.lang.String> (property: scriptOptions)
    The options for the Groovy script; must consist of 'key=value' pairs separated 
    by blanks; the value of 'key' can be accessed via the 'getAdditionalOptions
    ().getXYZ("key")' method in the Groovy actor.
    default: 
 
-inline-script <adams.core.scripting.GroovyScript> (property: inlineScript)
    The inline script, if not using an external script file.
    default: 
 

Version:
$Revision: 6842 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
Groovy, Serialized Form

Field Summary
protected  GroovyScript m_InlineScript
          the inline script.
 
Fields inherited from class adams.flow.template.AbstractScriptTemplate
m_ScriptFile, m_ScriptObject, m_ScriptOptions
 
Fields inherited from class adams.flow.template.AbstractActorTemplate
m_Name
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
Groovy()
           
 
Method Summary
protected  String checkScriptObject()
          Checks the script object.
 void defineOptions()
          Adds options to the internal list of options.
protected  AbstractActor executeScript()
          Executes the script to generate the actor.
protected  GroovyScript getDefaultInlineScript()
          Returns the default inline script.
 GroovyScript getInlineScript()
          Gets the inline script to use instead of the external script file.
 String getQuickInfo()
          Returns a quick info about the actor, which will be displayed in the GUI.
 String globalInfo()
          Returns a string describing the object.
 String inlineScriptTipText()
          Returns the tip text for this property.
protected  String loadScriptObject()
          Loads the scripts object and sets its options.
 String scriptOptionsTipText()
          Returns the tip text for this property.
 void setInlineScript(GroovyScript value)
          Sets the inline script to use instead of the external script file.
 
Methods inherited from class adams.flow.template.AbstractScriptTemplate
cleanUp, doGenerate, getScriptFile, getScriptOptions, initScriptObject, scriptFileTipText, setScriptFile, setScriptOptions
 
Methods inherited from class adams.flow.template.AbstractActorTemplate
compareTo, equals, forCommandLine, forName, generate, getBaselineCorrections, getName, nameTipText, postGenerate, preGenerate, setName, shallowCopy, shallowCopy
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_InlineScript

protected GroovyScript m_InlineScript
the inline script.

Constructor Detail

Groovy

public Groovy()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractScriptTemplate

getQuickInfo

public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.

Overrides:
getQuickInfo in class AbstractScriptTemplate
Returns:
null if no info available, otherwise short string

scriptOptionsTipText

public String scriptOptionsTipText()
Returns the tip text for this property.

Overrides:
scriptOptionsTipText in class AbstractScriptTemplate
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

getDefaultInlineScript

protected GroovyScript getDefaultInlineScript()
Returns the default inline script.

Returns:
the default script

setInlineScript

public void setInlineScript(GroovyScript value)
Sets the inline script to use instead of the external script file.

Parameters:
value - the inline script

getInlineScript

public GroovyScript getInlineScript()
Gets the inline script to use instead of the external script file.

Returns:
the inline script

inlineScriptTipText

public String inlineScriptTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

loadScriptObject

protected String loadScriptObject()
Loads the scripts object and sets its options.

Specified by:
loadScriptObject in class AbstractScriptTemplate
Returns:
null if OK, otherwise the error message

checkScriptObject

protected String checkScriptObject()
Checks the script object.

Specified by:
checkScriptObject in class AbstractScriptTemplate
Returns:
null if OK, otherwise the error message

executeScript

protected AbstractActor executeScript()
Executes the script to generate the actor.

Specified by:
executeScript in class AbstractScriptTemplate
Returns:
the generated actor


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.