org.jawk.ext
Class StdinExtension

java.lang.Object
  extended by org.jawk.ext.AbstractExtension
      extended by org.jawk.ext.StdinExtension
All Implemented Interfaces:
JawkExtension

public class StdinExtension
extends AbstractExtension
implements JawkExtension

Enable stdin processing in Jawk, to be used in conjunction with the -ni parameter. Since normal input processing is turned off via -ni, this is provided to enable a way to read input from stdin.

To use:

 StdinGetline() == 1 { print "--> " $0 }
 

The extension functions are as follows:


Field Summary
 
Fields inherited from class org.jawk.ext.AbstractExtension
jrt, vm
 
Constructor Summary
StdinExtension()
           
 
Method Summary
 java.lang.String[] extensionKeywords()
          All the extended keywords supported by this extension.
 java.lang.String getExtensionName()
          The name of the extension package.
 java.lang.Object invoke(java.lang.String keyword, java.lang.Object[] args)
          Invoke extension as a method.
 
Methods inherited from class org.jawk.ext.AbstractExtension
checkNumArgs, getAssocArrayParameterPositions, init, toAwkString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jawk.ext.JawkExtension
getAssocArrayParameterPositions, init
 

Constructor Detail

StdinExtension

public StdinExtension()
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getExtensionName

public java.lang.String getExtensionName()
Description copied from interface: JawkExtension
The name of the extension package.

Specified by:
getExtensionName in interface JawkExtension

extensionKeywords

public java.lang.String[] extensionKeywords()
Description copied from interface: JawkExtension
All the extended keywords supported by this extension.

Note: Jawk will throw a runtime exception if the keyword collides with any other keyword in the system, extension or otherwise.

Specified by:
extensionKeywords in interface JawkExtension

invoke

public java.lang.Object invoke(java.lang.String keyword,
                               java.lang.Object[] args)
Description copied from interface: JawkExtension
Invoke extension as a method.

Specified by:
invoke in interface JawkExtension
Parameters:
keyword - The extension keyword.
args - Arguments to the extension.
Returns:
The return value (result) of the extension.