Joda System API

org.joda.util
Class Reflection

java.lang.Object
  |
  +--org.joda.util.Reflection

public class Reflection
extends java.lang.Object

Reflection utilities.

Author:
Stephen Colebourne

Method Summary
static java.lang.Class[] getAllInterfaces(java.lang.Class cls)
          Get all the interfaces implemented by a class.
static java.lang.Class[] getAllInterfacesOfType(java.lang.Class cls, java.lang.Class intface)
          Get all the interfaces implemented by the passed in class which extend the specified interface.
static java.lang.Class[] getClassHierarchy(java.lang.Class cls, java.lang.Class stopClass)
          Get class hierarchy.
static java.lang.Class[] getInterfacesOfType(java.lang.Class cls, java.lang.Class intface)
          Get the immediate interfaces implemented by the passed in class which extend the specified interface.
static java.lang.String getShortenedClassName(java.lang.Class cls)
          Get the short class name for a class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllInterfacesOfType

public static java.lang.Class[] getAllInterfacesOfType(java.lang.Class cls,
                                                       java.lang.Class intface)
Get all the interfaces implemented by the passed in class which extend the specified interface. The interface passed in will not be in the returned list.

Parameters:
cls - the class to get interfaces for
intface - the interface to filter by. Only subinterfaces of this interface will be returned.
Returns:
A set containing interface Class objects

getAllInterfaces

public static java.lang.Class[] getAllInterfaces(java.lang.Class cls)
Get all the interfaces implemented by a class.

Parameters:
cls - the class to get interfaces for
Returns:
an array of Class objects

getInterfacesOfType

public static java.lang.Class[] getInterfacesOfType(java.lang.Class cls,
                                                    java.lang.Class intface)
Get the immediate interfaces implemented by the passed in class which extend the specified interface. The interface passed in will not be in the returned list.

Parameters:
cls - the class to get interfaces for
intface - the interface to filter by. Only subinterfaces of this interface will be returned.
Returns:
an array of Class objects

getClassHierarchy

public static java.lang.Class[] getClassHierarchy(java.lang.Class cls,
                                                  java.lang.Class stopClass)
Get class hierarchy.

Parameters:
cls - the class to get interfaces for
stopClass - the class to stop at, null will be treated as Object.class
Returns:
an array of Class objects

getShortenedClassName

public static java.lang.String getShortenedClassName(java.lang.Class cls)
Get the short class name for a class

Parameters:
cls - the class to get the class name for
Returns:
the class name without the package name

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.