|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gmetrics.util.AstUtil
class AstUtil
Contains static utility methods related to Groovy AST.
This is an internal class and its API is subject to change.Constructor Summary | |
private AstUtil()
Private constructor. |
Method Summary | |
---|---|
static AnnotationNode
|
getAnnotation(AnnotatedNode node, String name)
Return the AnnotationNode for the named annotation, or else null. |
static List
|
getMethodArguments(MethodCallExpression methodCall)
Return the List of Arguments for the specified MethodCallExpression. |
static List
|
getVariableExpressions(DeclarationExpression declarationExpression)
Return the List of VariableExpression objects referenced by the specified DeclarationExpression. |
static boolean
|
isBlock(Statement statement)
Return true if the Statement is a block |
static boolean
|
isEmptyBlock(Statement statement)
Return true if the Statement is a block and it is empty (contains no "meaningful" statements). |
static boolean
|
isFinalVariable(DeclarationExpression declarationExpression, SourceCode sourceCode)
Return true if the DeclarationExpression represents a 'final' variable declaration. |
static boolean
|
isFromGeneratedSourceCode(ASTNode node)
|
static boolean
|
isMethodCall(Statement stmt, String methodObject, String methodName, int numArguments)
Return true only if the Statement represents a method call for the specified method object (receiver), method name, and with the specified number of arguments. |
static boolean
|
isMethodCall(MethodCallExpression methodCall, String methodObject, String methodName, int numArguments)
Return true only if the MethodCallExpression represents a method call for the specified method object (receiver), method name, and with the specified number of arguments. |
static boolean
|
isMethodCall(MethodCallExpression methodCall, String methodObject, String methodName)
Return true only if the MethodCallExpression represents a method call for the specified method object (receiver) and method name. |
static boolean
|
isMethodNamed(MethodCallExpression methodCall, String methodName)
Return true only if the MethodCallExpression represents a method call for the specified method name |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
private AstUtil()
Method Detail |
---|
public static AnnotationNode getAnnotation(AnnotatedNode node, String name)
public static List getMethodArguments(MethodCallExpression methodCall)
public static List getVariableExpressions(DeclarationExpression declarationExpression)
public static boolean isBlock(Statement statement)
public static boolean isEmptyBlock(Statement statement)
public static boolean isFinalVariable(DeclarationExpression declarationExpression, SourceCode sourceCode)
public static boolean isFromGeneratedSourceCode(ASTNode node)
public static boolean isMethodCall(Statement stmt, String methodObject, String methodName, int numArguments)
public static boolean isMethodCall(MethodCallExpression methodCall, String methodObject, String methodName, int numArguments)
public static boolean isMethodCall(MethodCallExpression methodCall, String methodObject, String methodName)
public static boolean isMethodNamed(MethodCallExpression methodCall, String methodName)
Groovy Documentation