org.codehaus.aspectwerkz.transform
Class ReflectHelper

java.lang.Object
  extended byorg.codehaus.aspectwerkz.transform.ReflectHelper

public class ReflectHelper
extends Object

Helper class with utility methods for working with the java.lang.reflect.* package.

Author:
Jonas Bonér

Constructor Summary
ReflectHelper()
           
 
Method Summary
static int calculateHash(Class klass)
          Calculate the hash for a class.
static int calculateHash(Constructor constructor)
          Calculate the hash for a constructor.
static int calculateHash(Field field)
          Calculate the hash for a field.
static int calculateHash(Method method)
          Calculate the hash for a method.
static List createCompleteSortedMethodList(Class klass)
          Creates a sorted method list of all the methods in the class and super classes, including package private ones.
static List createInterfaceDefinedSortedMethodList(Class klass, List interfaceDeclaredMethods)
          Creates a sorted method list of all the methods in the class and super classes, if and only if those are part of the given list of interfaces declared method
static int getModifiersAsInt(String[] modifiers)
          Converts modifiers represented in a string array to an int.
static Class getPrimitiveClass(String className)
          Checks if the class is a of a primitive type, if so create and return the class for the type else return null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectHelper

public ReflectHelper()
Method Detail

createCompleteSortedMethodList

public static List createCompleteSortedMethodList(Class klass)
Creates a sorted method list of all the methods in the class and super classes, including package private ones.

Parameters:
klass - the class with the methods
Returns:
the sorted method list

createInterfaceDefinedSortedMethodList

public static List createInterfaceDefinedSortedMethodList(Class klass,
                                                          List interfaceDeclaredMethods)
Creates a sorted method list of all the methods in the class and super classes, if and only if those are part of the given list of interfaces declared method

Parameters:
klass - the class with the methods
interfaceDeclaredMethods - the list of interface declared methods
Returns:
the sorted method list

getModifiersAsInt

public static int getModifiersAsInt(String[] modifiers)
Converts modifiers represented in a string array to an int.

Parameters:
modifiers - the modifiers as strings
Returns:
the modifiers as an int

calculateHash

public static int calculateHash(Class klass)
Calculate the hash for a class.

Parameters:
klass - the class
Returns:
the hash

calculateHash

public static int calculateHash(Method method)
Calculate the hash for a method.

Parameters:
method - the method
Returns:
the hash

calculateHash

public static int calculateHash(Constructor constructor)
Calculate the hash for a constructor.

Parameters:
constructor - the constructor
Returns:
the hash

calculateHash

public static int calculateHash(Field field)
Calculate the hash for a field.

Parameters:
field - the field
Returns:
the hash

getPrimitiveClass

public static Class getPrimitiveClass(String className)
Checks if the class is a of a primitive type, if so create and return the class for the type else return null.

Parameters:
className -
Returns:
the class for the primitive type or null


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