Package org.sentrysoftware.jawk.util
Class ScriptSource
java.lang.Object
org.sentrysoftware.jawk.util.ScriptSource
- Direct Known Subclasses:
ScriptFileSource
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" (normal) or "*.ai" (intermediate) script,
given as a path with a "-f" command line switch.
- Author:
- Danny Daglas
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantDESCRIPTION_COMMAND_LINE_SCRIPT="<command-line-supplied-script>"
-
Constructor Summary
ConstructorDescriptionScriptSource
(String description, Reader reader, boolean intermediate) Constructor for ScriptSource. -
Method Summary
-
Field Details
-
DESCRIPTION_COMMAND_LINE_SCRIPT
ConstantDESCRIPTION_COMMAND_LINE_SCRIPT="<command-line-supplied-script>"
- See Also:
-
-
Constructor Details
-
Method Details
-
getDescription
Getter for the field
description
.- Returns:
- a
String
object
-
getReader
Obtain the InputStream containing the intermediate file. This returns non-null only if returnsfalse
.- Returns:
- The reader which contains the intermediate file, null if either the -f argument is not used, or the argument does not refer to an intermediate file.
- Throws:
IOException
- if any.
-
getInputStream
Returns theInputStream
serving the contents of this source. This returns non-null
only if returnstrue
.- Returns:
- a
InputStream
object - Throws:
IOException
- if any.
-
isIntermediate
public final boolean isIntermediate()Indicates whether the underlying source is an intermediate file. Intermediate files end with the ".ai" extension. No other determination is made whether the file is an intermediate one or not. That is, the content of the file is not checked.- Returns:
true
if the "-f optarg" is an intermediate file (a file ending in ".ai"),false
otherwise.
-
toString
-