com.atlassian.plugin.util
Class ClassUtils

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

public class ClassUtils
extends Object

Class utility methods


Method Summary
static Set<Class> findAllTypes(Class cls)
          Finds all super classes and interfaces for a given class
static void findAllTypes(Class cls, Set<Class> types)
          Finds all super classes and interfaces for a given class
static
<T> List<Class<?>>
getTypeArguments(Class<T> baseClass, 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 Set<Class> findAllTypes(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(Class cls,
                                Set<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> List<Class<?>> getTypeArguments(Class<T> baseClass,
                                                  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:
IllegalArgumentException - If the child class is not the base of the baseClass
Since:
2.5.0


Copyright © 2015 Atlassian. All rights reserved.