Package io.jawk
Class SandboxedAwk
java.lang.Object
io.jawk.Awk
io.jawk.SandboxedAwk
Awk variant that enforces sandbox restrictions by delegating to the
sandbox-specific tuple and runtime implementations.-
Nested Class Summary
Nested classes/interfaces inherited from class io.jawk.Awk
Awk.AwkRunBuilder -
Field Summary
Fields inherited from class io.jawk.Awk
DEFAULT_CONVFMT, DEFAULT_FS, DEFAULT_OFMT, DEFAULT_OFS, DEFAULT_ORS, DEFAULT_RS, DEFAULT_SUBSEP -
Constructor Summary
ConstructorsConstructorDescriptionCreates a sandboxed AWK instance with default settings and no extensions.SandboxedAwk(JawkExtension... extensions) Creates a sandboxed AWK instance with the supplied extensions.SandboxedAwk(AwkSettings settings) Creates a sandboxed AWK instance with the specified settings.SandboxedAwk(Collection<? extends JawkExtension> extensions) Creates a sandboxed AWK instance with the supplied extensions.SandboxedAwk(Collection<? extends JawkExtension> extensions, AwkSettings settings) Creates a sandboxed AWK instance with extensions and settings. -
Method Summary
Modifier and TypeMethodDescriptioncompile(List<ScriptSource> scripts, boolean disableOptimizeParam) Compiles a list of script sources into an immutable AWK program that can be executed by theAVMruntime.compileExpression(String expression, boolean disableOptimizeParam) Compile an expression to evaluate (not a full script).Creates a reusable runtime backed by oneAVMinstance.createAvm(boolean profilingEnabled) Creates a reusable runtime backed by oneAVMinstance, optionally collecting runtime profiling statistics.Methods inherited from class io.jawk.Awk
compile, compile, compile, compileExpression, eval, eval, eval, eval, eval, eval, getLastAst, getSettings, listAvailableExtensions, prepareEval, prepareEval, script, script
-
Constructor Details
-
SandboxedAwk
public SandboxedAwk()Creates a sandboxed AWK instance with default settings and no extensions. -
SandboxedAwk
Creates a sandboxed AWK instance with the specified settings.- Parameters:
settings- behavioral configuration for this engine
-
SandboxedAwk
Creates a sandboxed AWK instance with the supplied extensions.- Parameters:
extensions- Extension instances to register
-
SandboxedAwk
Creates a sandboxed AWK instance with extensions and settings.- Parameters:
extensions- extension instancessettings- behavioral configuration for this engine
-
SandboxedAwk
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:AwkCompiles a list of script sources into an immutable AWK program that can be executed by theAVMruntime.- Overrides:
compilein classAwk- Parameters:
scripts- script sources to compiledisableOptimizeParam-trueto 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:AwkCompile an expression to evaluate (not a full script).- Overrides:
compileExpressionin classAwk- Parameters:
expression- AWK expression to compiledisableOptimizeParam-trueto skip tuple optimization- Returns:
- compiled immutable expression
- Throws:
IOException- if anything goes wrong with the compilation
-
createAvm
Description copied from class:AwkCreates a reusable runtime backed by oneAVMinstance. -
createAvm
Description copied from class:AwkCreates a reusable runtime backed by oneAVMinstance, optionally collecting runtime profiling statistics.
-