org.codehaus.aspectwerkz.reflect
Class ReflectHelper

java.lang.Object
  extended by org.codehaus.aspectwerkz.reflect.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 String getClassSignature(Class cl)
          Returns JVM type signature for given class.
static String getConstructorSignature(Constructor constructor)
          Returns JVM type signature for a constructor.
static String getFieldSignature(Field field)
          Returns JVM type signature for a field.
static String getMethodSignature(Method method)
          Returns JVM type signature for a 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

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

getClassSignature

public static String getClassSignature(Class cl)
Returns JVM type signature for given class.

Parameters:
cl -
Returns:

getConstructorSignature

public static String getConstructorSignature(Constructor constructor)
Returns JVM type signature for a constructor.

Parameters:
constructor -
Returns:

getFieldSignature

public static String getFieldSignature(Field field)
Returns JVM type signature for a field.

Parameters:
field -
Returns:

getMethodSignature

public static String getMethodSignature(Method method)
Returns JVM type signature for a method.

Parameters:
method -
Returns:


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