public class ProcessCodeGenericTask
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ProcessCodeGenericTask.EvalFunction
Interface to code evaluation facility in JVM scripting language.
|
static interface |
ProcessCodeGenericTask.JsonParseFunction
Interface for scripts in JVM languages to parse JSON strings into
objects relevant to their use cases.
|
| Constructor and Description |
|---|
ProcessCodeGenericTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(ProcessCodeGenericTask.EvalFunction evalFunction)
Executes processing stage of Code Augmentor.
|
java.lang.String |
generateStackTrace(java.lang.Throwable error)
Generate a stack trace for an error and all its nested exceptions, with any
stack trace filters applied.
|
java.util.function.Consumer<ProcessCodeContext> |
getAfterAllFilesHook() |
java.util.function.Consumer<ProcessCodeContext> |
getAfterFileHook() |
java.util.List<java.lang.Throwable> |
getAllErrors()
Gets the error results of executing this task.
|
java.util.function.Consumer<ProcessCodeContext> |
getBeforeAllFilesHook() |
java.util.function.Function<ProcessCodeContext,SourceFileGeneratedCode> |
getBeforeFileHook() |
java.io.File |
getInputFile()
Gets the input file to read augmenting code objects from.
|
ProcessCodeGenericTask.JsonParseFunction |
getJsonParseFunction() |
java.util.function.BiConsumer<GenericTaskLogLevel,java.util.function.Supplier<java.lang.String>> |
getLogAppender() |
java.io.File |
getOutputFile()
Gets the output file to write generated code objects to.
|
java.util.List<java.lang.String> |
getStackTraceFilterPrefixes() |
void |
setAfterAllFilesHook(java.util.function.Consumer<ProcessCodeContext> afterAllFilesHook)
Sets an optional function which will be called once after all files have been
processed.
|
void |
setAfterFileHook(java.util.function.Consumer<ProcessCodeContext> afterFileHook)
Sets an optional function which will be called every time a file processing of a file
is completed, with or without errors.
|
void |
setBeforeAllFilesHook(java.util.function.Consumer<ProcessCodeContext> beforeAllFilesHook)
Sets an optional function which will be called once at the beginning, ie before any file is
processed.
|
void |
setBeforeFileHook(java.util.function.Function<ProcessCodeContext,SourceFileGeneratedCode> beforeFileHook)
Sets an optional function which will be called every time a file is about to be
processed.
|
void |
setInputFile(java.io.File inputFile) |
void |
setJsonParseFunction(ProcessCodeGenericTask.JsonParseFunction jsonParseFunction)
Sets the function object used to parse JSON strings into objects convenient
for processing by a JVM language script.
|
void |
setLogAppender(java.util.function.BiConsumer<GenericTaskLogLevel,java.util.function.Supplier<java.lang.String>> logAppender)
Sets logging procedure for this task.
|
void |
setOutputFile(java.io.File outputFile) |
void |
setStackTraceFilterPrefixes(java.util.List<java.lang.String> stackTraceFilterPrefixes)
Sets an optional list of strings which will be used to filter out lines of a
generated stack trace.
|
public void execute(ProcessCodeGenericTask.EvalFunction evalFunction) throws java.lang.Exception
Success of this operation depends on emptiness of allErrors property.
evalFunction - interface to a JVM language's code evaluation
facility.java.lang.Exceptionpublic java.lang.String generateStackTrace(java.lang.Throwable error)
error - public java.util.function.BiConsumer<GenericTaskLogLevel,java.util.function.Supplier<java.lang.String>> getLogAppender()
public void setLogAppender(java.util.function.BiConsumer<GenericTaskLogLevel,java.util.function.Supplier<java.lang.String>> logAppender)
logAppender - logging procedure or null for no loggingpublic java.io.File getInputFile()
AugCodeProcessingSpec.getDestFile()public void setInputFile(java.io.File inputFile)
public java.io.File getOutputFile()
CodeAugmentationGenericTask.getGeneratedCodeFiles()public void setOutputFile(java.io.File outputFile)
public ProcessCodeGenericTask.JsonParseFunction getJsonParseFunction()
public void setJsonParseFunction(ProcessCodeGenericTask.JsonParseFunction jsonParseFunction)
jsonParseFunction - public java.util.function.Consumer<ProcessCodeContext> getBeforeAllFilesHook()
public void setBeforeAllFilesHook(java.util.function.Consumer<ProcessCodeContext> beforeAllFilesHook)
beforeAllFilesHook - public java.util.function.Consumer<ProcessCodeContext> getAfterAllFilesHook()
public void setAfterAllFilesHook(java.util.function.Consumer<ProcessCodeContext> afterAllFilesHook)
afterAllFilesHook - public java.util.function.Function<ProcessCodeContext,SourceFileGeneratedCode> getBeforeFileHook()
public void setBeforeFileHook(java.util.function.Function<ProcessCodeContext,SourceFileGeneratedCode> beforeFileHook)
beforeFileHook - public java.util.function.Consumer<ProcessCodeContext> getAfterFileHook()
public void setAfterFileHook(java.util.function.Consumer<ProcessCodeContext> afterFileHook)
afterFileHook - public java.util.List<java.lang.String> getStackTraceFilterPrefixes()
public void setStackTraceFilterPrefixes(java.util.List<java.lang.String> stackTraceFilterPrefixes)
stackTraceFilterPrefixes - lines of stack traces which begin with any item in an
argument passed through this parameter will be omitted from stack trace.public java.util.List<java.lang.Throwable> getAllErrors()