Class AbstractExtension

java.lang.Object
org.metricshub.jawk.ext.AbstractExtension
All Implemented Interfaces:
JawkExtension
Direct Known Subclasses:
CoreExtension, StdinExtension

public abstract class AbstractExtension extends Object implements JawkExtension
Base class of various extensions.

Provides functionality common to most extensions, such as VM and JRT variable management, and convenience methods such as checkNumArgs() and toAwkString().

Author:
Danny Daglas
  • Constructor Details

    • AbstractExtension

      public AbstractExtension()
  • Method Details

    • getExtensionName

      public String getExtensionName()

      getExtensionName.

      Specified by:
      getExtensionName in interface JawkExtension
      Returns:
      name of the extension package.
    • init

      public void init(VariableManager vmParam, JRT runtime, AwkSettings conf)
      Called after the creation and before normal processing of the extension, pass in the Jawk Runtime Manager and the Variable Manager once.

      It is guaranteed init() is called before invoke() is called.

      Specified by:
      init in interface JawkExtension
      Parameters:
      vmParam - Reference to the Variable Manager
      runtime - Reference to the Runtime
      conf - Reference to the settings
    • getExtensionFunctions

      public Map<String,ExtensionFunction> getExtensionFunctions()
      Returns the mapping between Awk keywords and the functions implemented by this extension. The returned map must be unmodifiable.
      Specified by:
      getExtensionFunctions in interface JawkExtension
      Returns:
      mapping from keyword to ExtensionFunction