public class ProcessCodeContext
extends java.lang.Object
| Constructor and Description |
|---|
ProcessCodeContext(java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> errorAccumulator) |
| Modifier and Type | Method and Description |
|---|---|
void |
addError(java.lang.String message,
java.lang.Throwable cause)
Available for accumulating all errors
that may occur during the lifetime of instance of this class.
|
int |
getAugCodeIndex()
Gets the index of the augmenting code currently being processed.
|
SourceFileAugmentingCode |
getFileAugCodes()
Gets all of the augmenting code objects for the file currently being processed.
|
java.util.Map<java.lang.String,java.lang.Object> |
getFileScope()
Returns readonly map for use by JVM language script during
processing stage to record objects for a file of augmenting code objects
for script's own purposes.
|
java.util.Map<java.lang.String,java.lang.Object> |
getGlobalScope()
Returns readonly map for use by JVM language script during
processing stage to record global objects for its own purposes.
|
java.lang.Object |
getHeader()
Returns result of parsing the header (ie first line) of
the files returned by preparation stage as aug code files
and presented separately to processing stage as input files.
|
java.lang.Object |
getScopeVar(java.lang.String name)
Gets a variable from file or global scopes, with
preference for file scope.
|
java.io.File |
getSrcFile()
Gets the file of augmenting code objects currently being processed.
|
GeneratedCode.ContentPart |
newContent(java.lang.String content)
Creates a new content part with inexact matching.
|
GeneratedCode.ContentPart |
newContent(java.lang.String content,
boolean exactMatch)
Creates a new content part.
|
GeneratedCode |
newGenCode()
Creates a new
GeneratedCode with an empty modifiable list of
content parts. |
GeneratedCode |
newSkipGenCode()
Creates a new
GeneratedCode with skipped property set to true and null
content parts. |
void |
setHeader(java.lang.Object header) |
public ProcessCodeContext(java.util.function.BiConsumer<java.lang.String,java.lang.Throwable> errorAccumulator)
public GeneratedCode newGenCode()
GeneratedCode with an empty modifiable list of
content parts.public GeneratedCode newSkipGenCode()
GeneratedCode with skipped property set to true and null
content parts.public GeneratedCode.ContentPart newContent(java.lang.String content)
content - string of content partpublic GeneratedCode.ContentPart newContent(java.lang.String content, boolean exactMatch)
content - string of content part.exactMatch - true to match string exactly and disallow insertion of
indentation; false to admit insertion of leading indents.public java.lang.Object getHeader()
public void setHeader(java.lang.Object header)
public java.util.Map<java.lang.String,java.lang.Object> getGlobalScope()
public java.util.Map<java.lang.String,java.lang.Object> getFileScope()
public SourceFileAugmentingCode getFileAugCodes()
public int getAugCodeIndex()
public java.io.File getSrcFile()
public void addError(java.lang.String message,
java.lang.Throwable cause)
public java.lang.Object getScopeVar(java.lang.String name)
name - variable name