public abstract class AstUtils extends Object
| Constructor and Description |
|---|
AstUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.codehaus.groovy.ast.expr.ClosureExpression |
getClosure(org.codehaus.groovy.ast.stmt.BlockStatement block,
String name) |
static org.codehaus.groovy.ast.expr.ClosureExpression |
getClosure(org.codehaus.groovy.ast.stmt.BlockStatement block,
String name,
boolean remove)
Extract a top-level
name closure from inside this block if there is
one. |
static boolean |
hasAtLeastOneAnnotation(org.codehaus.groovy.ast.AnnotatedNode node,
String... annotations)
Determine if an
AnnotatedNode has one or more of the specified annotations. |
static boolean |
hasAtLeastOneAnnotation(org.codehaus.groovy.ast.ClassNode node,
String... annotations)
Determine if a
ClassNode has one or more of the specified annotations on
the class or any of its methods. |
static boolean |
hasAtLeastOneFieldOrMethod(org.codehaus.groovy.ast.ClassNode node,
String... types)
Determine if a
ClassNode has one or more fields of the specified types or
method returning one or more of the specified types. |
static boolean |
hasAtLeastOneInterface(org.codehaus.groovy.ast.ClassNode classNode,
String... types) |
static boolean |
subclasses(org.codehaus.groovy.ast.ClassNode node,
String... types)
Determine if a
ClassNode subclasses any of the specified types N.B. |
public static boolean hasAtLeastOneAnnotation(org.codehaus.groovy.ast.ClassNode node,
String... annotations)
ClassNode has one or more of the specified annotations on
the class or any of its methods. N.B. the type names are not normally fully
qualified.public static boolean hasAtLeastOneAnnotation(org.codehaus.groovy.ast.AnnotatedNode node,
String... annotations)
AnnotatedNode has one or more of the specified annotations.
N.B. the annotation type names are not normally fully qualified.public static boolean hasAtLeastOneFieldOrMethod(org.codehaus.groovy.ast.ClassNode node,
String... types)
ClassNode has one or more fields of the specified types or
method returning one or more of the specified types. N.B. the type names are not
normally fully qualified.public static boolean subclasses(org.codehaus.groovy.ast.ClassNode node,
String... types)
ClassNode subclasses any of the specified types N.B. the
type names are not normally fully qualified.public static boolean hasAtLeastOneInterface(org.codehaus.groovy.ast.ClassNode classNode,
String... types)
public static org.codehaus.groovy.ast.expr.ClosureExpression getClosure(org.codehaus.groovy.ast.stmt.BlockStatement block,
String name,
boolean remove)
name closure from inside this block if there is
one. Removes it from the block at the same time.block - a block statement (class definition)public static org.codehaus.groovy.ast.expr.ClosureExpression getClosure(org.codehaus.groovy.ast.stmt.BlockStatement block,
String name)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.