adams.flow.source
Class Jython

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.core.AbstractActor
              extended by adams.flow.core.AbstractScriptActor
                  extended by adams.flow.core.AbstractJythonActor
                      extended by adams.flow.source.Jython
All Implemented Interfaces:
adams.core.AdditionalInformationHandler, adams.core.CleanUpHandler, adams.core.Debuggable, adams.core.DebugOutputHandler, adams.core.Destroyable, OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<AbstractActor>, adams.core.SizeOfHandler, adams.core.Stoppable, VariableChangeListener, Actor, ErrorHandler, OutputProducer, Serializable, Comparable

public class Jython
extends AbstractJythonActor
implements OutputProducer

A source that uses a Jython script for generating the token(s).

Input/output:
- generates:
   adams.flow.core.Unknown

Valid options are:

-D (property: debug)
    If set to true, scheme may output additional info to the console.
 
-name <java.lang.String> (property: name)
    The name of the actor.
    default: Jython
 
-annotation <adams.core.base.BaseText> (property: annotations)
    The annotations to attach to this actor.
    default:
 
-skip (property: skip)
    If set to true, transformation is skipped and the input token is just forwarded
    as it is.
 
-script <adams.core.io.PlaceholderFile> (property: scriptFile)
    The script file to load and execute.
    default: .
 
-options <java.lang.String> (property: scriptOptions)
    The options for the Jython script; must consist of 'key=value' pairs separated
    by blanks; the value of 'key' can be accessed via the 'getAdditionalOption
    (String)' in the Jython actor.
    default:
 

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.flow.core.AbstractJythonActor
m_ActorObject, m_InlineScript
 
Fields inherited from class adams.flow.core.AbstractScriptActor
m_ScriptFile, m_ScriptObject, m_ScriptOptions
 
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
 
Constructor Summary
Jython()
           
 
Method Summary
protected  String doExecute()
          Executes the flow item.
 Class[] generates()
          Returns the class of objects that it generates.
 String globalInfo()
          Returns a string describing the object.
 boolean hasPendingOutput()
          Checks whether there is pending output to be collected after executing the flow item.
 Token output()
          Returns the generated token.
 
Methods inherited from class adams.flow.core.AbstractJythonActor
checkScriptObject, defineOptions, getDefaultInlineScript, getInlineScript, getQuickInfo, inlineScriptTipText, loadScriptObject, scriptOptionsTipText, setInlineScript, setUp, wrapUp
 
Methods inherited from class adams.flow.core.AbstractScriptActor
getScriptFile, getScriptOptions, initScriptObject, scriptFileTipText, setScriptFile, setScriptOptions
 
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canInspectOptions, canPerformSetUpCheck, cleanUp, compareTo, debug, destroy, equals, execute, findVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, postExecute, preExecute, pruneBackup, pruneBackup, reset, restoreState, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface adams.flow.core.Actor
cleanUp, compareTo, debug, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFullName, getName, getNextSibling, getParent, getPreviousSibling, getQuickInfo, getRoot, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setHeadless, setName, setParent, setSkip, setStopFlowOnError, setUp, setVariables, sizeOf, stopExecution, stopExecution, variableChanged, wrapUp
 
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
 
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager
 

Constructor Detail

Jython

public Jython()
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

generates

public Class[] generates()
Returns the class of objects that it generates.

Specified by:
generates in interface OutputProducer
Returns:
adams.flow.core.Unknown.class

doExecute

protected String doExecute()
Executes the flow item.

Specified by:
doExecute in class AbstractActor
Returns:
null if everything is fine, otherwise error message

output

public Token output()
Returns the generated token.

Specified by:
output in interface OutputProducer
Returns:
the generated token

hasPendingOutput

public boolean hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item.

Specified by:
hasPendingOutput in interface OutputProducer
Returns:
true if there is pending output


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