org.codehaus.groovy.grails.compiler.injection
Class GrailsASTUtils

java.lang.Object
  extended by org.codehaus.groovy.grails.compiler.injection.GrailsASTUtils

public class GrailsASTUtils
extends Object

Helper methods for working with Groovy AST trees

Since:
0.3

Created: 20th June 2006

Author:
Graeme Rocher

Constructor Summary
GrailsASTUtils()
           
 
Method Summary
static String getFullName(org.codehaus.groovy.ast.ClassNode classNode)
          Gets the full name of a ClassNode
static org.codehaus.groovy.ast.ClassNode getFurthestParent(org.codehaus.groovy.ast.ClassNode classNode)
           
static boolean hasOrInheritsProperty(org.codehaus.groovy.ast.ClassNode classNode, String propertyName)
           
static boolean hasProperty(org.codehaus.groovy.ast.ClassNode classNode, String propertyName)
          Returns whether a classNode has the specified property or not
static boolean implementsOrInheritsZeroArgMethod(org.codehaus.groovy.ast.ClassNode classNode, String methodName, List ignoreClasses)
           
static boolean implementsZeroArgMethod(org.codehaus.groovy.ast.ClassNode classNode, String methodName)
          Tests whether the ClasNode implements the specified method name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrailsASTUtils

public GrailsASTUtils()
Method Detail

hasProperty

public static boolean hasProperty(org.codehaus.groovy.ast.ClassNode classNode,
                                  String propertyName)
Returns whether a classNode has the specified property or not

Parameters:
classNode - The ClassNode
propertyName - The name of the property
Returns:
True if the property exists in the ClassNode

hasOrInheritsProperty

public static boolean hasOrInheritsProperty(org.codehaus.groovy.ast.ClassNode classNode,
                                            String propertyName)

implementsZeroArgMethod

public static boolean implementsZeroArgMethod(org.codehaus.groovy.ast.ClassNode classNode,
                                              String methodName)
Tests whether the ClasNode implements the specified method name

Parameters:
classNode - The ClassNode
methodName - The method name
Returns:
True if it does implement the method

implementsOrInheritsZeroArgMethod

public static boolean implementsOrInheritsZeroArgMethod(org.codehaus.groovy.ast.ClassNode classNode,
                                                        String methodName,
                                                        List ignoreClasses)

getFullName

public static String getFullName(org.codehaus.groovy.ast.ClassNode classNode)
Gets the full name of a ClassNode

Parameters:
classNode - The class node
Returns:
The full name

getFurthestParent

public static org.codehaus.groovy.ast.ClassNode getFurthestParent(org.codehaus.groovy.ast.ClassNode classNode)


Copyright (c) 2005-2009 The Grails project