org.codehaus.aspectwerkz.reflect
Class ClassInfoHelper

java.lang.Object
  extended byorg.codehaus.aspectwerkz.reflect.ClassInfoHelper

public class ClassInfoHelper
extends Object

Utility method for manipulating and managing ClassInfo hierarchies.

Author:
Jonas Bonér , Alexandre Vasseur

Constructor Summary
ClassInfoHelper()
           
 
Method Summary
static MemberInfo createMemberInfo(Class targetClass, String withinMethodName, String withinMethodSignature)
          Creates a member info instance based on the signature etc.
static boolean extendsSuperClass(ClassInfo classInfo, String className)
          Checks if a class has a certain class as super class, somewhere up in the class hierarchy.
static boolean implementsInterface(ClassInfo classInfo, String interfaceName)
          Checks if a class implements a certain inteface, somewhere up in the class hierarchy.
static boolean isMethodStatic(MethodInfo methodInfo)
          Checks if a method is static or not.
static boolean matchInterfaces(ClassInfo[] interfaces, ClassInfo classInfo, TypePattern pattern)
          Tries to finds a parse at some interface in the hierarchy.
static boolean matchSuperClasses(ClassInfo classInfo, TypePattern pattern)
          Tries to finds a parse at some superclass in the hierarchy.
static boolean matchType(TypePattern typePattern, ClassInfo classInfo)
          Matches a type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInfoHelper

public ClassInfoHelper()
Method Detail

matchType

public static boolean matchType(TypePattern typePattern,
                                ClassInfo classInfo)
Matches a type.

Parameters:
typePattern - the pattern to try to parse against
classInfo - the info of the class
Returns:

matchSuperClasses

public static boolean matchSuperClasses(ClassInfo classInfo,
                                        TypePattern pattern)
Tries to finds a parse at some superclass in the hierarchy.

Only checks for a class parse to allow early filtering.

Recursive.

Parameters:
classInfo - the class info
pattern - the type pattern
Returns:
boolean

matchInterfaces

public static boolean matchInterfaces(ClassInfo[] interfaces,
                                      ClassInfo classInfo,
                                      TypePattern pattern)
Tries to finds a parse at some interface in the hierarchy.

Only checks for a class parse to allow early filtering.

Recursive.

Parameters:
interfaces - the interfaces
classInfo - the class info
pattern - the type pattern
Returns:
boolean

createMemberInfo

public static MemberInfo createMemberInfo(Class targetClass,
                                          String withinMethodName,
                                          String withinMethodSignature)
Creates a member info instance based on the signature etc.

Parameters:
targetClass -
withinMethodName -
withinMethodSignature -
Returns:
a member info instance

isMethodStatic

public static boolean isMethodStatic(MethodInfo methodInfo)
Checks if a method is static or not.

Parameters:
methodInfo - the info for the method
Returns:
boolean

implementsInterface

public static boolean implementsInterface(ClassInfo classInfo,
                                          String interfaceName)
Checks if a class implements a certain inteface, somewhere up in the class hierarchy.

Parameters:
classInfo -
interfaceName -
Returns:
true if we have a parse else false

extendsSuperClass

public static boolean extendsSuperClass(ClassInfo classInfo,
                                        String className)
Checks if a class has a certain class as super class, somewhere up in the class hierarchy.

Parameters:
classInfo - the meta-data for the class to parse
className - the name of the super class
Returns:
true if we have a parse else false


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.