Class ScriptSource

java.lang.Object
org.metricshub.jawk.util.ScriptSource
Direct Known Subclasses:
ScriptFileSource

public class ScriptSource extends Object
Represents one AWK-script content source. This is usually either a string, given on the command line with the first non-"-" parameter, or an "*.awk" script, given as a path with a "-f" command line switch.
Author:
Danny Daglas
  • Field Details

    • DESCRIPTION_COMMAND_LINE_SCRIPT

      public static final String DESCRIPTION_COMMAND_LINE_SCRIPT
      Constant DESCRIPTION_COMMAND_LINE_SCRIPT="<command-line-supplied-script>"
      See Also:
  • Constructor Details

    • ScriptSource

      public ScriptSource(String description, Reader reader)

      Constructor for ScriptSource.

      Parameters:
      description - a String object
      reader - a Reader object
  • Method Details

    • getDescription

      public final String getDescription()

      Getter for the field description.

      Returns:
      a String object
    • getReader

      public Reader getReader() throws IOException
      Obtain the Reader serving the script contents.
      Returns:
      The reader which contains the script contents.
      Throws:
      IOException - if any.
    • toString

      public String toString()
      Overrides:
      toString in class Object