Class SimpleJepScriptlet

  • All Implemented Interfaces:
    adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, Serializable

    public class SimpleJepScriptlet
    extends AbstractJepScriptlet
    Simple script that gets executed in memory, line by line.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Script

        protected String m_Script
        the script to execute.
      • m_OutputNames

        protected String[] m_OutputNames
        the output names.
      • m_OptionalOutputNames

        protected String[] m_OptionalOutputNames
        the optional output names.
    • Constructor Detail

      • SimpleJepScriptlet

        public SimpleJepScriptlet​(String id,
                                  String script,
                                  Map<String,​Object> inputs,
                                  String[] outputNames)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        script - the script to execute (line by line)
        inputs - the inputs for the script (name/object)
        outputNames - the names of the outputs to retrieve
      • SimpleJepScriptlet

        public SimpleJepScriptlet​(String id,
                                  String script,
                                  Map<String,​Object> inputs,
                                  String[] outputNames,
                                  String[] optionalOutputNames)
        Initializes the scriptlet.
        Parameters:
        id - the ID of the script
        script - the script to execute (line by line)
        inputs - the inputs for the script (name/object)
        outputNames - the names of the outputs to retrieve
        optionalOutputNames - the names of the optional outputs (won't throw an exception if not present)
    • Method Detail

      • getScript

        public String getScript()
        Returns the script to be executed (line by line).
        Returns:
        the script
      • getInputs

        public Map<String,​Object> getInputs()
        Returns the input map of name/value.
        Returns:
        the inputs
      • getOutputNames

        public String[] getOutputNames()
        Returns the outputs to retrieve from the interpreter.
        Returns:
        the names
      • getOptionalOutputNames

        public String[] getOptionalOutputNames()
        Returns the names of the optional outputs, i.e., ones that won't throw and exception when not present.
        Returns:
        the names
      • getOutputs

        public Map<String,​Object> getOutputs()
        Returns the output map. Gets populated after execution.
        Returns:
        the outputs (name/value)