Class GroovyPlugin

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.scripting.FileBasedScripting, adams.core.scripting.FileBasedScriptingWithOptions, adams.core.SizeOfHandler, Serializable

    public class GroovyPlugin
    extends adams.core.option.AbstractOptionHandler
    implements adams.core.scripting.FileBasedScriptingWithOptions, adams.core.QuickInfoSupporter
    Wrapper for a REST plugin written in Groovy.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.core.io.PlaceholderFile m_ScriptFile
      the script.
      protected String m_ScriptOptions
      the options for the script.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      GroovyPlugin()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      String getQuickInfo()
      Returns a quick info about the actor, which will be displayed in the GUI.
      adams.core.io.PlaceholderFile getScriptFile()
      Gets the script file.
      adams.core.base.BaseText getScriptOptions()
      Gets the script options.
      String globalInfo()
      Returns a string describing the object.
      Object loadPlugin​(adams.flow.core.Actor context)
      Loads the Groovy REST plugin.
      String scriptFileTipText()
      Returns the tip text for this property.
      String scriptOptionsTipText()
      Returns the tip text for this property.
      void setScriptFile​(adams.core.io.PlaceholderFile value)
      Sets the script file.
      void setScriptOptions​(adams.core.base.BaseText value)
      Sets the script options.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_ScriptFile

        protected adams.core.io.PlaceholderFile m_ScriptFile
        the script.
      • m_ScriptOptions

        protected String m_ScriptOptions
        the options for the script.
    • Constructor Detail

      • GroovyPlugin

        public GroovyPlugin()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.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 adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • setScriptFile

        public void setScriptFile​(adams.core.io.PlaceholderFile value)
        Sets the script file.
        Specified by:
        setScriptFile in interface adams.core.scripting.FileBasedScripting
        Parameters:
        value - the script
      • getScriptFile

        public adams.core.io.PlaceholderFile getScriptFile()
        Gets the script file.
        Specified by:
        getScriptFile in interface adams.core.scripting.FileBasedScripting
        Returns:
        the script
      • scriptFileTipText

        public String scriptFileTipText()
        Returns the tip text for this property.
        Specified by:
        scriptFileTipText in interface adams.core.scripting.FileBasedScripting
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setScriptOptions

        public void setScriptOptions​(adams.core.base.BaseText value)
        Sets the script options.
        Specified by:
        setScriptOptions in interface adams.core.scripting.FileBasedScriptingWithOptions
        Parameters:
        value - the options
      • getScriptOptions

        public adams.core.base.BaseText getScriptOptions()
        Gets the script options.
        Specified by:
        getScriptOptions in interface adams.core.scripting.FileBasedScriptingWithOptions
        Returns:
        the options
      • scriptOptionsTipText

        public String scriptOptionsTipText()
        Returns the tip text for this property.
        Specified by:
        scriptOptionsTipText in interface adams.core.scripting.FileBasedScriptingWithOptions
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • loadPlugin

        public Object loadPlugin​(adams.flow.core.Actor context)
                          throws Exception
        Loads the Groovy REST plugin.
        Parameters:
        context - the flow context
        Returns:
        the plugin
        Throws:
        Exception - if loading failed or not implementing AdditionalOptionsHandler