Package io.jawk

Class SandboxedAwk

java.lang.Object
io.jawk.Awk
io.jawk.SandboxedAwk

public final class SandboxedAwk extends Awk
Awk variant that enforces sandbox restrictions by delegating to the sandbox-specific tuple and runtime implementations.
  • Constructor Details

    • SandboxedAwk

      public SandboxedAwk()
      Creates a sandboxed AWK instance with default settings and no extensions.
    • SandboxedAwk

      public SandboxedAwk(AwkSettings settings)
      Creates a sandboxed AWK instance with the specified settings.
      Parameters:
      settings - behavioral configuration for this engine
    • SandboxedAwk

      public SandboxedAwk(Collection<? extends JawkExtension> extensions)
      Creates a sandboxed AWK instance with the supplied extensions.
      Parameters:
      extensions - Extension instances to register
    • SandboxedAwk

      public SandboxedAwk(Collection<? extends JawkExtension> extensions, AwkSettings settings)
      Creates a sandboxed AWK instance with extensions and settings.
      Parameters:
      extensions - extension instances
      settings - behavioral configuration for this engine
    • SandboxedAwk

      @SafeVarargs public SandboxedAwk(JawkExtension... extensions)
      Creates a sandboxed AWK instance with the supplied extensions.
      Parameters:
      extensions - Extension instances to register
  • Method Details

    • compile

      public AwkProgram compile(List<ScriptSource> scripts, boolean disableOptimizeParam) throws IOException
      Description copied from class: Awk
      Compiles a list of script sources into an immutable AWK program that can be executed by the AVM runtime.
      Overrides:
      compile in class Awk
      Parameters:
      scripts - script sources to compile
      disableOptimizeParam - true to skip tuple optimization
      Returns:
      compiled immutable program
      Throws:
      IOException - if an I/O error occurs while reading the scripts
    • compileExpression

      public AwkExpression compileExpression(String expression, boolean disableOptimizeParam) throws IOException
      Description copied from class: Awk
      Compile an expression to evaluate (not a full script).
      Overrides:
      compileExpression in class Awk
      Parameters:
      expression - AWK expression to compile
      disableOptimizeParam - true to skip tuple optimization
      Returns:
      compiled immutable expression
      Throws:
      IOException - if anything goes wrong with the compilation
    • createAvm

      public AVM createAvm()
      Description copied from class: Awk
      Creates a reusable runtime backed by one AVM instance.
      Overrides:
      createAvm in class Awk
      Returns:
      reusable AVM
    • createAvm

      public AVM createAvm(boolean profilingEnabled)
      Description copied from class: Awk
      Creates a reusable runtime backed by one AVM instance, optionally collecting runtime profiling statistics.
      Overrides:
      createAvm in class Awk
      Parameters:
      profilingEnabled - whether runtime profiling should be enabled
      Returns:
      reusable AVM