org.tentackle.util
Class ReflectionHelper

java.lang.Object
  extended by org.tentackle.util.ReflectionHelper

public class ReflectionHelper
extends Object

Methods related to the reflection API.

Author:
harald

Constructor Summary
ReflectionHelper()
           
 
Method Summary
static StackTraceElement getApplicationInvocation()
          Gets the first invocation that does not start with any of the given package names.
static StackTraceElement getApplicationInvocation(String[] excludePackages)
          Gets the first invocation that does not start with any of the given package names.
static String getApplicationInvocationString()
          Gets the first invocation that does not start with any of the given package names.
static StackTraceElement getInvocation()
          Gets the stack trace element for the invoking method of the invoking method.
static StackTraceElement getInvocation(int ndx)
          Gets the stack trace element for some invoking method.
static String makeDeclareString(String classname)
          create a source-usable string from clazz.getName().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionHelper

public ReflectionHelper()
Method Detail

getInvocation

public static StackTraceElement getInvocation(int ndx)
Gets the stack trace element for some invoking method.

Parameters:
ndx - the index on the stack
Returns:
the StackTraceElement

getInvocation

public static StackTraceElement getInvocation()
Gets the stack trace element for the invoking method of the invoking method. Nice to figure out, what invokes a method.

Returns:
the StackTraceElement

getApplicationInvocation

public static StackTraceElement getApplicationInvocation(String[] excludePackages)
Gets the first invocation that does not start with any of the given package names. This is nice in Applications to check for the error.

Parameters:
excludePackages - list of package names to exclude, null if none
Returns:
the trace element

getApplicationInvocation

public static StackTraceElement getApplicationInvocation()
Gets the first invocation that does not start with any of the given package names. This is nice in Applications to check for the error.

Returns:
the trace element

getApplicationInvocationString

public static String getApplicationInvocationString()
Gets the first invocation that does not start with any of the given package names. This is nice in Applications to check for the error.

Returns:
the trace element

makeDeclareString

public static String makeDeclareString(String classname)
create a source-usable string from clazz.getName(). e.g. "[[[B" will be transformed to "byte[][][]"

Parameters:
classname - the classname
Returns:
the converted string


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de