org.apache.wicket.util.lang
Class Classes

java.lang.Object
  extended by org.apache.wicket.util.lang.Classes

public final class Classes
extends Object

Utilities for dealing with classes.

Author:
Jonathan Locke

Method Summary
static String name(Class<?> c)
          Gets the name of the given class or null if the class is null.
static Class<?> relativeClass(Class<?> scope, String path)
          Takes a Class and a relative path to a class and returns any class at that relative path.
static
<T> Class<T>
resolveClass(String className)
           
static
<C> String
simpleName(Class<C> c)
          Gets the name of a given class without the prefixed package path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

name

public static String name(Class<?> c)
Gets the name of the given class or null if the class is null.

Parameters:
c - The class
Returns:
The class name

relativeClass

public static Class<?> relativeClass(Class<?> scope,
                                     String path)
                              throws ClassNotFoundException
Takes a Class and a relative path to a class and returns any class at that relative path. For example, if the given Class was java.lang.System and the relative path was "../util/List", then the java.util.List class would be returned.

Parameters:
scope - The package to start at
path - The relative path to the class
Returns:
The class
Throws:
ClassNotFoundException

resolveClass

public static <T> Class<T> resolveClass(String className)
Type Parameters:
T - class type
Parameters:
className - Class to resolve
Returns:
Resolved class

simpleName

public static <C> String simpleName(Class<C> c)
Gets the name of a given class without the prefixed package path

Type Parameters:
C -
Parameters:
c - The class
Returns:
The class name


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.