|
Groovy Documentation | |||||||
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 java.lang.InterruptedException when some conditions are met.
Field Summary | |
---|---|
protected static java.lang.String |
CHECK_METHOD_START_MEMBER
|
protected static java.lang.String |
PROPAGATE_TO_COMPILE_UNIT
|
protected static java.lang.String |
THROWN_EXCEPTION_TYPE
|
protected boolean |
applyToAllClasses
|
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, java.lang.String parameterName, boolean defaultValue)
|
protected static ClassNode
|
getClassAnnotationParameter(AnnotationNode node, java.lang.String parameterName, ClassNode defaultValue)
|
protected java.lang.String
|
getErrorMessage()
Subclasses should implement this method to provide good error resolution. |
protected SourceUnit
|
getSourceUnit()
|
protected static void
|
internalError(java.lang.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. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
protected static final java.lang.String CHECK_METHOD_START_MEMBER
protected static final java.lang.String PROPAGATE_TO_COMPILE_UNIT
protected static final java.lang.String THROWN_EXCEPTION_TYPE
protected boolean applyToAllClasses
protected boolean checkOnMethodStart
protected SourceUnit source
protected ClassNode thrownExceptionType
Method Detail |
---|
protected Expression createCondition()
protected Statement createInterruptStatement()
protected static boolean getBooleanAnnotationParameter(AnnotationNode node, java.lang.String parameterName, boolean defaultValue)
protected static ClassNode getClassAnnotationParameter(AnnotationNode node, java.lang.String parameterName, ClassNode defaultValue)
protected java.lang.String getErrorMessage()
protected SourceUnit getSourceUnit()
protected static void internalError(java.lang.String message)
protected void setupTransform(AnnotationNode node)
protected ClassNode type()
public void visit(ASTNode[] nodes, SourceUnit source)
} public final void visitDoWhileLoop(DoWhileStatement doWhileStatement)
} public final void visitForLoop(ForStatement forStatement)
} } public final void visitWhileLoop(WhileStatement whileStatement)
protected final Statement wrapBlock(Statement statement)
statement
- the statement to be wrapped
Groovy Documentation