public abstract class AbstractInterruptibleASTTransformation extends ClassCodeVisitorSupport
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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 SourceUnit |
source |
|
protected ClassNode |
thrownExceptionType |
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 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. |
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