com.atlassian.plugin.util
Class ClassUtils

java.lang.Object
  extended by com.atlassian.plugin.util.ClassUtils

public class ClassUtils
extends java.lang.Object

Class utility methods


Method Summary
static java.util.Set<java.lang.Class> findAllTypes(java.lang.Class cls)
          Finds all super classes and interfaces for a given class
static void findAllTypes(java.lang.Class cls, java.util.Set<java.lang.Class> types)
          Finds all super classes and interfaces for a given class
static
<T> java.util.List<java.lang.Class<?>>
getTypeArguments(java.lang.Class<T> baseClass, java.lang.Class<? extends T> childClass)
          Get the actual type arguments a child class has used to extend a generic base class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findAllTypes

public static java.util.Set<java.lang.Class> findAllTypes(java.lang.Class cls)
Finds all super classes and interfaces for a given class

Parameters:
cls - The class to scan
Returns:
The collected related classes found

findAllTypes

public static void findAllTypes(java.lang.Class cls,
                                java.util.Set<java.lang.Class> types)
Finds all super classes and interfaces for a given class

Parameters:
cls - The class to scan
types - The collected related classes found

getTypeArguments

public static <T> java.util.List<java.lang.Class<?>> getTypeArguments(java.lang.Class<T> baseClass,
                                                                      java.lang.Class<? extends T> childClass)
Get the actual type arguments a child class has used to extend a generic base class.

Parameters:
baseClass - the base class
childClass - the child class
Returns:
a list of the raw classes for the actual type arguments.
Throws:
java.lang.IllegalArgumentException - If the child class is not the base of the baseClass
Since:
2.5.0


Copyright © 2010 Atlassian. All Rights Reserved.