org.codehaus.aspectwerkz.util
Class Util

java.lang.Object
  extended by org.codehaus.aspectwerkz.util.Util

public final class Util
extends Object

Utility methods and constants used in the AspectWerkz system.

Author:
Jonas BonŽr

Field Summary
static Boolean BOOLEAN_DEFAULT_VALUE
           
static Byte BYTE_DEFAULT_VALUE
           
static Character CHARACTER_DEFAULT_VALUE
           
static Double DOUBLE_DEFAULT_VALUE
           
static Float FLOAT_DEFAULT_VALUE
           
static Integer INTEGER_DEFAULT_VALUE
           
static Long LONG_DEFAULT_VALUE
           
static Short SHORT_DEFAULT_VALUE
           
 
Constructor Summary
Util()
           
 
Method Summary
static Boolean booleanValueOf(boolean b)
          Helper method to support Java 1.4 like Boolean.valueOf(boolean) in Java 1.3
static Integer calculateHash(String className, ReflectionInfo info)
          Calculates the hash for the class name and the meta-data.
static String classLoaderToString(ClassLoader loader)
          Returns a String representation of a classloader Avoid to do a toString() if the resulting string is too long (occurs on Tomcat)
static void fakeStackTrace(Throwable exception, String className)
          Removes the AspectWerkz specific elements from the stack trace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTEGER_DEFAULT_VALUE

public static final Integer INTEGER_DEFAULT_VALUE

FLOAT_DEFAULT_VALUE

public static final Float FLOAT_DEFAULT_VALUE

DOUBLE_DEFAULT_VALUE

public static final Double DOUBLE_DEFAULT_VALUE

LONG_DEFAULT_VALUE

public static final Long LONG_DEFAULT_VALUE

BOOLEAN_DEFAULT_VALUE

public static final Boolean BOOLEAN_DEFAULT_VALUE

CHARACTER_DEFAULT_VALUE

public static final Character CHARACTER_DEFAULT_VALUE

SHORT_DEFAULT_VALUE

public static final Short SHORT_DEFAULT_VALUE

BYTE_DEFAULT_VALUE

public static final Byte BYTE_DEFAULT_VALUE
Constructor Detail

Util

public Util()
Method Detail

calculateHash

public static Integer calculateHash(String className,
                                    ReflectionInfo info)
Calculates the hash for the class name and the meta-data.

Parameters:
className - the class name
info - the meta-data
Returns:
the hash

fakeStackTrace

public static void fakeStackTrace(Throwable exception,
                                  String className)
Removes the AspectWerkz specific elements from the stack trace.

TODO: how to mess w/ the stacktrace in JDK 1.3.x?

Parameters:
exception - the Throwable to modify the stack trace on
className - the name of the fake origin class of the exception

classLoaderToString

public static String classLoaderToString(ClassLoader loader)
Returns a String representation of a classloader Avoid to do a toString() if the resulting string is too long (occurs on Tomcat)

Parameters:
loader -
Returns:
String representation (toString or FQN@hashcode)

booleanValueOf

public static Boolean booleanValueOf(boolean b)
Helper method to support Java 1.4 like Boolean.valueOf(boolean) in Java 1.3

Parameters:
b -
Returns:


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