public abstract class AbstractInterruptibleASTTransformation extends ClassCodeVisitorSupport
Base class for AST Transformations which will automatically throw an InterruptedException when some conditions are met.
Modifiers | Name | Description |
---|---|---|
protected static String |
CHECK_METHOD_START_MEMBER |
|
protected static String |
THROWN_EXCEPTION_TYPE |
|
protected boolean |
applyToAllClasses |
|
protected boolean |
applyToAllMembers |
|
protected boolean |
checkOnMethodStart |
|
protected org.codehaus.groovy.control.SourceUnit |
source |
|
protected ClassNode |
thrownExceptionType |
Type Params | Return Type | Name and description |
---|---|---|
|
protected Expression |
createCondition() Subclasses should implement this method to set the condition of the interruption statement |
|
protected Statement |
createInterruptStatement() @return Returns the interruption check statement. |
|
protected static boolean |
getBooleanAnnotationParameter(AnnotationNode node, String parameterName, boolean defaultValue) |
|
protected static ClassNode |
getClassAnnotationParameter(AnnotationNode node, String parameterName, ClassNode defaultValue) |
|
protected String |
getErrorMessage() Subclasses should implement this method to provide good error resolution. |
|
protected org.codehaus.groovy.control.SourceUnit |
getSourceUnit() |
|
protected static void |
internalError(String message) |
|
protected void |
setupTransform(AnnotationNode node) |
|
protected ClassNode |
type() |
|
void |
visit(ASTNode[] nodes, org.codehaus.groovy.control.SourceUnit source) |
|
void |
visitDoWhileLoop(DoWhileStatement doWhileStatement) |
|
void |
visitForLoop(ForStatement forStatement) |
|
void |
visitWhileLoop(WhileStatement whileStatement) |
|
protected Statement |
wrapBlock(Statement statement) Takes a statement and wraps it into a block statement which first element is the interruption check statement. |
Subclasses should implement this method to set the condition of the interruption statement
Subclasses should implement this method to provide good error resolution.
Takes a statement and wraps it into a block statement which first element is the interruption check statement.
statement
- the statement to be wrapped