|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.ast.CodeVisitorSupport org.codehaus.groovy.ast.ClassCodeVisitorSupport org.codehaus.groovy.transform.AbstractInterruptibleASTTransformation
public abstract class AbstractInterruptibleASTTransformation extends ClassCodeVisitorSupport
Base class for AST Transformations which will automatically throw an InterruptedException when some conditions are met.
Field Summary | |
---|---|
protected static String |
CHECK_METHOD_START_MEMBER
|
protected static String |
THROWN_EXCEPTION_TYPE
|
protected boolean |
applyToAllClasses
|
protected boolean |
applyToAllMembers
|
protected boolean |
checkOnMethodStart
|
protected SourceUnit |
source
|
protected ClassNode |
thrownExceptionType
|
Method Summary | |
---|---|
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 SourceUnit
|
getSourceUnit()
|
protected static void
|
internalError(String message)
|
protected void
|
setupTransform(AnnotationNode node)
|
protected ClassNode
|
type()
|
void
|
visit(ASTNode[] nodes, 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. |
Field Detail |
---|
protected static final String CHECK_METHOD_START_MEMBER
protected static final String THROWN_EXCEPTION_TYPE
protected boolean applyToAllClasses
protected boolean applyToAllMembers
protected boolean checkOnMethodStart
protected SourceUnit source
protected ClassNode thrownExceptionType
Method Detail |
---|
protected Expression createCondition()
protected Statement createInterruptStatement()
protected static boolean getBooleanAnnotationParameter(AnnotationNode node, String parameterName, boolean defaultValue)
protected static ClassNode getClassAnnotationParameter(AnnotationNode node, String parameterName, ClassNode defaultValue)
protected String getErrorMessage()
protected SourceUnit getSourceUnit()
protected static void internalError(String message)
protected void setupTransform(AnnotationNode node)
protected ClassNode type()
public void visit(ASTNode[] nodes, SourceUnit source)
@Override} public final void visitDoWhileLoop(DoWhileStatement doWhileStatement)
@Override} public final void visitForLoop(ForStatement forStatement)
@Override} } public final void visitWhileLoop(WhileStatement whileStatement)
protected final Statement wrapBlock(Statement statement)
statement
- the statement to be wrapped
Copyright © 2003-2013 The Codehaus. All rights reserved.